Skip to content

Using Ruby instead of mruby

Dr. Philipp Schulz edited this page Mar 30, 2023 · 4 revisions

Anyolite does support the regular Ruby implementation (MRI) as an alternative to mruby. This allows for the usage of actual Ruby gems and libraries and the full capacities of the standard Ruby interpreter. However, the compilation time becomes much higher and the size of the final installation increases compared to mruby.

If you want to test MRI as implementation, you need these additional programs:

  • Autoconf
  • Bison

For MRI on Windows, you also need:

  • sed
  • patch
  • vcpkg with libffi, libyaml, openssl, readline and zlib installed Note that MRI on Windows is currently not functional.

Compiling Anyolite for MRI requires setting the environment variable ANYOLITE_CONFIG_PATH to a valid MRI configuration path (like config_files/anyolite_config_mri.json), building the shard and then setting the anyolite_implementation_ruby_3 compile-time flag for the final compilation.

Support for MRI is still not as fleshed out as mruby. Many problems and errors might occur, so mruby is still recommended as the main Ruby implementation for now.

Please report any bugs with MRI, so development can progress smoothly.

Known issues with MRI

  • MRI does currently not work on Windows.
  • Currently it is only possible to run a single actual Ruby script file.
  • UTF-8 function and variable names defined in Crystal can lead to crashes in Ruby.
  • UTF-8 in general might not work properly (this is no problem in mruby).
  • Bytecode compilation functions are not available yet (and might never be).
  • Some utility functions from mruby are not available.
  • Gems need to be installed manually after installing Ruby.
  • For now, only gcc is supported as compiler.