3 ms·
S-expressions don't have associative arrays (maps/dicts/objects), which are very important for config.
by xigoi 3y ago
S-expressions don't have associative arrays (maps/dicts/objects), which are very important for config.
- lelanthran 3y agoS-expressions don't have anything. They can represent almost everything, though. Composite data types, nested objects, alists, lists, trees, tables... With only a few primitive additions, you should be able to represent everything, except for bidirectional cyclic graphs.
- mbakke 3y agoBut then you have to evaluate things, which brings all kinds of problems. Your parser is no longer 300 lines, and eventually you might snap and throw it all away for a full-blown interpreter which makes dealing with user provided input difficult. I'm actually investigating using S-expressions for describing jobs and systems, but haven't figured out how to safely evaluate them short of running in isolated VMs. Edit: thinking more about this, it is possible to represent all those things without evaluation. It's just awkward to create them... but that can be solved on a different level.
- waffletower 3y agoThere is a discussion above regarding EDN, which supports S-expressions, has maps, sets, and vectors (JSON style collection syntax []). I think it could be an excellent replacement for YAML in some important use cases, but it is lacking for representing inline, non-Lisp code and heredocs.