Skip to content

A Standard ML compiler that produces Lua/JavaScript

License

Notifications You must be signed in to change notification settings

SakuraNoKisetsu/LunarML

 
 

Repository files navigation

LunarML   Badge License

A standard ML compiler that produces Lua / JavaScript.



Button Usage    Button Building




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
      • 3.1415_9265
      • 0xffff_ffff
    • Binary notation
      • 0wb
      • 0b
    • 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

  • With type in signatures


Planned Extensions

  • Vector expressions and patterns

  • Packaged modules

    • Alice ML
    • HaMLet S
  • Hexadecimal floating-point constants

    Examples

    • 0x1.ffff_ffff_ffff_f
    • 0x1p1024

    Syntax

    <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
    tilde ( ~ ) is used for the negation symbol.

  • Variably-encoded Unicode escape sequence in string literals

    Examples

    • \u{3042}

    Details

    The \u{} escape sequence makes it possible to
    embed unicode scalar values in a string literals.

    The compiler encodes the character in
    UTF-8,16,32 depending on the string type.


About

A Standard ML compiler that produces Lua/JavaScript

Resources

License

Stars

Watchers

Forks

Languages

  • Standard ML 96.3%
  • Lua 2.7%
  • Other 1.0%