All Projects → minoki → LunarML

minoki / LunarML

Licence: MIT license
A Standard ML compiler that produces Lua/JavaScript

Programming Languages

Standard ML
205 projects
lua
6591 projects

Projects that are alternatives of or similar to LunarML

deqaf
Decaffeinate CSS stylesheets client-side
Stars: ✭ 30 (-76.38%)
Mutual labels:  transpiler
jsx.js
small and extendable jsx transpiler
Stars: ✭ 19 (-85.04%)
Mutual labels:  transpiler
atom-ts-transpiler
A transpiler for Atom packages that processes code with TypeScript
Stars: ✭ 14 (-88.98%)
Mutual labels:  transpiler
x
The Jule programming language
Stars: ✭ 35 (-72.44%)
Mutual labels:  transpiler
natsu-clr
il2cpp transpiler and runtime compatible with .Net Core
Stars: ✭ 76 (-40.16%)
Mutual labels:  transpiler
Jikka
an automated solver for problems of competitive programming
Stars: ✭ 143 (+12.6%)
Mutual labels:  transpiler
schwalbe
"Transpiler" from the Schwalbe Programming Language to Swift
Stars: ✭ 28 (-77.95%)
Mutual labels:  transpiler
habrlang
Step by Step guide how to make your own programming language
Stars: ✭ 20 (-84.25%)
Mutual labels:  transpiler
coro-scratch
A Scratch to Python transpiler that makes extensive use of coroutines
Stars: ✭ 22 (-82.68%)
Mutual labels:  transpiler
py2v
A Python to V transpiler.
Stars: ✭ 47 (-62.99%)
Mutual labels:  transpiler
cassidy
Cassidy programming language, bringing static typing, strictness, safety and precision into your web project
Stars: ✭ 25 (-80.31%)
Mutual labels:  transpiler
esp32-transpiler
Transpile Golang into Arduino code to use fully automated testing at your IoT projects.
Stars: ✭ 53 (-58.27%)
Mutual labels:  transpiler
neo4j-graphql-java
Pure JVM translation for GraphQL queries and mutations to Neo4j's Cypher
Stars: ✭ 94 (-25.98%)
Mutual labels:  transpiler
Sweet.apex
Next Generation of Apex Development
Stars: ✭ 43 (-66.14%)
Mutual labels:  transpiler
coffee-to-ts
[NOT ACTIVELY MAINTAINED] Convert CoffeeScript to TypeScript
Stars: ✭ 34 (-73.23%)
Mutual labels:  transpiler
hexa
Compiler, standard library & backends
Stars: ✭ 74 (-41.73%)
Mutual labels:  transpiler
6umpukc
Тулинг для разработки сайтов и решений на Bitrix под Ubuntu/Windows
Stars: ✭ 13 (-89.76%)
Mutual labels:  transpiler
War3Net
A .NET implementation of Warcraft III related libraries.
Stars: ✭ 76 (-40.16%)
Mutual labels:  transpiler
preact-codemod
🍧 Shave some bytes by using Preact.
Stars: ✭ 39 (-69.29%)
Mutual labels:  transpiler
py2many
Transpiler of Python to many other languages
Stars: ✭ 420 (+230.71%)
Mutual labels:  transpiler

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-nodejs
$ make test-nodejs-cps
$ ./lunarml example/hello.sml
$ lua example/hello.lua
Hello world!

Usage

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

Modes of operation:

  • -mexe (default): Produce Lua program.
  • -mlib: Produce a Lua module.
  • --js: Produce a JavaScript program.
  • --js-cps: Produce a JavaScript program (CPS mode; supports delimited continuations).

See --help for more information.

Features

Successor ML features:

  • Monomorphic non-exhaustive bindings
  • Simplified recursive value bindings
    • SML '97-compatible ordering for type variables is also supported: val <tyvarseq> rec <valbind>
  • Abstype as derived form
  • Fixed manifest type specifications
  • Abolish sequenced type realizations
  • Line comments
  • Extended literal syntax
    • Underscores (e.g. 3.1415_9265, 0xffff_ffff)
    • Binary notation (0b, 0wb)
    • Eight hex digits in text (\Uxxxxxxxx)
  • Record punning
  • Record extension
  • Record update
  • Conjunctive patterns
  • Disjunctive patterns
  • Nested matches
  • Pattern guards
  • Optional bars and semicolons
  • Optional else branch
  • Do declarations
  • Withtype in signatures

Other extensions planned:

  • Vector expressions and patterns
  • Packaged modules (like in Alice ML or HaMLet S)
  • Hexadecimal floating-point constants (e.g. 0x1p1024, 0x1.ffff_ffff_ffff_f)
  • Variably-encoded Unicode escape sequence in string literals (e.g. \u{3042})

The syntax of hexadecimal floating-point constants is:

<hexadecimal-integer-constant> ::= '~'? '0' 'w'? 'x' <hexadecimal-digit-sequence>
<hexadecimal-floating-point-constant> ::= '~'? '0x' <hexadecimal-digit-sequence> (<binary-exponent-part> | '.' <hexadecimal-digit-sequence> <binary-exponent-part>?)
<hexadecimal-digit-sequence> ::= <hexadecimal-digit> ('_'* <hexadecimal-digit>)*
<binary-exponent-part> ::= [pP] '~'? <digit> ('_'* <digit>)?

In short: the (binary) exponent part is optional and use tilde (~) for the negation symbol.

The \u{} escape sequence allows you to embed a Unicode scalar value in a string literal. The compiler encodes the character in UTF-(8|16|32), depending on the string type.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].