Most of the obvious reasons for considering Elixir-based subsystem(s) for Monty have to do with the BEAM’s ability to provide robust (e.g., convenient, fail-soft, performant, reliable, scalable, soft real-time) infrastructure for concurrent and/or distributed sets of lightweight processes (i.e., Actors).
That said, Elixir itself has a lot of useful add-ons and features, including:
- Axon (high-level interface for creating neural network models)
- Livebook (executable notebook, ala Jupyter)
- Macros (Lisp-style syntactic macros)
- Nerves (support for networks of embedded Elixir systems)
- Nx (numerical Elixir, optimized for CPU and GPU usage)
- OTP (support for concurrency, distribution, etc.)
- Phoenix Framework (Elixir-based web framework)
- Pythonx (Python interpreter embedded in Elixir)
- …
Although all of this seems pretty compelling to me, it’s far from the whole story. In particular, it says very little about ways in which using Elixir can affect the way that programs are written. So, let’s get into it…
One obvious difference between Elixir and Python is that Elixir is based on a (very digestible, IMHO) flavor of functional programming (FP), as opposed to (say) object-oriented programming (OOP).
So, for example, values are immutable, but variables can be reassigned. Along with avoiding race conditions in concurrent systems, this is in line with Jessica Joy Kerr’s pithy observation:
GOTO was evil because we asked, “how did I get to this point of execution?”. Mutability leaves us with, “how did I get to this state?”.
In terms of digestibility, Elixir eschews monads and such, allowing us to stop trying to understand statements like this: “a monad is a monoid in the category of endofunctors”. And, although Elixir (like Python) is a dynamic programming language, it is in the process of incorporating some extremely cool tech: gradual set-theoretic types.
Anyway, while (re)watching some Dave Thomas videos, I came across a couple that might answer @vclay’s request for introductory talks, while presenting interesting conceptual content, historical background, and some ideas that venture near Monty-related topics.
In Stroop, Whorf, And Elixir, Dave provides a gentle introduction to (and arguments for) Elixirish ways of thinking about programming. The video is fairly long, but well worth watching (including the Q/A session at the end).
As a historical update, note that this talk was given about a decade ago. Thus, any questions about Elixir being “ready for prime time” have been successfully resolved (i.e., it’s VERY stable).
More recently, Dave gave an untitled talk at the 2019 Gig City Elixir.
In this talk, he dives even deeper into programming philosophy and practice. A lot of fun, albeit a bit chewy in spots… (FYI, the actual talk material begins here).
Starting with a quote from Yogi Berra (“If the world was perfect, it wouldn’t be.”), Dave explores the notion of using Elixir to do exploratory (and necessarily imperfect) things. This is pretty much my vision for Monty in a nutshell, but Dave goes on to describe an Elixir-based system that has a lot of things in common with Monty, including pattern recognition.
To get there, he wanders through a discussion of Prolog, Erlang, procedural and declarative programming, pattern matching, Datalog, Datomic, tuple spaces, Dedalus, etc. Along the way, he presents this (mock) quote from Zoltar:
For our visually handicapped friends, here is a textual version:
Your Fortune
I predict that in the future, software will be written as small decoupled components that interact over a dynamic and evolving large scale network.
Your lucky color is purple.
This sounds quite a bit like Monty to me, though the details of his notion(s) vary substantially (!). Then again, in a research project, it’s OK (indeed, required) to try out various approaches.
For example, I went down a small rabbit hole regarding Datalog, Dedalus, Graph Databases, etc. I think this could be a useful way to search Monty’s “discoveries”, but getting there would clearly require some Real Work
. FYI, here’s a page that covers some recent work in this area: Dedalus: Datalog in Time and Space
Anyway, I strongly recommend watching both videos (and really, almost anything from Dave Thomas)…