Skip to content
Permalink
trunk
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time

Design and Goals

Artichoke is a platform for building Ruby implementations. You can build a ruby/spec-compliant Ruby by combining Artichoke core, a VM and parser backend, and the Artichoke frontend.

Artichoke is designed to enable experimentation. The top goals of the project are:

Core

artichoke-core contains traits for the core set of APIs an interpreter must implement. The traits in artichoke-core define:

  • APIs a concrete VM must implement to support the Artichoke runtime and frontends.
  • How to box polymorphic core types into Ruby Value.
  • Interoperability between the VM backend and the Rust-implemented core.

Some of the core APIs a Ruby implementation must provide are evaluating code, converting Rust data structures to boxed Values on the interpreter heap, and interning Symbols.

Runtime

Artichoke core provides an implementation-agnostic Ruby runtime. 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.

Embedding

Artichoke core will support embedding with:

Experimentation

A Rust-implemented Ruby runtime offers an opportunity to experiment with:

VM Backend

Artichoke core does not provide a parser or a VM for executing Ruby. VM backends provide these functions.

Artichoke currently includes an mruby backend. There are plans to add an MRI backend and a pure Rust backend.

VM backends are responsible for passing 100% of the Language Ruby specs.

Experimentation

VM backends offer an opportunity to experiment with:

Frontend

Artichoke will include ruby and irb binary frontends with dynamically selectable VM backends.

Artichoke will produce a WebAssembly frontend.

Artichoke will include implementation-agnostic C APIs targeting: