Artichoke is a platform for building MRI-compatible Ruby implementations. Artichoke provides a Ruby runtime implemented in Rust that can be loaded into many VM backends.
A Ruby implementation based on Artichoke consists of three components: Artichoke core, a VM backend, and the Artichoke frontend.
Artichoke core exposes a set of traits that define:
- Capabilities of a VM backend.
- Capabilities of a Ruby
- Interoperability between the VM backend and the Rust-implemented core.
Artichoke core provides an implementation-agnostic Ruby runtime which any implementation can load. The runtime in Artichoke core will pass 100% of the Core and Standard Library Ruby specs. The runtime will be implemented in a hybrid of Rust and Ruby. The
Regexp implementation is a representative example of the approach.
Artichoke core will support embedding with:
- Multiple filesystem backends, including an in-memory virtual filesystem.
- Optional standard-library.
- Optional multi-threading.
- Capturable IO.
A Rust-implemented Ruby runtime offers an opportunity to experiment with:
- Improving performance of MRI Core and Standard Library.
- Implementing the runtime with state-of-the-art dependencies.
- Distributing single-binary builds.
Artichoke core does not provide a parser or a VM for executing Ruby. VM backends provide these functions.
VM backends are responsible for passing 100% of the Language Ruby specs.
VM backends offer an opportunity to experiment with:
- Dynamic codegen.
- Parallelism and eliminating the GIL.
- Memory management and garbage collection techniques.
Artichoke will include
irb binary frontends with dynamically selectable VM backends.
Artichoke will produce a WebAssembly frontend.
Artichoke will include implementation-agnostic C APIs targeting:
If you would prefer to run a local build, set up a Rust toolchain and launch an interactive Artichoke shell with:
cargo run -p artichoke-frontend --bin airb
Artichoke aspires to be a Ruby 2.6.3-compatible implementation of the Ruby programming language. There is lots to do.
If Artichoke does not run Ruby source code in the same way that MRI does, it is a bug and we would appreciate if you filed an issue so we can fix it.
If you would like to contribute code
If you'd like to engage in a discussion outside of GitHub, you can join Artichoke's public Discord server.