Re:Antirez' tiny JSON selector library
by lifthrasiir on Monday November 27, 2023 @11:42PM
(#38442414)
It can be rather argued that antirez has chosen his language to fit into a small code. Indeed, such mini-languages are not uncommon in C: not only printf and scanf, but for example Python's PyArg_ParseTuple and friends [1]. It is also common that they are underdocumented, have unexpected pitfalls (for example, this selector library won't tell you that you have a typo in the typecheck string), have strange contortions to keep up with C's lack of features (for example, this library reserves * in the keys because C makes string concatenation difficult, so you are forbidden to use that character in verbatim), and tend to be difficult to change because everything is a bare string.
[1] https://docs.python.org/3/c-api/arg.html#c.PyArg_ParseTuple