Currently, the macro server and the compiler process exchange information via an incredibly ad-hoc format. The command is a nonempty sequence of strings where each string is preceded by its length, and the response is sent the same way. The length of the sequence is agreed upon by convention and is not sent as part of the data, which is both messy and error-prone.
I propose we switch the whole thing to JSON. A command is a single JSON string, still preceded by its own length, and a response is the same. We can send any number of arguments and additional information in a nice well-defined way via JSON.
Currently, the macro server and the compiler process exchange information via an incredibly ad-hoc format. The command is a nonempty sequence of strings where each string is preceded by its length, and the response is sent the same way. The length of the sequence is agreed upon by convention and is not sent as part of the data, which is both messy and error-prone.
I propose we switch the whole thing to JSON. A command is a single JSON string, still preceded by its own length, and a response is the same. We can send any number of arguments and additional information in a nice well-defined way via JSON.