4 ms·
Just use yaml?
by lhopki01 10y ago
Just use yaml?
- wtetzner 10y agoOr if you still want something easy to parse, s-expressions.
- omginternets 10y agoCould you please elaborate? I'm vaguely familiar with S-expressions from my cursory inquiry into lisp (planning to take the plunge in November), but I don't see how they can be applied in this context.
- nv-vn 10y agoS-expresions are really just a way of representing a tree of data (in Lisp code, the S-expression literally represents the abstract syntax tree that is used for the code). Take the JSON example: { "IDs": [116, 943, 234, 38793], "Settings": { "Aperture": 2.8, "Shutter speed": "1/250" } } You could rewrite this as an S-expression as: ((IDs (116 943 234 3879)) (Settings (Aperture 2.8) ("Shutter Speed" "1/250")))
- omginternets 10y agoThanks! I figured it would be simple, and indeed it was :)
- moogly 10y agoYAML is not as simple as one might think. The spec[1] is 80 pages long after all... 1: http://yaml.org/spec/1.2/spec.pdf http://yaml.org/spec/1.2/spec.pdf
- detaro 10y agoI feel like YAML might be a bit to complicated in the other direction, with many ways of encoding quite complex things and the connected risk for bugs. (E.g. the Python-binding, pyYAML, can't even read its own output correctly in all cases)