Open LFSaw opened 1 year ago
The completeness of the JSON standard is probably its best feature but also its worst as it does not allow to add features such as comments.
YAML on the other hand allows comments and revisions, but its implementation is also much more complex, see https://yaml.org/spec/1.2.2/ I have not checked but I would guess that the SuperCollider YAML decoder faces the same problems as the JSON decoder, mainly ignoring the data type of its scalars and use string for everything.
As we still rely on the internal parseJSON
method and only extend it by trying to reconstruct the original data types we can not make up for the incompability of the SC JSON decoder to parse only valid JSON (or does it? have you checked it?). To make this work we would need to implement the JSON(5) decoder within sclang, which currently uses a CPP library to parse JSON/YAML files. The sclang implementation would be slower for sure (at least factor 10?) and memory inefficient for big JSON data structures.
So what to do? From a pragmatic perspective I would suggest
From a non-pragmatic perspective I would suggest
What would you prefer @LFSaw ?
Thanks again for this wonderful add-on, I use it all the time :) I was wondering:
There's a (simple) extension to
json
called json5 that especially includes comments and is targeted towards human readablity. Might be worth looking into to support?Example from the website:
A more real-world example is this config file from the Chromium/Blink project.