4 ms·
I think needing a 800+ pages book to explain just the syntax is precisely the problem! Can it even be parsed reasonably? C++ sure can't be, and Scala appears t
by lucian1900 15y ago
I think needing a 800+ pages book to explain just the syntax is precisely the problem!
Can it even be parsed reasonably? C++ sure can't be, and Scala appears to have the same silly feature creep.
- lgieron 15y agoWhat do you mean by "Can it even be parsed reasonably"? The size of the language seems to come in large part from the fact that it wants to be an OOP and a functional language at the same time, with providing rich and sometimes bleeding edge feature-set in both domains (plus, you've got built-in tools for common problems like XML/XPath handling being a part of syntax). When you combine those, the resulting size is enormous. IMO, it's definitely not a language for everyone and probably won't replace Java in its core domain (JEE enterprisey apps) - but, for many harder problems, the rich feature set can be a blessing.
- lucian1900 15y agoC++ famously needs parsers with about 7 passes. Most other languages have sane single-pass parsers, like recursive descent.
- cageface 15y agoYou could design a similarly powerful language without such a difficult syntax. C++ is notoriously difficult to parse.
- soc88 15y agoI would love to see an example of that.
- cageface 15y agoI would too. Unfortunately C++ is so entrenched it its domain now that any possible replacement is going to have to be more than just incrementally better. Languages like D and Rust and even Go could replace C++ in many of its applications but none so far seem to have gained much traction.
- seanmcdirmid 15y agoWhen I was working on Scala (5+ years ago), the syntax was still pretty rich but the parser was fairly concise. Martin is very good about designing consistent and fairly compact syntax; you get the richness from just a few rules that are easily expressed via recursive descent; there is a little bit of lexer madness for semicolon inference, but this isn't that big of a deal. Its definitely nowhere near C++ in terms of unparsability; one could probably write their own parser for Scala over a weekend or so (depending on their compiler skillz).
- davidf18 15y agoThere is a new book that is very good and to the point (the first 9 chapters are available free from Typesafe, the company that distributes the Scala/Akka/Play stack). Scala for the Impatient: http://www.amazon.com/dp/0321774094/ http://www.amazon.com/dp/0321774094/