JavaScript framework for Actor-based programming

Actors are concurrent isolated units of computation, which process messages using their predefined behaviour. This study explores the suitability of the actor model when used to bring concurrency and parallelism to JavaScript. The proposed implementation takes the form of two APIs for both the Node.js and browser environments respectively, allowing developers to intuitively reason about engineering JavaScript programs through the spawning and sending
of messages to actors.

Isolated actors could be safely spawned on remote devices over a network and utilise multiple cores on a local processor. This allows for distributed and parallel computation which have the potential of shortening the time taken to execute computationally intensive tasks. A WebSocket server was used to connect a finite number of Node.js instances and browsers hosting actors over the network. Faster communication links were explored using inter-process communication when hosting multiple processes on a local device. The framework abstracted the adaptive use of different communication links, providing location transparency for remote actors.

Benchmarks were set to analyse the framework’s performance when used on a single instance using Node.js or a browser, as well as the speed-up introduced when utilising additional local or distributed cores working on the same task. The performance of the JavaScript framework developed through this project was evaluated against existing JVM and JavaScript actor framework implementations. The relative performance of the communication links used when
distributing actors was also explored.

Nowadays, browsers are found on devices such as smart fridges and TVs, both of which could run JavaScript defined behaviour. The increasingly popular Node.js environment for server-side applications would be able to host actors that could communicate with actors hosted on browsers, enabling uniform and flexible scaling of applications. This study also included an assessment of the
limitations of the framework, as well as its untapped potential in freezing and migrating actors across the web.

Figure 1. Network of devices running processes with actors
Figure 2. Speed-up introduced when running multiple workers

Student: Andrew Buhagiar
Course: B.Sc. (Hons.) Computing Science
Supervisor: Prof. Kevin Vella