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:

Get the Android app

Or read this on Hacker News

Read more on:

Photo of trees

trees

Photo of Modal

Modal

Photo of matching

matching

Related news:

News photo

Exploring batch caching of trees

News photo

Modal raises $25M to train corporate workers on data and AI

News photo

A Big Tech-backed campaign to plant trees might have taken a wrong turn