Mangle Playground

A Datalog-inspired deductive database language, running in your browser via WebAssembly.

How is a relation represented in JSON?

An object whose keys are relation names and whose values are arrays of tuples (each tuple is an array of column values):

{
  "edge":   [[1, 2], [2, 3], [3, 4]],
  "person": [["alice", 30], [{"@name": "/bob"}, 42]]
}

Column values use these JSON shapes:

Mangle typeJSONExample
integernumber42
floatnumber3.14
stringstring"hello"
nametagged object{"@name": "/alice"}

Names (Mangle's /foo/bar hierarchical identifiers) are tagged so they round-trip distinct from plain strings.

Share links: the Copy share link button encodes the current program and facts into the URL as ?src=&facts= query parameters. Opening that URL restores both fields.