Aria VM/iroha

A small but runnable stack-based VM, implemented with a coroutine, written in Rust, that can run quite a few interesting programs.

And a web view: a SolidJS + WASM based SPA, that can show you how such programs will run on this VM, because explaining how this VM works is a bit not easy without a handy visualization of stack, memory and activation records.

Written by Codex with some helps of me.

Inspiration

This was a personal compiler project at 2023, initiated as a strange VM for some educational reason, then abandoned. The initial inspiration of such a strange project was still losing albeit I am trying to retrieve it. But the inspiration of using Codex for such thing, is that I used Codex for some previous works in PL exploration this year and it works like a charm. So I tried it.

What it does

A stack-based VM that you can use it to run some programs, just like Lua or JVM do.

And a SolidJS front-end that do the visualization for educational purpose. Unfortunately it does not allow you to do live editing and build your own source right now. But a few code examples should be sufficient to have a first image on this VM.

How we built it

We (me and Codex) investigated the old repo, rescued the lost spec, tried to find out what was under the drafts and hand written codes, then we discussed, we planned, Codex do the work and we discussed again.

Challenges we ran into

The most hard challenge may be to rescue some ideas hidden in 2023, tried to formalize them without deriving into a project that has nothing to do with that 2023 initiative. I think luckily that may be what my agentic workflow is better suitable.

Accomplishments that we're proud of

Rescued a nearly dead compiler project and give it a first time where it's really running.

What we learned

Stack based VM, compiler design, coroutine/continuation, memory and frame layout, but also a bit of visualization, WASM toolchain and SolidJS' reactivity.

And what's the most important, how to use Codex to achieve a real project from some drafts where the intentions and initial ideas are just a few or even may be lost.

What's next for Project Aria

Quite a lot of things to do, I won't say I already have a plan but here are a few things just can be achieved in next stages:

  • Make the VM a bit more "production-grade" for richer expressiveness of programs,
  • Implement the left-panel IR code and make the translation between left and right panel,
  • Improve the tooling UX and make the VM a bit more of observability,
  • Use it to write some more complex programs, to find out what we are missing for next turns,
  • ... and so on.

Built With

Share this project:

Updates