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 = expr
val 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 ident
abstype
exception
local ... in ... end
open ..
decl ; decl
decl decl
decl ; decl
infix
infixr
nonfix
123.456
123e456
123E456
123e~456
op
{ label = expr , ...}
)#label
[expr, ..., expr]
)(expr; ...; expr)
(expr)
)let .. in .. end
let decl ... in expr end
)let decl ... in expr; ...; expr end
)exp : ty
)handle
raise
fn
fn ident => expr
)fn pat => expr
)fn pat => expr | pat => expr ...
andalso
orelse
if .. then .. else
while .. do ..
case .. of ..
op
{ label = pat , ...}
)...
){ var (as pat), ...}
)pat : ty
)ident as pat
)ident
)ty ident
)unit
bool
true
false
int
word
string
char
list
nil
::
ref
ref
:=
exn
=
Match
Bind
+
-
*
div
mod
/
<
>
<=
>=
abs
~
not yet implemented
decl decl ...
)expr decl ...
)
expr
should be treated as val it = expr