3 ms·
It's the latter. The JSON encoding example is actually a really bad example for this language because there is a huge class of JSON which it cannot easily be se
by drostie 9y ago
It's the latter. The JSON encoding example is actually a really bad example for this language because there is a huge class of JSON which it cannot easily be seen to encode, though you can probably make some exceptions. An example of the many undefined things would be:
{"abc def": ["123 456", 789, 101112, null, false]}
A better DSL for JSON would have to include actual data types or so,
obj
abc def
arr
str 123 456
num 789
num 101112
null
bool f
...or so.
- breck 9y agoThe paper takes the example from jsonETN. The first letter is the data type. s: StringNode n: NumberNode a: ArrayNode o: ObjectNode b: BooleanNode j: OtherNode I just posted the repo here if you're curious. https://github.com/breck7/jsonetn https://github.com/breck7/jsonetn It used to pass every test, but I haven't touched it in a while and seems like a few lines need to be updated to bring it up to date with TN 4.0 (it's on 3.8 now). Handles the tricky JSON edge cases fine. It would be great if someone wanted to maintain a solid JsonETN! I'm on to the Turing Complete ETNs nowadays, but a JSON ETN would be great and would let you use ETN tools to work with JSON. Package.json for NPM should eventually switch to an ETN. Would provide noticeable benefits.
- breck 9y agoI do like the 3 letter word better than my 1 letter word. Nice job!