Skip to content

What's new

The v0.2x line turns AsciiChem from a parser into a chemistry platform: external structures flow in, identities resolve, and three independent implementations pass the same corpus.

Structure interchange

SMILES and molfile (V2000) ingest into the semantic model — the same tree the AsciiChem syntax produces — so database chemistry renders, lints, and serialises unchanged. Deterministic SMILES re-emission round-trips aspirin exactly. See Structures and resolution.

Resolution with provenance

AsciiChem::Resolver turns identifiers into substance records — multi-source, cross-checked, cached in the user cache dir, with per-identifier provenance. PubChem first; more sources opt-in. CLI: asciichem resolve --cas 50-78-2.

Three implementations, one contract

TypeScript (asciichem) and Python (asciichem-py) joined the Ruby reference, all passing the same shared corpus — the single-contract rule. See Implementations.

Local identity: the InChI engine

Derive InChI/InChIKey from the drawn structure, offline — the IUPAC inchi-1 binary behind an opt-in engine, never a reimplementation. @inchi annotations are cross-checked against what you actually drew. CLI: asciichem identity -i ... --from smiles. See Structures and resolution.

MathML parity, byte for byte

The corpus grew an L2 level: MathML goldens from the reference implementation, compared as exact strings. All three implementations — Ruby, TypeScript, Python — now emit identical MathML; the playground shows it live. Stereo markers survive the wire form. Embedded math crosses through the mml contract model — typed parse and framework re-serialize, not xpath surgery.

Shareable playground links

The live renderer writes its state into the URL fragment (#code=…&lang=…&mode=…). Open a playground link and land on the same expression, language, and output mode.

Chemistry in Metanorma documents

The metanorma-plugin-asciichem gem closes the document loop: [chem] blocks render as MathML formulas in any Metanorma flavour, and @cite-annotated molecules resolve into dataset-type bibliography entries — one per (source, substance), anchored by InChIKey — collected automatically into the References section. See Chemistry in Metanorma.

Opt-in Rust-core parsing engine (0.29.0)

The same grammar and transform now run over Parsanol’s Rust-backed parslet-compat layer: AsciiChem::Engine.use(:parsanol) or asciichem convert --engine parsanol — the full corpus passes identically under either engine (221/221 re-verified against parsanol 1.3.27, all four reported upstream issues fixed), at ~2.6× parse speed. Parslet stays the default; parsanol is an opt-in soft dependency.

The contract is not a package

asciichem-model is now a pure contract repository: LUTAML definitions, v1 schemas, generated types. Implementations vendor from tags; nothing depends on a gem. See The wire form.

v0.2 foundations

Reaction cascades, the linter framework, stereochemistry prefixes, all bond kinds, Greek letters, fuzzing and benchmarks — see the syntax pages.

Implementationparse / rejectL0L1L2SMILESmolfileCMLlinter
Rubyasciichem gem · referenceclaimedclaimedclaimedclaimedclaimedclaimedclaimedclaimed
TypeScriptasciichem · npmclaimedclaimedclaimedclaimedclaimedclaimednot yet claimednot yet claimed
Pythonasciichem-pyclaimedclaimedclaimedclaimedclaimedclaimednot yet claimednot yet claimed

Filled cells are claimed at 100% of the asciichem-tests corpus, verified in each implementation's CI. The Ruby gem is the reference; a claim is only as good as the shared corpus behind it.

Play