midad spec
midad spec [--json]
Prints the language as the binary sees it: the type names, every builtin with the parameter sets it accepts and the type it returns, the operators that differ from other languages, the layout rules and the number of diagnostic codes.
$ midad spec
midad 0.1
types: number float string boolean list map option result any
builtins (72):
len(list|string|map) -> number
...
--json gives one object instead of text:
| key | what it holds |
|---|---|
language, version |
"midad", "0.1" |
types |
the type names the parser accepts |
builtins |
{name, params, returns} per builtin, with params a list of parameter sets |
operators |
{op, result, note} for the operators worth knowing |
layout |
the manifest, entry, code, handlers and third-party paths, and the rules |
diagnostics |
how many codes the table has |
It is meant for tools and models: one object instead of several hundred lines of prose, and no way for it to describe a feature the binary does not have. This site's reference is generated from it.