Remix.run Logo
Terr_ 2 days ago

Past-me had hoped that by the Future Year 2025, it'd be typical to publish a parser grammar file for this kind of thing.

Both to bootstrap making a parser in a new language, and also as a kind of living spec document.

wofo 2 days ago | parent [-]

I think the current grammar should be precise enough for that, though it's embedded in the source code as a comment and not in its own file (see https://github.com/kson-org/kson/blob/857d585ef26d9f73e080b5...). It probably can't be fed verbatim into a parser generator, but anyone who reads the parser's source code should have an easy time writing a parser by hand for their programming language of choice (heck, they might even have an LLM translate the original parser into whatever language they want, once there is a comprehensive conformance test suite to validate the resulting code).

All in all, I'm confident that KSON can become ubiquitous despite the limitations of the current implementation (provided it catches on, of course).