3 ms·
I read this book as part of a reading group during my internship this summer. It's a good read, but I couldn't help but feel like the language designers perhaps
by meastham 16y ago
I read this book as part of a reading group during my internship this summer. It's a good read, but I couldn't help but feel like the language designers perhaps could have used a bit more restraint in their design. It is very much a "kitchen sink" language.
- Robin_Message 16y agoI think that was the idea of Scala — to provide all of the modern language features in one language so that you don't have to decide between, say, Java libraries or higher-kinded types or actors. You get them all, you can mix and match. This is powerful because it gives a good basis to test any new feature on a substrate that already has all the existing ones. I think this lack of an arbitrary feature boundary makes it a useful research language. However, for the same reason, I imagine it's not so good in production — it's like Perl with "more than one way to do it," but now you need a PhD [1] to understand several of the myriad ways of doing things. [1] You don't need a PhD, but I'm guessing only a very small proportion of working programmers know what, e.g. a higher-kinded type is.
- meastham 16y agoThat's a good way to describe it. As I was reading the book there were lots of moments where a particular feature seemed very clever and elegant and fun to use, but as I kept reading and the number of features started to pile up it started to look like something that would be very difficult to use in most practical settings. Indeed, when we were doing show-and-tell sessions with out little Scala projects, even though we had all been reading the book, we'd frequently have to ask the presenter what exactly some piece of syntactic sugar meant or to remind us of the precise semantics of some feature. It just never really seemed to all "click" together like other languages have for me in the past. That, and the compiler is dog-slow. I'm working with a group that is looking at using Scala as a basis for an embedded DSL for hardware construction right now, and the compile times are one of the biggest things that is steering us away. Not sure what the deal is there.
- gtani 16y agorandom comments: There are a lot of scala books for different target audiences, 19 in various languages, (the 3 Manning Meaps are half-done chapter wise, : http://www.scala-lang.org/node/959 http://www.scala-lang.org/node/959 http://manning.com/raychaudhuri http://manning.com/raychaudhuri http://manning.com/suereth http://manning.com/suereth ---------------- Re: compiler speed: backgrounders on type inference, http://scala-programming-language.1934581.n4.nabble.com/Partial-type-inference-td2007311.html http://scala-programming-language.1934581.n4.nabble.com/Part... http://lampwww.epfl.ch/~odersky/papers/#Types http://lampwww.epfl.ch/~odersky/papers/#Types http://staticallytyped.wordpress.com/2010/04/17/solution-in-scala-to-the-previous-post/ http://staticallytyped.wordpress.com/2010/04/17/solution-in-... (see comments) -------------- the type checker: http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/compiler/scala/tools/nsc/typechecker/TypeDiagnostics.scala http://lampsvn.epfl.ch/trac/scala/browser/scala/trunk/src/co... and specialization in 2.8: http://stackoverflow.com/questions/4256273/why-did-scalas-library-double-its-size-and-will-that-happen-again http://stackoverflow.com/questions/4256273/why-did-scalas-li... As an aside, you can't really declare anything a problem in scala til you've asked #scala freenode IRC, the mailing lists and/or stackoverflow and gotten their takes on your issue.
- gtani 16y agoand shameless self-promotion, cause somebody asked about 2.9 http://www.reddit.com/r/scala/comments/eb0rd/programming_in_scala28_2nd_edition_odersky_spoon/c16qzfv http://www.reddit.com/r/scala/comments/eb0rd/programming_in_...
- nadam 16y ago"the language designers perhaps could have used a bit more restraint in their design." The problem with that if they would follow your advice it would not be Scala anymore. There are dozens of programming languages which used more restraints in their design, but I've chosen Scala. The reason is that I don't want to use different languages for different tasks unnecessarily. Scala is almost a no-compromise solution: statically typed, fast, concise, supports functional style where I prefer that and supports imperative style where I prefer that. I've been programming in Java for almost 10 years, and it was a no-brainer for me to switch to scala. This is the most important production language for me right now. The only drawback is that it is not for beginners. It is for mature programmers. A beginner will be annoyed by the lot of information this book contains. But after lots of years of programming let's say in Java all the features in the language feels as a bless from god. By the way the languae is not particularly complicated. Its language specification is someting like 200 pages while Java's language specification is something like 600 pages. The BNF syntax description of Scala is smaller than Java's. It contains fewer keywords. Scala is not more complicated than Java, rather it is deeper, and feel more complicated (espceially in the beginning.)
- jules 16y agoThe size of a specification does not correlate strongly with it's mental complexity. For example what do the boolean formulas (a <=> b) => (c <=> d), and a & b & c & d & e & f mean? Or I could give you a specification of core Lisp in half a page. Does that mean that Java is 1200x more complicated? Certainly not. Scala is definitely more mentally complicated than Java, and on the bright side this makes it much more powerful too.