asciichemAsciiChem
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 an ASCII syntax for representing chemistry — atoms, molecules, bonds, reactions, electron configurations, and the embedded mathematics that chemistry publications rely on. It is to chemistry what AsciiMath is to mathematics, but with a semantic model underneath: every parse produces the same tree, regardless of which front door you came in by.
One model, four implementations
Section titled “One model, four implementations”Four independent implementations — every one published as the package
asciichem (on crates.io, RubyGems, npm, and PyPI; the repos are
asciichem-rs, asciichem-ruby, asciichem-ts, and asciichem-py,
with Rust the authoritative implementation) — implement the same model
and pass the same
shared corpus. Every
one of them parses through the same engine: parsanol over the single
checksummed PARG artifact of the grammar — there is no per-language
parser left to drift. Pick whichever ships in your stack:
| 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.
Why four
Section titled “Why four”A molecule has one structure regardless of the notation you write it in: InChI, SMILES, molfile, or AsciiChem. Likewise, the AsciiChem model has one shape regardless of the language you run it in. Four implementations keep the contract honest — and the order among them is explicit: asciichem-rs is the authoritative implementation. When the corpus is silent, what the Rust crate does is the operating answer; the shared corpus and the one PARG artifact keep the other runtimes identical to it.
Pick one and start
Section titled “Pick one and start”Rust (authoritative)
cargo add asciichem — the authoritative implementation (repo
asciichem-rs): parse, canonical
text, wire JSON, MathML, SVG, SMILES/molfile, CML, the linter, the
resolver, citations (via leptris), in-process InChI identity, and
the asciichem CLI. See Rust.
Ruby
gem install asciichem — the full formatter set, citations,
InChI identity, the linter, the resolver, and the CLI, on the
same PARG artifact engine. See Ruby.
TypeScript
npm install asciichem — runs in the browser or Node. Powers this
page’s live renderer. See TypeScript.
Python
pip install asciichem — plain dataclasses for data and science
workflows. See Python.