Modal is a small language based on pattern-matching to rewrite trees. Superficially it looks a little like Prolog and Datalog, but it works differently. It's not quite a term-rewriting language, but it uses delimited string rewriting to apply the rules defined by the program until no more rules can be applied. Here's a tiny concatenative language in Modal:
<> (?x dup) (?x ?x) <> (?x ?y swap) (?y ?x) <> (?x pop) () .. (1 2 3) (4 5 6) swap pop dup 01 (4 5 6) (1 2 3) pop dup 02 (4 5 6) dup 00 (4 5 6) (4 5 6)










