Merged
Conversation
Recently, Stu Hood came up with a groundbreaking idea. He suggested
that Rsc can become useful much earlier that we initially thought.
Stu's key insight was to serialize the results of outlining into
a format understood by the Scala compiler and then use that to launch
multiple independent instances of the Scala compiler to parallelize
Scala compilation.
Towards that end, we postponed the initial plan to implement a Scala
typechecker in Rsc and decided to focus on outlining for the time being.
We came up with the following design of a compilation pipeline for Rsc:
* Metacp converts dependency classpath into the SemanticDB format,
i.e. the metadata format of the Scalameta toolchain that is used
internally at Twitter for Scalafix and Language Server Protocol.
* Rsc computes signatures of all public and protected definitions
in Scala sources.
* Rsc saves signatures to disk in SemanticDB format.
* Mjar converts signatures into the ScalaSignature format,
i.e. the metadata format of the Scala compiler.
So far, we have implemented support for a subset of Scala to produce
signatures for automatically rewritten core of Twitter Util.
We will be working on adding support for more Scala features according
to our roadmap.
(We have also just learned about an independent effort within the Dotty
project based on a similar architecture by Guillaume Martres.)
This was referenced Jul 7, 2018
Closed
This was referenced Jul 7, 2018
Contributor
|
Woot! This sounds awesome |
|
This is really interesting, but I'm surprised to see this appearing as a giant code dump, any reason that this was not developed in the open? Can we expect more code dumps like this in the future? It'd be nice to at least preserve the git history instead of squashing everything in one commit, there's usually a lot of knowledge in commit messages! |
Contributor
Author
|
@smarter The fate of this new design was decided by the numbers. If SemanticDB generation for signatures of a real-world project ended up being not ~28x faster, but say only ~1.5x faster, we would be back to the drawing board. Therefore, in this case, we felt that upfront experimental evaluation was a prerequisite for sharing. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Recently, Stu Hood came up with a groundbreaking idea. He suggested that Rsc can become useful much earlier that we initially thought. Stu's key insight was to serialize the results of outlining into
a format understood by the Scala compiler and then use that to launch multiple independent instances of the Scala compiler to parallelize Scala compilation.
Towards that end, we postponed the initial plan to implement a Scala typechecker in Rsc and decided to focus on outlining for the time being. We came up with the following design of a compilation pipeline for Rsc:
i.e. the metadata format of the Scalameta toolchain that is
used internally at Twitter for Scalafix and Language Server Protocol.
So far, we have implemented support for a subset of Scala to produce signatures for automatically rewritten core of Twitter Util. We will be working on adding support for more Scala features according to our roadmap.
(We have also just learned about an independent effort based on a similar architecture by Guillaume Martres: scala/scala3#4767).