gitmyhub

warp

Rust ★ 4 updated 5d ago

Warp is a dependently typed language for synthetic data generation via enumeration or sampling of inhabitants of specified types weighted by an algorithmic complexity prior.

An experimental language that automatically searches for and generates simple programs, data types, and even mathematical proofs, favoring the simplest results.

PythonRustsetup: easycomplexity 5/5

Warp is an experimental programming language built for a narrow but unusual purpose: generating example programs and even example data types automatically, rather than being written by hand. Instead of a human typing out code, you describe a target, such as a function from one number to another, and Warp searches through possible programs that match it, favoring the simplest ones first.

The language is what mathematicians call dependently typed, which means types can depend on actual values, not just other types. This sounds abstract, but it has a practical payoff described in the README: the same search process that finds a simple function can also, when the target is a mathematical statement instead of an ordinary function, find a valid proof of that statement. In other words, searching for programs and searching for proofs become the same activity inside Warp.

You describe what you want using a small text based language of your own instructions, and Warp either enumerates every matching program up to a certain complexity, ordered from simplest to most complex, or randomly samples one according to a preference for simpler results. New data types can also be defined right inside your request, and Warp can sample entirely new types along with example values that belong to them, which is aimed at generating synthetic datasets.

The README documents a companion online book meant for programmers who have no background in this kind of type theory, walking through the underlying ideas from scratch with interactive examples. The tool itself has no dependencies beyond Python 3 and is run from the command line with scripts like tests.py and generate.py, using flags to set the goal, how many results to produce, and whether to enumerate or randomly sample. This is a research style project, not a general purpose programming language, and it does not state a license, so anyone wanting to reuse the code should check with the author directly.

Where it fits