-
-
Notifications
You must be signed in to change notification settings - Fork 372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move compiler-related stuff to a new compiler module #1144
Merged
alexarchambault
merged 25 commits into
com-lihaoyi:master
from
alexarchambault:compiler-module
Jan 16, 2021
Merged
Move compiler-related stuff to a new compiler module #1144
alexarchambault
merged 25 commits into
com-lihaoyi:master
from
alexarchambault:compiler-module
Jan 16, 2021
Conversation
This file contains 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
alexarchambault
force-pushed
the
compiler-module
branch
5 times, most recently
from
January 14, 2021 19:13
f64902f
to
c417431
Compare
That makes it easier later on to extract an interface for CompilerLifecycleManager
A simple Option is enough, and that makes for a cleaner interface for CompilerLifecycleManager later on.
Having it rely on Frame from ammonite.repl.api, rather than a concrete Frame implementation, makes it easier to extract an interface for CompilerLifecycleManager later on.
…and remove Compiler.parse This allows to strip the Compiler public API of references to scala.tools.nsc. Later on, makes it easier to extract an interface for Compiler.
This makes it more straightforward to extract an API for parsing later on.
Just like the previous commit, this facilitates extracting an API for parsing later on.
alexarchambault
force-pushed
the
compiler-module
branch
from
January 15, 2021 15:54
c417431
to
9ad9655
Compare
util will be a shared dependency of runtime / interp on the one hand, and the upcoming compiler module on the other. Moving Classpath here allows it to be used by both.
So that they can be used from the compiler module
It's used both from repl and compiler, which won't depend on each other in subsequent commits.
So that these can have different signatures in Scala 3, and we can drop the dependency on compiler from interp and repl.
alexarchambault
force-pushed
the
compiler-module
branch
from
January 15, 2021 16:44
9ad9655
to
a99b0da
Compare
Looks good to me, feel free to merge whenever |
Merged
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.
This subsumes #1135. The core idea of this PR consists in moving any compiler- or parsing-related logic to a new
compiler
module, that we can rewrite for Scala 3 later on.Thanks to the 2.13 / 3 compatibility, we can just rewrite this
compiler
module in Scala 3 in a first time, and run it alongside the other modules compiled for 2.13, to get Scala 3 support. This is done on this branch (I'm about to add details about what it can and cannot do in its README).This PR also adds a new
compiler-interface
module, defining a few compiler- and parsing-related traits, and hasinterp
andrepl
depend on those traits rather than on the classes ofcompiler
. This ensures we don't inadvertently depend on concrete scalac or fastparse definitions orcompiler
internals frominterp
andrepl
, which would hamper substitutingcompiler
targetting Scala 3 tocompiler
targetting Scala 2.13 at runtime.In more detail, the commits in this PR successively:
compiler
module and move code to it,compiler-interface
module, with mostly just traits,compiler-interface
incompiler
,compiler-interface
rather thancompiler
ininterp
, then inrepl
.Commit-by-commit:
CompilerLifecycleManager
APIParsers
APIutil
- asinterp
andcompiler
ultimately don't depend on each other, we move some classes they both use inutil
compiler
compiler-interface
, implement its traits incompiler
interp
andcompiler
repl
andcompiler