asciichemImplementations
One model · Three implementations · One contract
Type once. The same bytes come out, whichever you ship.
Every implementation passes theshared corpus byte-for-byte — proof the model, not the notation, is the canonical form.
asciichemasciichemAsciiChem is a contract, not a codebase. The contract has two halves: the wire form (asciichem-model — versioned JSON Schemas plus generated types) and the conformance corpus (asciichem-tests — the fixtures every implementation must pass in its own CI). Anything that passes both is AsciiChem.
This is the single-contract rule, with the order made explicit: there is no per-language parser. Every runtime parses through parsanol over the one checksummed PARG artifact of the grammar, and asciichem-rs is the authoritative implementation — all runtimes carry identical functionality, and where a port is still pending the matrix below says so plainly.
| Implementation | parse / reject | L0 | L1 | L2 | SMILES | InChI | molfile | CML | linter |
|---|---|---|---|---|---|---|---|---|---|
| Rustasciichem · crates.io (authoritative) | claimed | claimed | claimed | claimed | claimed | claimed | claimed | claimed | claimed |
| Rubyasciichem · RubyGems | claimed | claimed | claimed | claimed | claimed | claimed | claimed | claimed | claimed |
| TypeScriptasciichem · npm | claimed | claimed | claimed | claimed | claimed | claimed | claimed | not yet claimed | not yet claimed |
| Pythonasciichem · PyPI | claimed | claimed | claimed | claimed | claimed | claimed | claimed | not yet claimed | not yet claimed |
Filled cells are claimed at 100% of the asciichem-tests corpus, verified in each implementation's CI. Rust is the authoritative implementation — the reference the other runtimes converge on; the shared corpus keeps them identical. Every runtime parses through the same engine: parsanol over the one checksummed PARG artifact of the grammar. The InChI column is the identity gate: each runtime derives InChI for the recorded fixtures and must agree with the oracle recording leg (three-leg discipline — engine, gem molfile, oracle). Where a port is genuinely pending (the TypeScript and Python resolver, citation, and linter layers — asciichem-ts#26, asciichem-py#19), the cell stays open until its CI gate is green.
The implementations
Section titled “The implementations”Rust — asciichem
The authoritative implementation (repo asciichem-rs). Parse
through canonical text,
wire JSON, MathML, SVG, SMILES/molfile, CML, linter, resolver,
citations, in-process InChI, and the asciichem CLI.
Rust →
Ruby — asciichem
gem install asciichem — the full formatter set, citations,
InChI identity, linter, resolver, CLI; the Metanorma path.
Ruby →
TypeScript — asciichem
npm install asciichem — runs in the browser and Node.
Powers this page. TypeScript →
Python — asciichem
pip install asciichem — plain dataclasses, one runtime
dependency (parsanol). Python →
Picking an implementation
Section titled “Picking an implementation”- Documents and standards pipelines (Ruby) — the gem integrates with Metanorma-style publishing; CML round-trip for interchange; the CLI covers parsing, rendering, linting, resolving, validation.
- Systems, CLIs, and services (Rust) — the authoritative crate:
the whole surface as a library plus the
asciichembinary, with InChI identity derived in-process (no FFI seam) and networked resolution onureq. - Web and interactive tools (TypeScript) — parse and draw chemistry client-side; the corpus guarantees the same acceptance as every other runtime, so your web previews match your build-time renders.
- Data and science workflows (Python) — zero-dependency parsing into plain dataclasses; wire JSON in and out for pipelines.
All implementations speak the same wire form, so structures move freely between ecosystems. Conformance is claimed per level, not per vibe. The TypeScript and Python resolver, citation, and linter ports are tracked openly (asciichem-ts#26, asciichem-py#19) — until they land, those layers live in Rust and Ruby.
Behind the implementations
Section titled “Behind the implementations”asciichem-model
The contract repository: LUTAML definitions, v1 schemas, examples, generated TypeScript types. Not a package — implementations vendor from tags.
asciichem-tests
The shared corpus: parser acceptance, identifiers, CML round-trip, fuzz, linter expectations, structure fixtures. Never edited to make an implementation pass.
asciichem.github.io
This site — the specification, rendered examples, and the live playground.