YouTube link: https://www.youtube.com/watch?v=e687bFp2FT4
Our guest is Martin Odersky, the creator of Scala. We invited him on specifically to discuss Dotty, a new compiler for Scala.
Your hosts this episode: Josh Suereth, Dick Wall, Heather Miller, Seth Tisue
Join us during and between episodes for web-based Scalawags chat on Gitter.
- Martin's been blogging like a maniac, as he promised
- Dick thinks Martin looks like the Milk Tray Man today, in his turtleneck
- Dotty is an "advanced research experimental platform for future Scala"
- in the works for about 3 years
- coming soon, an initial alpha release for brave coders who like bugs and mystical error messages
- Dotty is an open-source, volunteer project
- open source contributors can talk to each other and the core team on Gitter
- how's the SBT support? it works already, but whole-program only, no incremental compilation yet
- Dmitry Petrashko is building an aggressive whole-program optimizer that uses TASTy
- what's TASTy? typed abstract syntax trees, a high-level intermediate format, the serialized output of the type checker, before code generation
- what programs has Dotty been tested on? "a handful". "most" of the Scala standard library, "all" of the collections, "a few" third-party projects
- is there a REPL? yes,
doti
, but brand new and minimal
- Martin's working on a new compiler instead of improving the old one, should we worry?
- "You can't make everyone happy."
- "Scala is due to have a big jump ahead."
- the experimental-compiler approach has been working well for C#, with their experimental Roslyn compiler: more features, more excitement. "We can move so much faster"
- Mads Torgersen: "We're stealing a lot of things from Scala, have you noticed?"
- change in scalac "has slowed considerably", which is "just right for a lot of people" since "change is the opposite of stability"
- perhaps Dotty will replace Scalac, or perhaps things will be backported to the old compiler
- Josh: will we get fully spec'ed type inference in Dotty?
- do other languages have this? Standard ML "might be the only one", "maybe OCaml"?
- it's a worthy goal, but there's a danger of fossilization, too
- the blog posts so far:
- the blog posts are the essence, what's the essence of the essence?
- the DOT calculus is a mini-language, like the lambda calculus, System J, et al
- proving soundness for DOT was very hard, but now it's done
- and the proof is verified with Coq
- type projections were trouble area. that feature is "on its way out", to maintain soundness. instead, use implicits.
- can Shapeless still be made to work? it will be need to be adapted, but yes, Miles thinks using implicits instead will work
- Dick: how can Scala programmers prepare their code for Dotty?
- number one is stay away from clever use of projections. many ordinary uses (e.g. to represent Java inner classes) will still be OK
- all macros will need to be written, but the new version will be much simpler.
- Josh: what about macros for serializing case classes?
- Martin: we'll support scrap-your-boilerplate out of the box (but we don't yet), no macros needed
- transition from JVM/.NET era design to JVM/JavaScript/LLVM era design, is this affecting Dotty decisions?
- aside from macros avoiding reflection (already covered),
just "tiny and reasonable" tweaks, e.g.:
synchronized
will be moved offAnyRef
and into aMonitor
trait- small numerics changes (
isInstanceOf
/asInstanceOf
) motivated by Scala.js
- turning
asInstanceOf
checking off in Scala.js can give 30% or more speed improvement
- (audience Q from Rajesh Pitty)
- there are "no plans for that yet". if it happens it will be a major version bump, perhaps Scala 3
- other languages are doing this, e.g. Swift 3 ("radically different from Swift 2"), Python 3. we'll have to see how fast the community will be willing to follow
- how compatible is Dotty with Scala 2?
- there is a switch to enable Scala 2 compatibility, and the hope is to help users with an automatic code rewriting tool (which doesn't exist yet, hey community want to take it on?)
- if one manual intervention per thousand lines ends up being required, that seems reasonable
- Dick describes his experience moving to Python 3
- 1 line in 100 needing manual updating wasn't horrible
- (another audience Q from Rajesh Pitty)
- "definitely not", it's "too big a project", but TASTy has some of the same advantages by providing a back-end-agnostic platform
- Dick's dog Dottie corrects Martin's spelling
- Heather: how can people help with Dotty? is there low-hanging fruit?
- Martin:
- JLine integration in the REPL
- the Dotty issue tracker actually has a low-hanging fruit tag
- other REPL stuff in general
- adding more sanity checks to the compiler
- user question from Pedro Furlanetto: where to start with reading
about Dotty?
- Martin: there's no language spec yet, it's in our heads, but look at closed issues in the Dotty issue tracker
- current main focus is compatibility with current Scala, so many planned new features aren't implemented yet
- Seth suggests: start trying to get cornerstone third-party projects like ScalaCheck, ScalaTest, and Specs2 to build, with an eye towards eventually getting a minimal community build up
- Scala was accepted for GSoC 2016
- causing Heather to do a seated dance of joy in her chair
- contribute and get paid!
- suggested projects include two Dotty projects (Dotty documentation, Dotty REPL), and it's not too late for Martin to add more, and not too late for applicants to suggest new things
- Josh reminds us about streamerz, it's got everything you need for a dismally unsatisfying REPL experience
- so long!