modal/README.md

679 B

Modal

Modal is a language based a model of computation that uses pattern matching and replacement to rewrite trees.

All Modal code is represented as a series of rules applied to a given tree, formatted textually as tokens delimited with parenthesis, which gets continually modified until no rules match any given part of the tree.

A pattern/replacement can be:

A token: foo, bar, baz
A variable: ?foo, ?bar, ?baz
A sequence of the above: (foo bar baz), (foo ?bar baz), foo (bar (baz))

Build

cc src/modal.c -o bin/modal

Run

bin/modal examples/hello.modal

Credits

Created by wryl, Immediate Mode Technologies.