The ALTernative Language
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage


The current implementation of ALT is developed in Typescript and is compiled to javascript. It is a basic term rewriter/interpreter that isn’t much focused on optimization, but more on semantics and syntax.

The regular expressing rewriter is probably the most interesting algorithm that can be found in the code base. It was also the hardest to implement as it is not based on NFAs, but implemented via pure term rewriting.

Additionally, hash-consing and memoization is used to avoid lengthy re-computations, but there is still a lot of room for optimizations.

Syntax highlighting

The inline editor is implemented with the excellent CodeMirror library and supports syntax highlighting. However, its grammar is based on Typescript, so it doesn’t correctly highlight ALT code. This is still a low-priority TODO to implement a CodeMirror grammar for ALT.

It’s almost 100% certain that the current implementation contains many bugs, uncovered edge cases, etc. And although ALT currently has some rudimentary cycle checking, there are probably still many (and unknown!) ways to create infinite loops.