KeenS / webml
- среда, 11 марта 2020 г. в 00:20:39
Rust
A Standard ML Compiler for the Web
WebML is to be a Standard ML (SML '97) Compiler that works on web browsers and generates WebAssembly binaries. WebAssembly binaries can be run on web browsers. This means you can run SMl REPL on web browsers.
Under very early stage of initial development. Compiles only minimal subset of SML codes. The garbage collector is not complete.
val
val ident = expr)val pat = expr)val 'a pat = exprval pat : ty = expr)and (val pat = expr and pat = expr)fun
fun ident ident ... = expr)fun ident pat ... = expr)fun ident pat ... = expr | ident pat ... = expr)op (fun op ident pat ... = expr)fun 'a ident pat ... = expr)fun ident pat ... : ty = expr)and (fun ident pat ... = expr and ident pat ... = expr)type (type ident = ty)datatype
datatype ident = Con of ty | Con ...
datatype ident = Con of ty | Con ...)datatype 'a ident = Con of ty | Con ...)and (datatype ident = Con | ... and ident = Con | ...)withtype (datatype ident = Con ... withtype ..)datatype ident = datatype identabstypeexceptionlocal ... in ... endopen ..decl ; decl
decl decldecl ; declinfixinfixrnofix123.456123e456123E456123e~456op{ label = expr , ...})#label[expr, ..., expr])(expr; ...; expr)(expr))let .. in .. end
let decl ... in expr end)let decl ... in expr; ...; expr end)exp : ty)handleraisefn
fn ident => expr)fn pat => expr)fn pat => expr | pat => expr ...andalsoorelseif .. then .. elsewhile .. do ..case .. of ..op{ label = pat , ...})...){ var (as pat), ...})pat : ty)ident as pat)ident)ty ident)unitbool
truefalseintwordstringcharlist
nil::ref
ref:=exn=MatchBind+-*divmod/<><=>=abs~not yet implemented
decl decl ...)expr decl ...)
expr should be treated as val it = expr