Skip to content
0:00 / 0:00

#dotty#compiler-internals#tasty

Hands-on Dotty — Dmitry Petrashko

Scala World

5.9K subscribers • 13 videos on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Presented by Dmitry Petrashko

Advanced. Deep dive for people who know the field.

11K views11 years ago2 recommendations

Programming languagesSystems programmingScalaCompilers and interpretersPerformance and optimization

Dmitry Petrashko introduces the internals of the Dotty compiler, explaining its mini-phases and info-transformers pipeline.

Dotty is a platform to try out new language concepts and compiler technologies for Scala. Learning from experiences with scalac extensibility, we have made a huge step forward making dotc a true pleasure to work with. This talk will be an introduction to internals of Dotty compiler. Dotty compiler transformation pipeline is based on the notions of Mini-Phases and InfoTransformers. These abstractions allow to modularize code transformations without sacrificing performance. Currently Dotty pipeline has more than 40 very finely grained mini-phases, compared to 25 in scalac, and this number is likely to increase. Mini-Phases constitute transformations of trees, which can be efficiently pipelined, as they share a single Tree traversal. Comparing with scalac, if you were to write a non-trivial phase in your compiler plugin, you will need a separate traversal of tree, slowing down the compilation. Unlike this, in Dotty you define a mini-phase, that typically doesn't trigger extraneous traversals. InfoTransformers define transformations of symbols and their types. These transformations apply lazily, and transparently maintain versioned history of the information associated with symbols. Finally, Dotty has strong self-verification framework, that ensures that after every phase the state of internal data structures of compiler is consistent. This talk will introduce all those notions, showing interactions between them. We will follow Dotty code and see how are they used. In the second half of the talk we will implement a Mini-phase, to demonstrate how all this notions are used. Slides for this talk are available here: t.co/N7riaeHuR1

Why it's here

2 people recommend this

What people say. Recommended for its deep dive into the Dotty compiler architecture and performance improvements.

Moments people linked to

u/sschaef_in r/scala • Recommends

On “Martin Oderskys New Year Resolutions for Scala”

Hands-on Dotty by Dmitry Petrashko gives an overview.

u/jlh276in r/scala • Recommends

On “Odersky: Add Records To Dotty”

Watching Hands-on Dotty that indicates a focus on compiler performance as well as improvements on the compiler architecture, my personal take is that they are considering (or hoping) to have it eventually replace scalac. (Why worry about performance otherwise?) They are many hurdles on the way though. The compiler still has a long way to go. Dotty has a slightly different type system and Scala has a large eco-system now. If python2 to python3 is any indication, this type of transition is not quick or easy. It feels to me TASTY is a strategic move that can enable this.

u/Daxtenin r/scala • Mentions

On “SBT 0.13.14-RC1”

Tasty link to this video
1View on Reddit