Add opt-in "mruby-*-prism" mgem family#6896
Conversation
ref mruby#6707 Import PicoRuby's Prism-based compiler (mruby-compiler2) as `mruby-compiler-prism` and add Prism variants of the compiler-dependent tools (PicoRuby also uses them): - `mruby-bin-mrbc-prism` - `mruby-bin-mruby-prism` - `mruby-bin-mirb-prism` - `mruby-eval-prism` Add `build_config/prism.rb` and `mrbgems/prism.gembox` so the Prism stack can be tested explicitly. Also add `MRB_COMPILER_PRISM=yes` as a shorthand for the Prism build config when no `MRUBY_CONFIG`/`CONFIG` is already set. Keep normal mruby builds unchanged by excluding `*-prism` gems from `full-core.gembox`. This prevents regular CI from accidentally mixing `mruby-compiler` and `mruby-compiler-prism`. Adapt the imported compiler for standalone mruby while keeping the compiler library embeddable: - select `MRC_TARGET_MRUBY` / `MRC_TARGET_MRUBYC` from build defines - keep mruby-only compatibility code behind `MRC_TARGET_MRUBY` - move `global_mrb` ownership out of the compiler library - define `global_mrb` in `mrbc-prism`, `mruby-prism`, `mirb-prism`, and Prism-enabled `mrbtest` - make Prism test builds link successfully - update Prism bintests for the new command names `global_mrb` is mruby's process-wide `mrb_state *` hook used by executable frontends and test runners for APIs and callbacks that do not carry an explicit owner `mrb_state`. It is runtime/frontend state, so `mruby-compiler-prism` must not define or own it. PicoRuby and FemtoRuby provide their own VM ownership model and must remain able to link the compiler without mruby-specific global state. Please read `mruby-compiler-prism/README.md` documenting the current Prism status, test split, known remaining failures, and compatibility boundaries for PicoRuby/FemtoRuby. Verified: - `rake MRUBY_CONFIG=ci/gcc-clang -T` - `MRB_COMPILER_PRISM=yes rake -T` - `MRB_COMPILER_PRISM=yes rake test:build` - `build/host/bin/mruby-prism -e 'p 1 + 2'` - `build/host/bin/mruby-prism -e 'p eval("1 + 2")'` Known remaining work: - Prism bintests still have behavioral/output differences. - Full `MRB_COMPILER_PRISM=yes rake test` is not expected to pass yet.
There was a problem hiding this comment.
Code Review
This pull request introduces Prism-based compiler support for mruby by adding several new gems and tools, including mruby-compiler-prism, mruby-bin-mrbc-prism, mruby-bin-mruby-prism, mruby-bin-mirb-prism (which features a custom multi-line editor with syntax highlighting and tab completion), and mruby-eval-prism. It also integrates the ruby/prism parser as a git submodule and updates the test suite to support the new compiler path. The review feedback suggests updating the README files for mruby-bin-mirb-prism and mruby-bin-mruby-prism to correctly reflect the Prism-specific command names and descriptions instead of using copied placeholders.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
ref #6707
Import PicoRuby's Prism-based compiler (mruby-compiler2) as
mruby-compiler-prismand add Prism variants of the compiler-dependent tools (PicoRuby also uses them):mruby-bin-mrbc-prismmruby-bin-mruby-prismmruby-bin-mirb-prismmruby-eval-prismAdd
build_config/prism.rbandmrbgems/prism.gemboxso the Prism stack can be tested explicitly. Also addMRB_COMPILER_PRISM=yesas a shorthand for the Prism build config when noMRUBY_CONFIG/CONFIGis already set.Keep normal mruby builds unchanged by excluding
*-prismgems fromfull-core.gembox. This prevents regular CI from accidentally mixingmruby-compilerandmruby-compiler-prism.Adapt the imported compiler for standalone mruby while keeping the compiler library embeddable:
MRC_TARGET_MRUBY/MRC_TARGET_MRUBYCfrom build definesMRC_TARGET_MRUBYglobal_mrbownership out of the compiler libraryglobal_mrbinmrbc-prism,mruby-prism,mirb-prism, and Prism-enabledmrbtestglobal_mrbis mruby's process-widemrb_state *hook used by executable frontends and test runners for APIs and callbacks that do not carry an explicit ownermrb_state. It is runtime/frontend state, somruby-compiler-prismmust not define or own it. PicoRuby and FemtoRuby provide their own VM ownership model and must remain able to link the compiler without mruby-specific global state.Please read
mruby-compiler-prism/README.mddocumenting the current Prism status, test split, known remaining failures, and compatibility boundaries for PicoRuby/FemtoRuby.Verified
rake MRUBY_CONFIG=ci/gcc-clang -TMRB_COMPILER_PRISM=yes rake -TMRB_COMPILER_PRISM=yes rake test:buildbuild/host/bin/mruby-prism -e 'p 1 + 2'build/host/bin/mruby-prism -e 'p eval("1 + 2")'Known remaining work
MRB_COMPILER_PRISM=yes rake testis not expected to pass yet.Plus, I think we need to consider a testing strategy to allow mruby-compiler and mruby-compiler-prism to coexist for the time being