hn.today

SOML – A Config Format for Humans

github.com61 points66 comments
Screenshot of SOML – A Config Format for Humans

SOML is a proposed configuration language designed to make structured data easier for people to write and read while retaining JSON-like strictness. Its top-level object needs no braces, keys are usually unquoted, line breaks can separate values, and comments are allowed. Strings use explicit quotes, with literal strings for paths and regular expressions and dedented block strings for prose. Types follow syntax rather than guessed content: quoted “123” is a string, while unquoted 123 is an integer. The format also treats dates, instants, and durations as distinct values, so a timeout such as 30s states its unit. Arrays and objects remain available, and braces and line breaks - not indentation - define structure.

The central argument is that SOML avoids both JSON’s punctuation and lack of comments and YAML’s complex rules and content-dependent type inference. It rejects ambiguous or unsafe data, including duplicate keys, missing values, out-of-range integers, and values whose intended type is unclear; keys are always strings. The specification also defines a canonical representation so equivalent data can produce identical bytes for hashing or signing, alongside formatting and editing rules intended to preserve comments, key order, and value spelling. A language-neutral conformance suite of nearly 1,000 cases is meant to keep implementations consistent. The specification is explicitly a draft seeking feedback, so readers should weigh its design against its maturity and ecosystem before adopting it.

Read on github.com66 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.