Project

MOIETY

Year
2026
Stack
chemistry / rust / webassembly
moiety: rapamycin, drawn from SMILES
RAPAMYCIN, DRAWN FROM SMILES
moiety: playground
PLAYGROUND

Parses condensed organic formulas into every valid reading, with SMILES and skeletal drawings.

moiety parses condensed organic formulas such as CH3CH2OH deterministically. An ambiguous formula returns every valid reading, ranked, each with its canonical SMILES and a skeletal drawing. For example, COCl2 could be either phosgene or cobalt chloride, and both are returned. A formula that can’t be read gets a diagnostic that points at the characters at fault, with a suggestion.

Its conformance suite is plain TOML data, so any implementation can run it. moiety passes all 398 cases and recovers all 665 round-trip molecules. Against MolScribe’s condensed-formula expander on 246 substituent labels it matches on 182, and every disagreement has a recorded verdict.

It draws to SVG, PNG, an interactive HTML page, or straight into the terminal, and draws from SMILES too, macrocycles included. The playground runs it in the browser as WebAssembly, drawing every reading as you type.

Personal thoughts

This project was partly inspired by a post on LinkedIn about a web app with similar functionality. I wanted to see if I could take it further, while also preserving the determinism and ‘correctness’ of the drawn output. I also wanted to make it possible to run in the browser through the playground, so nothing needs to be installed to try it. This was a fun little project, and I plan on adding more features in future.