Aura is a native compilation variant of the Elixir programming language that is intended for system & games programming.

Elixir is great, I’ve been using it more or less exclusively (other than a smattering of Ruby & Objective-C) for about 5 years now. The BEAM is great and a perfect fit for web applications.

But I’ve also written a compiler, a virtual machine, and a bunch of command-line tools using Elixir and here the story is not so great principally because it means deploying the Erlang/BEAM/OTP runtime system. Burrito helps by making installation much easier to manage. But its friction and I don’t like friction. And I like fast.

So I have embarked on making a variant of Elixir that compiles to native code, no runtime.

Obviously that means some changes. No BEAM, so no cheap processes, no spawn/receive, no OTP. But that’s okay. If you need those things Elixir/BEAM is still great.

But we keep the syntax and semantics largely the same. The goal is that any “generic” Elixir code should compile. But in principle it’s not expected that you’re going to take your Elixir app and native compile it. It’s absolutely not a goal that you can write Phoenix/Liveview apps with this thing. It’s about being able to take the Elixir language into areas where the BEAM is not a good fit: systems and games.

My current approach uses Elixir as a bootstrap. This allows me to use the Elixir parser to generate a macro-expanded AST ready to use. That’s a big win. The AST converted into Aura IR and then lowered into LLVM.

Memory management will, in the first case, be by naive automated reference counting. No GC. It’s a goal to look into the Perceus algorithm which should suit Aura. But I am also looking at other, pluggable, allocation strategies but not likely Rust style, too much friction.

Parallelism will be via system threads. Immutable data should still give us a win here.

I’m making use of Elixir’s new gradual typing to handle types.

defmodule Main
  @spec main() :: integer
  def main() do
    ...
    42
  end
end

Ultimately Aura is a huge project and I am not sure I have the time, the will, or the skill to bring it off. At the moment I am enjoying exploring it and getting a small moment of joy when I can native compile some new piece of Elixir code and run it. But I’m about a million miles from a working 1.0.