lunar-lang 0.1.1

Lunar is a compiler that generate mruby bytecodes from Lua script.
Documentation
  • Coverage
  • 0%
    0 out of 230 items documented0 out of 36 items with examples
  • Size
  • Source code size: 44.62 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.41 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 31s Average build duration of successful builds.
  • all releases: 33s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • udzura

Lunar: Lua is Not A Ruby! lunar-lang at crates.io lunar-lang at docs.rs

Lunar is a compiler intended to allow Lua scripts to be executed in Ruby.

It converts Lua scripts into mruby code and executes them on the mruby VM.

Install

Install the lunar-lang crate published on crates.io. Please note that the crate named lunar is unrelated.

$ cargo install lunar-lang

Usage

$ lunar -h
Lunar: A Lua-to-mruby compiler

Usage: lunar [COMMAND]

Commands:
  compile  Compile a Lua source file to an mruby binary
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help     Print help
  -V, --version  Print version

How to Compile Lua Script

$ bat example/hello.lua
bat examples/hello.lua
───────┬──────────────────────────────────────────────────────
       │ File: examples/hello.lua
───────┼──────────────────────────────────────────────────────
   1   │ for i = 1, 5 do
   2   │     print "hello, world\n"
   3   │ end
───────┴──────────────────────────────────────────────────────

$ lunar compile example/hello.lua
$ mruby example/hello.mrb
hello, world
hello, world
hello, world
hello, world
hello, world

Important Notes

Only very basic Lua features are supported. There is no guarantee that all Lua syntax and features will be supported in the future.

For now, it's just a toy program :)

License

Please see LICENSE.