8 ms·
The Scala team pulled out all the stops with Dotty. It's a real tour de force, on a par with the sea change of C++11. Even with the plaudits he's earned, Martin
by seertaak 7y ago
The Scala team pulled out all the stops with Dotty. It's a real tour de force, on a par with the sea change of C++11. Even with the plaudits he's earned, Martin Odersky is for me in the top three language designers of our time. (I'm sure I'm being unfair to other members of his team with this comment, though.)
Dotty's union types are a thing of beauty, its implicits are really second to none, and _so_ damn useful. Their decision to embrace whitespace sensitivity, while simplifying the syntax for predominant use-cases (again, union types!) betokens flexibility, and a desire to swing for the rafters.
The only thing that saddens me somewhat is that Scala Native does feel like a bit of a second class citizen. The `stackalloc` feels a little sad (coming from C++ -- it should be inverted!). I wonder if it's possible for Typesafe to leverage Scala Native in a manner akin to Python with Numba/Cython. With whitespace indentation - native code inlined and FFI'd automatically - right there with the rest of the nice JVM stuff.
I can't resist citing my email from Feb '07 asking (politely) why we needed a 'new' keyword. Dotty apparently removes the need for that keyword. Should have listened earlier, team Scala ;)
http://www.scala-archive.org/quot-new-quot-keyword-td1989540.html http://www.scala-archive.org/quot-new-quot-keyword-td1989540...
- spir 7y agoHere's a great talk given by Martin Odersky, "A Tour of Scala 3" https://www.youtube.com/watch?v=_Rnrx2lo9cw https://www.youtube.com/watch?v=_Rnrx2lo9cw That talk is almost a year old now :) a lot of progress has been made towards launching Scala 3. The latest Dotty release was March 18 https://dotty.epfl.ch/blog/index.html https://dotty.epfl.ch/blog/index.html Scala 3 combined with Scala.js and GraalVM native compilation will be a killer stack :). You can write code that's as high level as python and typesafe as Haskell. Use the same code on the backend and in-browser with Scala.js. Compile your code to statically linked native executables with instant startup time, great for CLI tools. In terms of developer experience, Scala 3's compiler is much faster than Scala 2 because the data structure representing incremental compilation is not rebuilt for each compiler phase. The faster compiler can be used with Microsoft's Language Server for a delightful IDE experience, especially in VS Code which is the current recommended editor for Scala 3.
- AheadOfTime295 7y agoA word of caution on Scala 3: Scala 3 still in beta, lacks clear roadmap, allows choosing between two syntaxes (python-style vs braces). Dotty Community Build lacking Lightbend frameworks (no Akka, no Play, no sbt) With the recent layoffs at Lightbend of Scala 2.x core contributors, a full endorsement of Scala 3 would certainly help.
- rch 7y agoAs an outside observer (and professional Akka user), comments like this really help put the changes in perspective. Thanks.
- vvillena 7y agoScala made lots of Java patterns builtin language features, and it appears Scala 3 will do the same thing with all the patterns that emerged in Scala 2. As long as the tooling keeps up to par, Scala 3 will be one of the most pleasant to use languages out there.
- AzzieElbab 7y agoI always thought scala native to be a bit of distraction after graalvm went mainstream. Don't know why people do not like working with language that can combine better parts of Java Haskell Ruby and Erlang. Having said that, Scala is Scala, and people who are writing Haskell or Java code in Scala certainly not writing Scala
- tasuki 7y ago> people who are writing Haskell or Java code in Scala certainly not writing Scala For me, one of the joys of Scala is that you can use different paradigms and mix them up as convenient. Haskell Scala is still Scala and so is Java Scala!
- AzzieElbab 7y agoI do that too, but to a degree. For example, I avoid monad transformers, fully automatic derivations, pretty much anything that requires line long type signatures
- erton23 7y agoUnfortunately, I slowly got frustrated reading the what's coming for Scala 3. * True intersections and union types -- use them sometimes, not something you can't live without though. * Trait parameters -- slightly easier life for OOP, ok I guess. * Function types and implicit function types -- right, will make your code even harder to read (subjective). * Generic tuples -- again, I can't remember we ever had problems with tuples in Scala. * Opaque types -- another small OOP improvement. * Type lambdas -- I've never seen them used. * Erased parameters -- probably useful if it improves performance even at the cost of readability right? * Enums -- finally something practical, good. And that's all about major changes in Scala 3. Ah, yes, we get a new compiler. Are you excited? These changes look like a quarterly release than a major version shift. Now, imagine a project manager who's estimating the migration downtime for Scala 2 for the sake of the above.
- AheadOfTime295 7y agoScala 3 could improve on 2.x struggles with supporting JDK 9 and up: Support features of JDK 11+ https://github.com/scala/scala-dev/issues/139 https://github.com/scala/scala-dev/issues/139 Support Java Module System https://github.com/scala/scala-dev/issues/529 https://github.com/scala/scala-dev/issues/529 In comparison language features seem to attract much more attention: Removing existential types https://contributors.scala-lang.org/t/proposal-to-remove-existential-types-from-the-language/2785 https://contributors.scala-lang.org/t/proposal-to-remove-exi... Significant indentation syntax https://github.com/lampepfl/dotty/pull/7083 https://github.com/lampepfl/dotty/pull/7083
- pjmlp 7y agoThat is a good example why betting on the platform languages is always a long term safer bet than betting the house on guest languages, Eventually they won't keep up with the underlying platform.
- pas 7y agoIt's not like it isn't working. Scala runs fine on JDK13 (probably 14 too, but we currently run one Play project in prod on 13). Java is a pretty safe bet, as it has an outstanding backward compatibility track record.
- beastman82 7y agofor the record, instantiating case classes in scala does not require "new"
- AzzieElbab 7y agoOr any other class if you write an apply method in companion object
- cies 7y agoInteresting you refer to C++. Both languages, IMHO, became too big to be practical. You need to, as a team, choose a subset of C++ (or Scala) and a style for it to become manageable. I dont think this looks good on a language, I prefer a language that comes with a small, concise set of features that are broadly understood and applied. But different folks different strokes.
- AzzieElbab 7y agoI would disagree here. Scala's language spec is smaller than javas, it's problems are akin to Lisps. Too many dsls, extensions and so on. It really opened the doors for FP concepts to go mainstream. Unfortunately, some people went way too far with it.
- hota_mazi 7y agoBrainfuck's spec fits in one page. As does Whitespace's spec. These two languages are impossible to write code in because of their complexity. It's completely mystifying to me that even today, Martin still uses the "spec size" argument in his keynotes to attempt to demonstrate that Scala is a simple language, and it demonstrates a complete ignorance of what language design actually is, or a troubling disingenuity meant to deceive.
- AzzieElbab 7y agoThe intention should matter. Brainfuck's is self descripted. I can come up with a few things that are genually confusing about scala, like implicits resolution rules and quirks of the type system, but I cannot claim they are intentional, and they are getting fixed. On the other hand, having things like functional collections futures years before Java made life easier for the whole lot of us
- cies 7y agoCreator of Scala believes, and advocates, Scala is simpler than Java? Wow.
- hota_mazi 7y ago> Martin Odersky is for me in the top three language designers of our time I don't know about that. To me, the criteria he uses to allow incorporation of features in both Scala 2 and Scala 3 is "Will this feature allow me and my students to apply papers for conferences and fund my PhD students?". Language design seems to have very little to do with that. As long as you can derive multiple papers to multiple conferences from a proposed feature, it's in.
- tasuki 7y agoThat sounds like an accusation. Could you back it up by something, perhaps examples?