Skip to content

Implementations

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.

Ruby
asciichem
gem install asciichemReference implementation.
TypeScript
asciichem
npm install asciichemPowers this page.
Python
asciichem
pip install asciichemZero runtime deps.

AsciiChem 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.

Implementationparse / rejectL0L1L2SMILESInChImolfileCMLlinter
Rustasciichem · crates.io (authoritative)claimedclaimedclaimedclaimedclaimedclaimedclaimedclaimedclaimed
Rubyasciichem · RubyGemsclaimedclaimedclaimedclaimedclaimedclaimedclaimedclaimedclaimed
TypeScriptasciichem · npmclaimedclaimedclaimedclaimedclaimedclaimedclaimednot yet claimednot yet claimed
Pythonasciichem · PyPIclaimedclaimedclaimedclaimedclaimedclaimedclaimednot yet claimednot 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.

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 →

  • 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 asciichem binary, with InChI identity derived in-process (no FFI seam) and networked resolution on ureq.
  • 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.

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.

Play