8000 GitHub - udzura/lunar: Lua is Not A Ruby.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

udzura/lunar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Lua is Not A Ruby.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0