-
Notifications
You must be signed in to change notification settings - Fork 8
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
Split out "slow" language server features to seperate evaluator #181
Comments
I understand the need for this, and we have to find some solution. None of the above are acceptable in the long run. The problem is that we break the semantics of Rascal in ways that users can not see for options B and C, in particular the semantics of closures and memoization, and the values of globals. Probably some other stuff that we take for granted but will break when we decide to split things over multiple evaluators that have been written together. The only thing that seems to make sense is the second/slow module option C; because this implies loading that module in its own state with all of its own semantics, independent of other modules. But this one is, indeed, ugly and unnecessary for the future. How about option D, where we allow different language implementations to register for the same language. So in that sense we keep the Option D is a useful feature to have in general and for the future, because it makes LSP implementation more modular. Other providers can add features that an original provider did not have without having to break into the existing code. And as a side-effect, it fixes our current interpreter-lock problem. |
I like the extension opportunity, it would make the code the multi-plexer even more annoying, but that could work. Option D would make it hard to override existing registrations. So if you are developing a new language, you might want to update the registration, but now it doesn't overwrite it anymore, it just adds it to the list. I like If we make the second/slow module an overload (for option C) we can deprecate that in the future? So that the original function doesn't have to change? |
For option D: we would have to think about the parsing aspect, will they share the same tree or not? |
I would say not; otherwise you'd have to start synchronizing between the servers, which is what we don't want. They can of course easily share a grammar and create their own parser from this. |
parsing is fast so I'd say the re-work is a non-issue. |
yes, we need something for that. But if we use the module name as a key, then it would be as simple as that. |
I'd say we change the semantics of |
true, module name + function name would be good enough. It still won't clear out old registrations. Maybe you've renamed a module? I think we'll need a
Well, we are parsing a lot, but okay, that's maybe a sacrifice we can accept. |
|
Option D discussed in #181 with exception that the parser are shared
This design is finished now. Closing this issue |
Is your feature request related to a problem? Please describe.
As we write bigger LSP DSLs, the slowest calls (most often the typechecker) lock down all the other small fast calls.
Describe the solution you'd like
While rascal still has a GIL, I would like to have a way to split of some of the work to a dedicated evaluator. The rascal-lsp side already does this, it has 3 evaluators, one for outline, one for making summaries, and one for running the rascal-core checker.
I foresee the following options:
Option A: Always start second evaluator for
summary
Automatically start a second evaluator, and run the main twice, the second evaluator only keeps the
summary
closure.pros:
cons:
Option B: Extend
LanguageServer
ADT, let user chooseAdd a specific constructor to the LanguageServer adt (or common keyword parameter that is always false) that allows users to configure certain callbacks to be moved to a second evaluator. only when that one is set do we actually start a second evaluator.
pros:
cons:
Option C: Extend
registerLanguage
, add concept of second/slow moduleAdd extra (optional/overloaded) params to
registerLanguage
that points to a secondary module. Both modules are loaded into a different evaluator, and the LSP tasks are split up based on the services provided in each module.pros:
cons:
Discussion
I think option C is the cleanest, but might also "lock" us into a pattern that we don't need for the compiled version of rascal.
The text was updated successfully, but these errors were encountered: