https://github.com/minoki/LunarML Skip to content Navigation Menu Toggle navigation Sign in * Product + Actions Automate any workflow + Packages Host and manage packages + Security Find and fix vulnerabilities + Codespaces Instant dev environments + Copilot Write better code with AI + Code review Manage code changes + Issues Plan and track work + Discussions Collaborate outside of code Explore + All features + Documentation + GitHub Skills + Blog * Solutions For + Enterprise + Teams + Startups + Education By Solution + CI/CD & Automation + DevOps + DevSecOps Resources + Learning Pathways + White papers, Ebooks, Webinars + Customer Stories + Partners * Open Source + GitHub Sponsors Fund open source developers + The ReadME Project GitHub community articles Repositories + Topics + Trending + Collections * Pricing Search or jump to... Search code, repositories, users, issues, pull requests... Search [ ] Clear Search syntax tips Provide feedback We read every piece of feedback, and take your input very seriously. [ ] [ ] Include my email address so I can be contacted Cancel Submit feedback Saved searches Use saved searches to filter your results more quickly Name [ ] Query [ ] To see all available qualifiers, see our documentation. Cancel Create saved search Sign in Sign up You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert {{ message }} minoki / LunarML Public * * Notifications * Fork 10 * Star 328 * The Standard ML compiler that produces Lua/JavaScript License MIT license 328 stars 10 forks Branches Tags Activity Star Notifications * Code * Issues 5 * Pull requests 0 * Discussions * Actions * Projects 0 * Wiki * Security * Insights Additional navigation options * Code * Issues * Pull requests * Discussions * Actions * Projects * Wiki * Security * Insights minoki/LunarML This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository. master BranchesTags Go to file Code Folders and files Name Name Last commit Last commit message date Latest commit History 997 Commits .github .github bin bin cm cm docs docs example example lib/lunarml lib/lunarml package package pluto pluto src src test test thirdparty thirdparty util util .gitattributes .gitattributes .gitignore .gitignore .readthedocs.yaml .readthedocs.yaml CHANGELOG.md CHANGELOG.md LICENSE LICENSE Makefile Makefile README.md README.md set-version.sh set-version.sh version.mk version.mk View all files Repository files navigation * README * MIT license LunarML The Standard ML compiler that produces Lua/JavaScript. The documentation is available at https://lunarml.readthedocs.io/en/ latest/. Trying pre-built binaries Docker image is available. $ docker pull ghcr.io/minoki/lunarml:latest $ docker run --rm --platform linux/amd64 -v "$(pwd)":/work -w /work ghcr.io/minoki/lunarml:latest lunarml compile example/hello.sml $ lua example/hello.lua Hello world! In case you do not want to use Docker, there are precompiled scripts available in the tarball. You can use install-precompiled-lua target to install lunarml.lua which can be run with Lua 5.3/5.4 and LuaFileSystem. $ make install-precompiled-lua PREFIX=/opt/lunarml $ export PATH=/opt/lunarml/bin:$PATH $ lunarml compile example/hello.sml You can use install-precompiled-node target to install lunarml.mjs to be run with Node.js. $ make install-precompiled-node PREFIX=/opt/lunarml $ export PATH=/opt/lunarml/bin:$PATH $ lunarml compile example/hello.sml Warning: Script-compiled LunarML is slow. Use native binary for serious use. Building and Installing 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-lua $ 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! You can install the built binary with make install: $ make install PREFIX=/opt/lunarml $ export PATH="/opt/lunarml/bin:$PATH" $ lunarml compile example/hello.sml Alternatively, you can use Docker to build and run LunarML. $ docker build --platform linux/amd64 -f package/docker/Dockerfile -t lunarml:0.1.0 . $ docker run --rm -v "$(pwd)":/work -w /work --platform linux/amd64 lunarml:0.1.0 lunarml compile example/hello.sml $ lua example/hello.lua Hello world! Usage lunarml compile [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+) + --nodejs: Produces a JavaScript program for Node.js. The default extension is .mjs. + --nodejs-cps: Produces a JavaScript program for Node.js (CPS mode; supports delimited continuations). The default extension is .mjs. Output type: * --exe (default): Produces Lua/JavaScript program. * --lib: Produces a Lua/JavaScript module. Features * Full SML '97 language, including signatures and functors + Note that some features conform to Successor ML rather than SML '97. * Successor ML features * Other language extensions * A subset of SML Basis Library * ML Basis system for multi-file project * Interface to Lua * Interface to JavaScript * Delimited continuations * Other libraries About The Standard ML compiler that produces Lua/JavaScript Topics lua transpiler standard-ml Resources Readme License MIT license Activity Stars 328 stars Watchers 9 watching Forks 10 forks Report repository Releases 1 LunarML v0.1.0 Latest Dec 17, 2023 Sponsor this project Sponsor Learn more about GitHub Sponsors Packages 1 Contributors 3 * @minoki minoki arata, mizuki * @FrankRuben FrankRuben Frank Ruben * @toastal toastal Languages * Standard ML 96.5% * Lua 2.0% * JavaScript 0.6% * Haskell 0.5% * Makefile 0.4% * Shell 0.0% Footer (c) 2024 GitHub, Inc. Footer navigation * Terms * Privacy * Security * Status * Docs * Contact * Manage cookies * Do not share my personal information You can't perform that action at this time.