Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

JSON unmarshalling often has to consider separately whether an attribute is absent, false, zero, null, or the empty string, but this was never quite semantically ambiguous enough for my tastes, so adding that void-ish values may also now be serialised as a tuple of length [0] seems to me an excellent additional obfuscation.




The use case here is to reduce the token usage with LLMs, such as an agent that outputs a list of commands eg. Tuples with files to write and their new contents.

Supporting this use case doesn’t require perfectly marshaling every data structure ever.

But to your point the tool could have wider use cases without the limitations.


If one trains a model to understand it then that model will inevitably emit it, which means in turn one shall have to parse it, and now the application supports TOON for anything, and good luck telling the users/customers any different.

What if there’s a simple converter back to json after the model output? Is that possible?

Arrays of length 0 also exist in json?

Yes, this is valid JSON: []



Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: