Implementing Actors in JavaScript

JavaScript does not exactly have an ideal semantic model for implementing Actors. Execution is single-threaded and sequential. Most objects are mutable by default. However, it has the advantage of being the most available and widely used computer language, so it seems worthwhile to show how actors can be used in this environment. Asynchronous Programming JavaScript […]

Posted in Uncategorized | Leave a comment

Towards a Universal Implementation of Unforgeable Actor Addresses

[It is my pleasure to welcome my colleague and collaborator, Tristan Slominski, as a guest-blogger —Dale] In the popular implementations of the Actor Model, actor addresses are usually globally available to any other actor desiring to discover them. However, in the original Actor Model formulation[1], the actors can only know about acquaintances explicitly provided to […]

Posted in Uncategorized | 1 Comment

Debugging Actor Systems

Software development is a defect injection process. With every line of code we write, we have a chance of introducing unintended behavior into the system. This chance increases with conceptual complexity. The more difficult a system is to understand, the greater our chance of introducing defects. In his 1980 Turing Award lecture, Tony Hoare said […]

Posted in Uncategorized | Tagged , , , , , , , , , , | 1 Comment

Producer/Consumer Rate-Matching

Flow control is a critical feature in a network of asynchronous communicating processes. Our fanciful exploration of a yak-shaving barber’s shop provided us with patterns we can apply to more general problems. The bounded-buffer mechanism is a generalization of our barber’s waiting room. It mediates between producers and consumers, matching the rate of production with […]

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , | Leave a comment

“Sleeping Barber” in Humus

The “Sleeping Barber” problem is another classic concurrency example. As with our previous discussion of “Dining Philosophers”, actors allow a novel approaching to solving this problem. We will adjust a few of the details to enhance the metaphor and have a bit of fun with it. Our metaphorical barber provides yak shaving services. Yaks arrive […]

Posted in Uncategorized | Tagged , , , , , , , , , | 5 Comments

Futures and Capabilities

In the Actor Model, concurrency is the default. Sequencing must by arranged explicitly. An important case of sequencing occurs when there is a data dependency between different parts of a system. One part produces a value that another part needs to perform its function. One mechanism for sequencing data-dependent operations is to create a Future. […]

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , , , | 2 Comments

Implementing Actors in Kernel

Now is the time we come full-circle in our exploration of Kernel/Scheme/LISP and show how Actors can be implemented on this foundation. This should dispel the notion that Actors are just functions/procedures. Sure, when an Actor receives a message you could say that the message is “applied” to the Actor’s current behavior. In that sense, […]

Posted in Uncategorized | Tagged , , , , , , , , , , , | Leave a comment

Mutable Objects in Kernel

One important difference between Kernel and traditional LISP/Scheme is Kernel’s pervasive use of encapsulated types [1]. There is a clear distinction in Kernel between decomposable structures and opaque objects. Encapsulated types are a significant contributor toward smooth extensibility. They allow the definition of objects, and operations on those object, that are indistinguishable from primitives. We […]

Posted in Uncategorized | Tagged , , , , , | 8 Comments

Semantic Extensibility with Vau

John Shutt has reformulated the foundations of LISP/Scheme [1]. Observing that Lambda is a primitive applicative constructor, he proposes Vau as a primitve operative constructor instead. This changes our focus from implicit evaluation to explicit evaluation. Applicatives evaluate their operands before evaluating the combination. Operatives act directly on their (unevaluated) operands, possibly evaluating them selectively. […]

Posted in Uncategorized | Tagged , , , , , , , , , , , | 5 Comments

Fexpr the Ultimate Lambda

This article is dedicated to the memory of John McCarthy (1927–2011) We are constantly on a quest for the elegant combination of simplicity and expressiveness in computer languages—what Alan Kay calls the “Maxwell’s Equations of Software“. An important early milestone was John McCarthy’s LISP [1] (The evolution of these ideas and the thinking behind them […]

Posted in Uncategorized | Tagged , , , , , , , , , , , , , , | 7 Comments

High Availability for Mutable Shared State

Mutable shared state is the root of all evil in concurrent systems. The history of concurrent computation is a basically the story of approaches to managing mutable shared state. The thread model, which has long held the dominant position, leads to intractable complexity [1]. The actor model captures state in the behavior of an actor. […]

Posted in Uncategorized | Tagged , , , , , , , , | 2 Comments

Erlang-style Mailboxes

One significant difference between message-passing in Erlang and the pure Actor Model is the Erlang concept of mailboxes. Actors don’t have mailboxes, at least not in the sense that they can be queried. Messages simply arrive at some non-deterministic time after they are asynchronously sent, invoking the current behavior of the actor. However, in Erlang, […]

Posted in Uncategorized | Tagged , , , , , , | Leave a comment

Finger Tree: A Functional Value Object

A Finger Tree is a data-structure that supports amortized O(1) additional and removal of elements from either end [1]. It also can support a large number of common sequence operations, including concatenation, very efficiently. Our implementation is based on the Hinze-Paterson structure [2], simplified for use as a Deque. It is possible to implement a […]

Posted in Uncategorized | Tagged , , , , , , , | 8 Comments

In-Order Message Delivery

The Actor Model explicitly avoids placing constraints on message delivery order beyond causality [1]. Messages may not be delivered before the message which caused them to be sent. In other words, time can’t flow backward. Beyond that, messages arrive in a non-deterministic order. This can sometimes have surprising consequences. Two messages sent in sequence from […]

Posted in Uncategorized | Tagged , , , , , , | 1 Comment

Circuit Breaker Stability Pattern

[Update 2014-02-02: I've posted a video showing a visualization of this pattern at http://www.youtube.com/watch?v=WEXh1WoppMU] In a loosely-coupled system connected with asynchronous messages, a flood of client requests can exceed the capacity of a service. When this happens, we would prefer that the service respond with an indication of the overloaded condition, rather than making us […]

Posted in Uncategorized | Tagged , , , , , | Leave a comment

Actors Make Better Observers

The Observer pattern causes temporal coupling in systems with synchronous message passing. This can lead to failure in Object-Oriented systems. Asynchronous messaging avoids the pitfalls. Actor-based implementations more accurately realize the original intent of the pattern. The intent of the Observer pattern is to “define a one-to-many dependency between objects so that when one object […]

Posted in Uncategorized | Tagged , , , , , , , , , , | 2 Comments

Parsing Expression Grammars, part 4

This article could probably be called “Left Recursion Considered Harmful“. PEG parsers are unambiguous and relatively easy to reason about. A little reasoning about left-recursive PEGs shows that they don’t make sense. The motivation to use left recursion seems to be driven by the desire to build left-associative parse-trees for arithmetic operators. However, parse-tree generation […]

Posted in Uncategorized | Tagged , , , , , , , | 2 Comments

Parsing Expression Grammars, part 3

We build on the parsers from part 2 of this series to enhance and extend their capability. In particular, we extend the concept of modular grammars to construct chains of parsers which define a multi-stage transformation pipeline. The parsers forming these chain are enhanced to match and transform tree-structures, rather than being limited to simple […]

Posted in Uncategorized | Tagged , , , , , , , | Leave a comment

Parsing Expression Grammars, part 2

It’s usually not enough to simply recognize patterns in an input stream. Soon we will want to take action based on what we recognize. In order to facilitate this, we will begin creating semantic values from the input tokens and trigger semantic actions when certain patterns are recognized. In part 1 of this series we […]

Posted in Uncategorized | Tagged , , , , , , , , , | 2 Comments

Parsing Expression Grammars, part 1

Parsing Expression Grammars (PEGs) define a powerful class of matchers for recognizing strings of a formal language [1]. They’re well suited to parsing the syntax of computer languages. PEG-based tools like OMeta [2] have been successfully applied to a wide variety of transformation problems [3] [4]. The fundamental elements of PEGs can be described compactly […]

Posted in Uncategorized | Tagged , , , , , | 2 Comments