The lack of all these added features is the feature of JSON. Just use Toml or Yaml if you need more features and don't like quotes.
Also need to appreciate the immense cost of splintering off yet another data format. The value of common formats is that even if it's not ideal for any of our individual needs, we're at least all using and maintaining the same tools.
I think where experiments like this shine is when you're doing some limited scope personal project. Like I'll probably use this for a few days of Advent of Code to see what ideas stick.
This project came about because we were using json a lot for it’s for simplicity and also widespread support in languages and tools we were using.
We started hand editing a lot and making more mistakes, but we have a lot of code generated json from build pipelines and use json with a number of different libraries in different tools already so didn’t really want to switch to yaml or toml.
Jsn is not meant to replace json, we are still using json a lot natively, we just can write config files more easily and jsn spits out fully compliant json for you, or you can use a python dict the same as json.
Jsn does not have a serializer, once it has been parsed it is json.
JSON to YAML is super easy, and back too. That's what we do here. YAML+comments is generated by humans, conver to JSON, merged with JSON made by machines into final JSON configs used by loads of apps. And dumping the whole thing, or parts back out to YAML is trivial.
Yeah, in hindsight maybe we could just switch to YAML but it does have quite a lot more syntax.
Jsn started as a python function which removed comments and fixed trailing commas. YAML does not come bundled with python and is an external dependency..
I suppose looking at it now jsn grew to a point where using something else in the first place would have been less work :)
Thank you for acknowledging that YAML could have been an alternative choice. But don't let such alternatives stop you from hacking your own solution or scratching your itch. If every person on the earth, stopped developing their own solution because there is an alternative that works with limitations we will see no progress in technology. It is good to develop your solution and then come to the conclusion that there is a better alternative than not having tried at all.
FWIW - this is an argument against creating any new languages. "Just use what's there, or X or Y if you don't like it". We'd all still be writing assembly or C if this advice were followed.
If people didn't tinker and experiment and introduce their ideas into the wild, we would basically never make progress.
Also need to appreciate the immense cost of splintering off yet another data format. The value of common formats is that even if it's not ideal for any of our individual needs, we're at least all using and maintaining the same tools.
I think where experiments like this shine is when you're doing some limited scope personal project. Like I'll probably use this for a few days of Advent of Code to see what ideas stick.