lunar-lang

Crates.iolunar-lang
lib.rslunar-lang
version0.1.1
created_at2025-05-10 12:10:16.774834+00
updated_at2025-05-10 12:40:11.032365+00
descriptionLunar is a compiler that generate mruby bytecodes from Lua script.
homepage
repositoryhttps://github.com/udzura/lunar-lang
max_upload_size
id1668324
size44,628
Kondo Uchio (udzura)

documentation

https://docs.rs/lunar-lang/latest/

README

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.

Commit count: 0

cargo fmt