Mini-ML CRDT Editor

Collaborative real-time editor with live evaluation

Loading JavaScript...

Network Collaboration (Beta)

Not connected

Connect to collaborate with other peers in real-time. Make sure the signaling server is running:

node examples/web/signaling-server.js

Mini-ML Syntax

Definitions

let x = 42
fn double(x : Int) { x + x }
let result = double 5
result

Functions & Application

fn inc(x : Int) { x + 1 }
fn twice(f : Int -> Int, x : Int) {
  f (f x)
}
let result = twice inc 0
result

Conditionals

fn choose(x : Int) { if x then {
  x + 1
} else {
  42
} }
let result = choose 5
result

Grammar (EBNF)

Module       ::= ((FnDef | LetDef) '\n')* Expression?
FnDef       ::= 'fn' Identifier ParamList Block
LetDef      ::= 'let' Identifier '=' Expression
ParamList   ::= '(' Identifier (':' Type)? (',' Identifier (':' Type)?)* ')'
Expression  ::= Lambda | IfThenElse | BinaryOp
Lambda      ::= ParamList '=>' (Expression | Block)
BinaryOp    ::= Application (('+' | '-') Application)*
Application ::= Atom+
Atom        ::= Integer | Variable | Block | '(' Expression ')'
Block       ::= '{' ((FnDef | LetDef) (';' | '\n'))* Expression? '}'
IfThenElse  ::= 'if' Expression 'then' Expression 'else' Expression
Examples:

AST Visualization

Waiting for input...

AST Structure & Diagnostics

Structure

Waiting for input...

Diagnostics

  • No errors