Comment by hyperpape
7 days ago
> I never got why compilers don't have pluggable syntaxes.
An interesting question, but the answer is "because it's a bad idea" that doesn't actually solve the problem.
That said, the right way to implement this is as a "transpiler" that compiles one syntax into another. And only the people who want to use it pay the costs.
> An interesting question, but the answer is "because it's a bad idea" that doesn't actually solve the problem.
This doesn't really explain anything, and it isn't clear that both of you have the same model of "the problem" in mind.
The usual way people get here is that they didn't realise programs are for reading by humans. That's why we have formatting conventions (the compiler doesn't care but humans do) and so it's also why a single syntax is important.
If there are six syntaxes for a hypothetical language L, then either every L practitioner must learn all six syntaxes (ew, no thanks) or most L programmers can't read each other's programs and so it's basically unmaintainable.