disp
abbr.
disp is an aspiring general-purpose programming language with and , and a based on that models hardware as imperfect interaction-net reduction. Based on Barry Jay's tree calculus.
git clone github.com/libdither/disp && npm i && npm test Why disp?
The goal of disp is a language where you write only the specification and the implementation is derived from it. A specification is a type, and in disp a type is a predicate you can run, so the type checker is an ordinary function from programs to a yes or a no. Multiply that verdict by a cost score from a model of the hardware, and "find the best program" becomes a search with a fitness function. Because the checker, the cost model, and the search are all disp programs, the search can be aimed at itself: an optimizer that improves its own optimizer, and stays readable while it does.
Everything else about disp exists to make that loop close: the tree calculus underneath (programs are data, with no quote/eval border), types as predicates, a trusted kernel small enough to audit, and the plan for user-definable syntax. A survey of the neighbouring languages reduces the goal to five requirements and scores each of them on the same scale, disp included.
- G1 100% native
Substrate
Programs are data, and the type checker is written in the language as a function that returns a verdict; quotation is fine
- G2 72% claims, library
Specification
A spec can say what matters: types that mention values (dependent types or stronger), proofs, and an equality for specs like "behaves like f"
- G3 50% two checkers
Trust
A search that maximizes the checker's verdict will find and exploit any bug in it, so the code that verdict rests on is kept small and every clever layer hands it evidence to re-check
- G4 15% interpreted
Execution
The programs found run fast, by any route; the checker can reason about the target through axioms or a model; and a primitive hands work to an external faster language and returns outputs plus time and memory
- G5 42% cegis
Search
From spec to implementation automatically: a search over candidate programs scored by the checker times measured cost, which writes its own score functions to practice on, and is eventually aimed at its own code
The figure on each row is where disp stands today (as of commit a5e051f49b1b), one dot per clause of the
requirement: filled = met, half-filled = halfway, empty = not met, dashed =
still open. The percent is their weighted mean, the word is how it's reached, and
hovering a dot names its clause; hovering the row shows what disp's design
could reach in theory. Text and scores come from _AXES.md.