Skip to content

minoki/LunarML

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
bin
 
 
cm
 
 
doc
 
 
 
 
 
 
 
 
src
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

LunarML

A Standard ML compiler that produces Lua/JavaScript.

Building

You need a recent version of MLton to build the executable, and Lua 5.3+ or recent Node.js to run the compiled script.

$ make
$ make test
$ make test-lua-continuations
$ make test-luajit
$ make test-nodejs
$ make test-nodejs-cps
$ bin/lunarml compile example/hello.sml
$ lua example/hello.lua
Hello world!

Usage

lunarml [subcommand] [options] input.(sml|mlb)

Subcommands:

  • compile: Compile a program.
  • help: Show help.
  • version: Show version information.

Targets:

  • Lua
    • --lua (default): Targets Lua 5.3+.
    • --lua-continuations: Targets Lua 5.3+. Supports one-shot delimited continuations. Also, supports deeply nested handle.
    • --luajit: Targets LuaJIT.
  • JavaScript (ES2020+)
    • --js: Produces a JavaScript program.
    • --js-cps: Produces a JavaScript program (CPS mode; supports delimited continuations).

Output type:

  • --exe (default): Produces Lua/JavaScript program.
  • --lib: Produces a Lua module.

Features