Scalawags #38: The Sound of Dotty
YouTube link: https://www.youtube.com/watch?v=e687bFp2FT4
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
Where Dotty stands (1:50)
- 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
Community reaction to Dotty (10:00)
- 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
Type inference (12:40)
- 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
Dotty, the blog posts (15:15)
- 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
Scala goes multiplatform (27:05)
- aside from macros avoiding reflection (already covered),
just "tiny and reasonable" tweaks, e.g.:
synchronizedwill be moved off
AnyRefand into a
- small numerics changes (
asInstanceOf) motivated by Scala.js
asInstanceOfchecking off in Scala.js can give 30% or more speed improvement
Will Dotty replace scalac? (31:00)
- (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
Will there be a Scala VM? (36:20)
- (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
How can we help? (38:15)
- Heather: how can people help with Dotty? is there low-hanging fruit?
- 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
- 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
Google Summer of Code (43:25)
- 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!