-
Notifications
You must be signed in to change notification settings - Fork 323
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
Avoid Compiler compile time dependency on EnsoContext #7299
Conversation
392a813
to
fd0a9e7
Compare
@@ -446,7 +409,7 @@ public CompilationStage getCompilationStage() { | |||
* | |||
* @param compilationStage the new compilation stage for the module. | |||
*/ | |||
public void unsafeSetCompilationStage(CompilationStage compilationStage) { | |||
void unsafeSetCompilationStage(CompilationStage compilationStage) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to do this change since I joined Enso. Calling a method unsafe
, but exposing it to everyone is a poor design practice. Let's hide it!
The only way to call these unsafe
method is to:
- be in the same package
- have access to
CompilerContext.updateModule
- use
ModuleTestUtils
in tests
The access control shall make it clear it is not a method for everyone.
|
||
CharSequence getCharacters(Module module) throws IOException; | ||
|
||
void updateModule(Module module, Consumer<Updater> callback); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. It will definitelly help us to, at least, make the modifications to modules atomic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see another iteration of decoupling.
Pull Request Description
Defining
CompilerContext
to encapsulate all the existing calls intoEnsoContext
. Providing implementation of this interface that delegates toEnsoContext
. Allows us to compile theCompiler
class separately fromengine/runtime
- after some further work.Important Notes
The ultimate goal remains to create
engine/runtime-compiler
project that would be able to properly apply allIRPass
es to theIR
created byengine/runtime-parser
, but it wouldn't need a dependency on the Truffle API and definitely not on theengine/runtime
project.Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,