4 ms·
I was exclusively talking about parsing ambiguity. Using a keyword to introduce entity definitions (variables, functions, packages, etc.) gives the language mo
by scott_s 12y ago
I was exclusively talking about parsing ambiguity.
Using a keyword to introduce entity definitions (variables, functions, packages, etc.) gives the language more space to grow in syntax without worrying about such ambiguities later. You can construct a grammar without any ambiguities that does not use such keywords - such as with your example of Java - but you're going to have to keep this pitfall in mind anytime you change the grammar.
- chton 12y agoThat's true, it does make it easier to evolve the syntax. The negative side of demanding a terse syntax is clear enough in the C# 6 changes (http://msdn.microsoft.com/en-us/magazine/dn683793.aspx http://msdn.microsoft.com/en-us/magazine/dn683793.aspx), which are really showing a lot of bloat. It's possible to debate the positive side too, but I do agree that constructing a language with a verboser non-semantic grammar is easier.
- scott_s 12y agoFor things like "var" and "def", I'm coming to see them as a smidgen of up-front verbosity to prevent much later monstrosities.