Reasonable Scala compiler (also known as Rsc) is an experimental Scala compiler focused on compilation speed. This project is developed by Eugene Burmako and his team at Twitter.
Rsc is not a fork, but a reimplementation of the Scala compiler. We believe that a performance-oriented rewrite will provide a unique perspective on compilation costs introduced by various Scala features and idioms - something that is currently very hard to quantify in existing compilers.
With Rsc, our mission is to complement official compilers and assist with their evolution through our experiments. We are aiming to discover actionable insight into Scala compiler architecture and language design that will help compiler developers at Lightbend and EPFL to optimize their compilers for the benefit of the entire Scala community.
- Dramatically improve Scala compilation performance
- Study compilation time overhead of various Scala features
- Identify a subset of Scala that can be compiled with reasonable speed
- Facilitate knowledge transfer to other Scala compilers
- Full backward compatibility (consider Lightbend Scala instead)
- New language features (consider Dotty and Typelevel Scala instead)
- Improvements to the type system (consider Dotty and Typelevel Scala instead)
- Runtime performance (will be addressed independently)
- We came up with a small subset of Scala that serves as a tractable foundation for our performance work
- We implemented a prototype typechecker that uses Scalameta-inspired trees and Kentucky Mule-inspired architecture
- We benchmarked our typechecker, and it turned out to be more than 20x faster than the full Scalac typechecker
- We will be carefully expanding the scope of Rsc according to our roadmap
Our project is inspired by the work of Martin Odersky, Grzegorz Kossakowski and Denys Shabalin. Martin inspiringly showed that in this day and age it is still possible to write a Scala compiler from scratch. Greg unexpectedly demonstrated that compiling Scala can be blazingly fast. Denys shockingly revealed that Scala apps can have instant startup time.