{"id":21202800,"url":"https://github.com/minoki/lunarml","last_synced_at":"2025-04-09T04:04:55.700Z","repository":{"id":40488340,"uuid":"143456413","full_name":"minoki/LunarML","owner":"minoki","description":"The Standard ML compiler that produces Lua/JavaScript","archived":false,"fork":false,"pushed_at":"2025-03-11T10:10:28.000Z","size":7099,"stargazers_count":366,"open_issues_count":5,"forks_count":11,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-04-06T04:14:46.627Z","etag":null,"topics":["lua","standard-ml","transpiler"],"latest_commit_sha":null,"homepage":"","language":"Standard ML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/minoki.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"minoki"}},"created_at":"2018-08-03T17:41:13.000Z","updated_at":"2025-02-28T20:14:20.000Z","dependencies_parsed_at":"2023-11-07T10:25:47.237Z","dependency_job_id":"20721083-23bc-4bc6-ae1b-7b84a82256b4","html_url":"https://github.com/minoki/LunarML","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minoki%2FLunarML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minoki%2FLunarML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minoki%2FLunarML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minoki%2FLunarML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minoki","download_url":"https://codeload.github.com/minoki/LunarML/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247974715,"owners_count":21026742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lua","standard-ml","transpiler"],"created_at":"2024-11-20T20:18:28.020Z","updated_at":"2025-04-09T04:04:55.682Z","avatar_url":"https://github.com/minoki.png","language":"Standard ML","readme":"# LunarML\n\nThe Standard ML compiler that produces Lua/JavaScript.\n\nThe documentation is available at \u003chttps://lunarml.readthedocs.io/en/latest/\u003e.\n\n## Trying pre-built binaries\n\nDocker image is available.\n\n```\n$ docker pull ghcr.io/minoki/lunarml:latest\n$ docker run --rm --platform linux/amd64 -v \"$(pwd)\":/work -w /work ghcr.io/minoki/lunarml:latest lunarml compile example/hello.sml\n$ lua example/hello.lua\nHello world!\n```\n\nIn case you do not want to use Docker, there are precompiled scripts available in the tarball.\nYou can use `install-precompiled-lua` target to install `lunarml.lua` which can be run with Lua 5.3/5.4 and LuaFileSystem.\n\n```\n$ make install-precompiled-lua PREFIX=/opt/lunarml\n$ export PATH=/opt/lunarml/bin:$PATH\n$ lunarml compile example/hello.sml\n```\n\nYou can use `install-precompiled-node` target to install `lunarml.mjs` to be run with Node.js.\n\n```\n$ make install-precompiled-node PREFIX=/opt/lunarml\n$ export PATH=/opt/lunarml/bin:$PATH\n$ lunarml compile example/hello.sml\n```\n\nWarning: Script-compiled LunarML is slow. Use native binary for serious use.\n\n## Building and Installing\n\nYou need a recent version of MLton to build the executable, and Lua 5.3+ or recent Node.js to run the compiled script.\n\n```sh-session\n$ make\n$ make test-lua\n$ make test-lua-continuations\n$ make test-luajit\n$ make test-nodejs\n$ make test-nodejs-cps\n$ bin/lunarml compile example/hello.sml\n$ lua example/hello.lua\nHello world!\n```\n\nYou can install the built binary with `make install`:\n\n```\n$ make install PREFIX=/opt/lunarml\n$ export PATH=\"/opt/lunarml/bin:$PATH\"\n$ lunarml compile example/hello.sml\n```\n\nAlternatively, you can use Docker to build and run LunarML.\n\n```sh-session\n$ docker build --platform linux/amd64 -f package/docker/Dockerfile -t lunarml:0.2.1 .\n$ docker run --rm -v \"$(pwd)\":/work -w /work --platform linux/amd64 lunarml:0.2.1 lunarml compile example/hello.sml\n$ lua example/hello.lua\nHello world!\n```\n\n## Usage\n\n```\nlunarml compile [options] input.(sml|mlb)\n```\n\nSubcommands:\n\n* `compile`: Compile a program.\n* `help`: Show help.\n* `version`: Show version information.\n\nTargets:\n\n* Lua\n    * `--lua` (default): Targets Lua 5.3+.\n    * `--lua-continuations`: Targets Lua 5.3+. Supports one-shot delimited continuations. Also, supports deeply nested `handle`.\n    * `--luajit`: Targets LuaJIT.\n* JavaScript (ES2020+)\n    * `--nodejs`: Produces a JavaScript program for Node.js. The default extension is `.mjs`.\n    * `--nodejs-cps`: Produces a JavaScript program for Node.js (CPS mode; supports delimited continuations). The default extension is `.mjs`.\n\nOutput type:\n\n* `--exe` (default): Produces Lua/JavaScript program.\n* `--lib`: Produces a Lua/JavaScript module.\n\n## Features\n\n* Full SML '97 language, including signatures and functors\n    * Note that some features conform to Successor ML rather than SML '97.\n* Successor ML features\n* Other language extensions\n* A subset of SML Basis Library\n* ML Basis system for multi-file project\n* Interface to Lua\n* Interface to JavaScript\n* Delimited continuations\n* Other libraries\n","funding_links":["https://github.com/sponsors/minoki"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminoki%2Flunarml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminoki%2Flunarml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminoki%2Flunarml/lists"}