You should be able to save a JSON file with holes in it, and then load it again later.
Goals:
We can use an existing unmodified JSON parser
If a document has holes in it and you load it outside of Synless, you'll get a parse error (or compiler error, etc.).
Users are not capable of accidentally writing something that gets interpreter as a JSON hole
Approach:
Synless has a magic UUID that you are never allowed to mention verbatim in any Synless document.
Every sort has two magic constants associated with it. Both contain the UUID. The first is syntactically invalid and would give a parse error if parsed. The second is syntactically valid for that sort. The mapping from first constant to second constant must be unique.
When saving, print every hole with the first magic constant for its sort.
When loading, (i) replace every first constant with the unique corresponding second constant, (ii) parse, (iii) replace every second constant with a hole.
You should be able to save a JSON file with holes in it, and then load it again later.
Goals:
Approach: