PreviousUpNext

5.7.4  Broad Syntactic Differences

SML and Mythryl differ most markedly on syntax. Mythryl’s syntax is engineered to make the best use possible of C-based intuition. Mythryl’s syntax fits squarely into Posix tradition. The entire Mythryl codebase has been translated into the new syntax.

At a very broad level, the major syntactic differences between SML and Mythryl are:

The latter is worth expanding upon. The Mythryl compiler requires that

(One point of this convention is to encourage the user to think of generics (functors) as functions over packages (structures) with apis (signatures) as types.)

One consequence of these conventions is that misspelled constructor names in a pattern now draw a compile-time error instead of silently compiling incorrect code.

Another consequence of these conventions is that most of SML’s start of line syntactic noise can be dropped. Vanilla value bindings are now just x = 12; and vanilla sumtype declarations are now just Color = RED | GREEN | BLUE;.


Comments and suggestions to: bugs@mythryl.org

PreviousUpNext