3 ms·
I think SQL is an unfair example because the grammar is so poorly constructed. Designers of the language seemingly cared little for ease of extensibility in fav
by slaymaker1907 3y ago
I think SQL is an unfair example because the grammar is so poorly constructed. Designers of the language seemingly cared little for ease of extensibility in favor of ridiculously specific constructs. Compare that to Java's much simpler grammar https://docs.oracle.com/javase/specs/jls/se7/html/jls-18.html https://docs.oracle.com/javase/specs/jls/se7/html/jls-18.htm.... I can't find a good reference, but I suspect even Kusto/KQL has a much simpler grammar than SQL despite functioning in a very similar problem space.
One of the first rules of making a new programming language should really be to do as little as possible in the parser. By making your parser extremely complicated, you also make it extremely difficult for anyone to write tools for your language. Instead, it's much better to push that out to the rest of the compiler and/or the type system.