MEP-56 research bundle: Mochi to Ruby transpiler
Author: research pass for MEP-56 (Mochi to Ruby transpiler). Date: 2026-05-29 (GMT+7).
This bundle contains the twelve research notes that informed MEP-56, the Mochi-to-Ruby transpiler. The notes are informative; the normative spec is in the MEP body.
| # | Title | Topic |
|---|---|---|
| 01 | Language surface | Mochi features mapped onto CRuby 3.2+ / JRuby / TruffleRuby lowering obligations |
| 02 | Design philosophy | Why Ruby 3.2 floor, why Data.define records, why Thread::SizedQueue streams |
| 03 | Prior-art transpilers | Opal (Ruby-to-JS), RubyMotion, Crystal, mruby, JRuby, TruffleRuby, Artichoke |
| 04 | Runtime building blocks | CRuby stdlib, Thread, Fiber, Data.define, Enumerator::Lazy, net/http, json |
| 05 | Codegen design | Ruby source via rtree IR, aotir reuse, 2-space indent, rubocop-compatible output |
| 06 | Type-system lowering | Mochi types onto Integer/Float/String/Array/Hash/Set/Data.define/lambda |
| 07 | Ruby target and portability | CRuby 3.2/3.4/4.0, JRuby 10, TruffleRuby 33, mruby 4 subset, Tebako binary |
| 08 | Dataset pipeline | Query DSL via Enumerable::Lazy, group_by with sorted keys, compile-time Datalog |
| 09 | Agents and streams | Agents as Ruby classes + Thread, Thread::SizedQueue MPMC broadcast streams |
| 10 | Build system | RubyGems gemspec, Bundler, IRuby kernel, Tebako packaging, TruffleRuby native |
| 11 | Testing gates | Per-phase Go test gates, vm3 oracle, CRuby/JRuby/TruffleRuby matrix in CI |
| 12 | Risks and alternatives | mruby subset limitations, TruffleRuby polyglot API, Tebako signing, cassette drift |
The companion MEP body lives at /docs/mep/mep-0056. Implementation tracking lives at /docs/implementation/0056/.