Moscow ML Browser Interpreter
A browser-based Standard ML interpreter targeting the Moscow ML dialect. Runs entirely client-side.
Keyboard shortcuts
| Cmd/Ctrl+Enter | Run program (current mode) |
| Ctrl+Shift+Enter | Send selection to REPL |
| Ctrl+Shift+D | Toggle debug panel |
| Ctrl+Shift+M | Toggle REPL maximize |
| Ctrl+Shift+R | Reset REPL environment |
| Cmd/Ctrl+L | Clear errors |
| Up/Down arrow | Navigate REPL history |
Known divergences from Moscow ML
- Real equality:
1.0 = 1.0 is rejected (SML '97). Use Real.== for IEEE equality.
- Integer range: 53-bit precision (JS
number) vs Moscow ML's 31-bit. No overflow detection on int arithmetic.
- Word size: 32-bit (
Word.wordSize = 32) vs Moscow ML's 31-bit.
- No file I/O:
TextIO.openIn/openOut raise Io. Use TextIO.print and print for output.
- No stdin:
TextIO.inputLine raises an error.
- No separate compilation: No
load or use.
- Modules subset: No applicative functors, recursive structures, first-class modules/packages, or structure sharing. Only generative functors and
sharing type.
- Missing types: No
word8, substring, or 'a frag (quotations).
- Basis library subset: 17 of 60+ Moscow ML library modules. No Date, Time, Path, FileSys, Substring, BinIO, Regex, etc.
- Step limit: Programs are terminated after 10,000,000 evaluation steps to prevent infinite loops.
Reference
Moscow ML Language Overview v2.00
About
An open-source SML interpreter that runs entirely in your browser. Built with TypeScript and CodeMirror.
Source code on GitHub - Licensed under AGPL-3.0