Coder Social home page Coder Social logo

reasonable-scala's Introduction

Reasonable Scala Compiler

Reasonable Scala compiler (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 clean-room reimplementation of a 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. Check out relatedwork.md to learn more about how we compare with other compilers and compiler technology research in Scala.

Goals

  • 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

Non-goals

Credits

Our project is inspired by the work of Martin Odersky and Grzegorz Kossakowski. Martin showed us that in this day and age it is still possible to write a Scala compiler from scratch. Greg showed us that compiling Scala can be blazingly fast.

FAQ

What is the speedup?

We believe that it possible to achieve dramatic compilation speedups (5-10x) for typical Scala codebases, and we are currently well on track to realizing this vision.

How can this be possible?

  • Our typechecker is based on the insights of the Kentucky Mule project developed by Grzegorz Kossakowski who has convincingly demonstrated that typechecking Scala can be embarrassingly parallel.
  • Our compilation pipeline consists of only 4 passes over syntax trees in comparison with 20+ passes in Lightbend/Typelevel Scala and 15+ passes in Dotty.
  • Furthermore, we believe that restricting our compiler to support just a subset of Scala will enable further compilation speedups. We call this subset "Reasonable Scala" and will dedicate focused effort to identifying it.

What language features will be supported?

It is too early to say this definitively. We are planning to start small with a trivial subset of Scala and then gradually add features, carefully measuring their impact on compilation performance. Ideally, we would like to make it possible for Scala programmers to easily reason about compilation performance cost of various Scala features and idioms.

What about existing codebases?

Not all Scala programs will be compatible with Reasonable Scala, so a Scalafix migration may be required to use rsc. However, all Reasonable Scala programs will be compatible with Scala, so codebases that have been migrated will be crosscompilable. Details will become clearer down the line, but keep in mind that we are a large Scala shop, so we take compatibility extremely seriously.

How do I learn more?

We don't have any further official documentation, but there has been a great discussion of our announcement on Reddit and Hacker News. Check out the links below if you're interested in details:

How do I get started?

We are planning to open source Reasonable Scala compiler in the near future. For now, star our project on GitHub and stay tuned for updates.

reasonable-scala's People

Contributors

xeno-by avatar

Watchers

Stan Sobolev avatar James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.