Ohm is a parsing toolkit for JavaScript — `ohm-js` on npm — and the workbench on which the WikiScript grammar is built. A grammar is written as its own file, in a readable PEG notation, completely separate from the code that acts on it. That separation is the point: the grammar stays a document a person can read, which is exactly the temperament a literate language needs in its tools.
# Where it comes from Ohm descends from OMeta, Alessandro Warth's experiment in making language experiments cheap. Patrick Dubroy and Warth built Ohm in that spirit: parsing for people who design languages, not only implement them. MIT licensed, maintained at ohmjs.org; the spike runs version 17.
# What it does Ohm reads a grammar file and returns a matcher. Parsing is PEG: ordered choice instead of ambiguity, unlimited lookahead through backtracking, no separate lexer. Capitalised rules skip whitespace between tokens; lowercase rules read characters exactly. Rules take parameters and carry case labels, so a keyword can be guarded and an alternative can be named:
Modal = kw<"may"> kw<"not"> -- mayNot | kw<"may"> -- may | kw<"must"> -- must | kw<"shall"> -- shall kw<k> = k ~alnum
# Grammar apart from meaning The grammar never contains actions. Meaning attaches afterwards, as a semantics — named operations and attributes over the parse tree. The WikiScript Repo defines a single attribute, `ast`, which turns a parse into plain JSON. The same grammar could carry other semantics — a formatter, a highlighter, a translator to Lexon — without changing a line of it.
# The editor ohmjs.org ships an interactive editor: paste a grammar and an input, and watch the parse succeed or fail rule by rule. For growing a controlled language against a corpus, that loop is the whole game.
# What Ohm is not, for us Ohm runs only where JavaScript runs. The long term WikiScript core is a small Rust interpreter compiled to wasm — for Spin on the server, for the browser, for the Tauri Guide — so Ohm's role is the workbench, not the destination. The `.ohm` file remains the owned specification, and the Agreement Corpus with its permission tables is the conformance suite any future implementation must match. See WikiScript Architecture.
# Links
- Ohm
- The Ohm editor
- Ohm on GitHub
- ohm-js on npm
- OMeta ![]()
# See - WikiScript Grammar and WikiScript Repo - WikiScript and Agreement Corpus - Double Parse and SimpleTalk