Rhizome
A JIT for Ruby, implemented in pure Ruby
Install / Use
/learn @chrisseaton/RhizomeREADME
Rhizome - a JIT for Ruby, implemented in pure Ruby

Rhizome is a paedagogical just-in-time compiler (JIT) for Ruby, implemented in pure Ruby. It's not really designed to be used. It's designed to show you how JITs work and why perhaps a JIT for Ruby should be written in Ruby. It's also designed to try to go beyond the trivial aspects of a simple template compiler that introductions to JITs often show - instead it has a proper intermediate representation (IR) and shows how more advanced parts of compilers such as lowering and schedulers work, that people don't usually cover.
Unfortunately Rhizome was a stalled side-project that I never finished. The current state of the repository is as I left it off.
By Chris Seaton.
How to read this repository
You're supposed to read it, not use it!
There are experiments and documents. The experiments are little programs that show you how one part of the system works, often generating graphs as output, and the documents explain things in more depth with some references and some ideas for readers.
To run an experiment run bundle exec experiments/foo.rb. It'll either show some output or will generate a graph. Then also read it.
The recommended reading order is:
- Parser
- Bytecode
- Interpreter
- Inline caching
- Intermediate representation
- Construction
- Graphviz
- Optimisations
- Inlining
- Handles and tagging
- Lowering
- Scheduler
- Code generation
- Registers
- Memory
- Assembler
- Disassembler
- Deoptimisation
I'm very sorry it's not more polished! Hopefully you can get something out of it.
Running
% brew install graphviz
% bundle install
% bundle exec rspec
Licence
Copyright (c) 2016-2017 Chris Seaton. Available under the MIT licence.
Related Skills
node-connect
349.7kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.7kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
349.7kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
349.7kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
