Julia's Killer App(s): Implementing State Machines Simply using Multiple Dispatch
2019-07-25 , Room 349

Julia's embrace of multiple dispatch as a key organizing concept provides
developers with all the tools they need to simply implement state machine based
solutions to a wide range of problems. This presentation will explore a series
of increasingly complex tasks that can all be addressed using a clever
combination of types and multiple dispatch.


In the universe of programming languages, success for any new language hangs on
its ability to simplify some class of problem that exceed the capabilities of
other existing languages to generate simple solutions for. The concept of a
state machine is a powerful tool that programmers have used for ages to address
all manner of challenges, but until now implementing a state machine has
typically required either the use of involved external libraries or the design
of relatively opaque algorithms and data structures. Julia changes all of that
by embracing multiple dispatch and an extensible type system that, together,
provide everything a programmer requires to design and develop even the most
complex of state machines.

This presentation will begin with a basic introduction to the concepts behind
state machines and their implementation and then dive into an example of how
one might use the concept of a state machine to handle the parsing of a regular
expression into a Julia data structure. Continuing from there, we will look at
how matching a regular expression to a string can, itself, be implemented using
a state machine. All the while, we will only require Julia, its type system,
and a handful of multiply dispatched methods.

Finally, we will review various ways in which state machines implemented in
Julia can be extended and iterated upon without requiring any new libraries or
tools beyond those used in their initial implementation. We will also consider
how even more complex tasks, including even an entire HTTP request/response
handler, can be tackled using the exact same approach. By the end, it should be
clear that the killer feature that Julia brings to the world of programming
languages is the ability to develop state machines in a way that is clear,
concise, performant, and infinitely flexible.