Get the latest tech news
Modal is a matrioshka language based on pattern-matching to rewrite trees
. Modal programs are represented as a series of rules, formatted as tokens delimited by brackets and parentheses, applied to a given tree which gets continually modified until no rules match any given part of the tree.
The program evaluation starts at the first character of the string and walks through to the end trying to match a transformation rule from that location: * special register, notice how the following program makes use the List type to ensure a specific evaluation order: We can use rules to define entire languages, Modal enforces no specific notation, for example, we could easily make a combinatory logic playground:
Or read this on Hacker News