[Babel-users] babeld interface
Juliusz Chroboczek
jch at irif.fr
Sat Mar 10 14:50:47 UTC 2018
> The main benefit of a well-known format is that the requirement for a
> client goes from easy parsing code to *no* parsing code.
Right. So either we add a dependency on JSON to babeld, or we add
a trivial parser to every program that consumes babeld's input.
> In this example, parsing the custom format in Python would be something like:
No, parsing input using string.split is always incorrect. You really want
to write a proper lexer.
The lexer I posted above is 70 lines of C, including full error checking.
In Python, it's probably 15 to 20 lines. Is it really worth switching to
a bloated and unreadable format in order to avoid 20 lines of code in each
client?
The problem that JSON aims to solve is not very complicated, and JSON doesn't
solve it particularly well.
-- Juliusz
More information about the Babel-users
mailing list