-
Notifications
You must be signed in to change notification settings - Fork 31
Conversation
- Lightweight analyzer and implementations - Avoid heavy compiler dependencies - Use external process to freeup memory
I wonder how the completion system will work with this |
@bew auto-completion feature will keep working as usual |
Completion just uses the compiler/syntax from crystal to build the ast trees. |
👍
@laginha87 Then, a developer using scry will see the errors and implementation behaviors according to the crystal version that he/she is using. Will not depend on the crystal version that scry was compiled, so finally, is another benefit for using an external crystal process 😄 |
Like I said here I'm still not sure this is a good idea. If this PR included README changes stating that this is dependent on the user having the Crystal compiler installed in their PATH and included a mechanism to alert the user if they don't when the server starts I would be more onboard with a change like this. |
Hi @keplersj 😄 We're already dependent on crystal command installed and avaliable on PATH. Scry is already executing scry/src/scry/environment_config.cr Line 25 in 1bff42e
So currently if a user doesn't have crystal installed, then scry won't work This PR just take advantage of using crystal command to be memory friendly, to compile faster and to generate a smaller binary. |
@faustinoaq Hmm... Okay. I still can't shake this feeling that relying on the Crystal compiler command line is going to be a bad idea in the long run and probably breaks with the norms of other LSP servers. But, you have good points. I'm okay with this for now. I do want to hear @bcardiff's opinion on this though. |
The In fact the only disadvantage of using this approach is that compiler could output extra characters to stdio in some special situations: like |
@faustinoaq How will this affect CI? We should be able to remove any LLVM dev dependencies? |
@bmulvihill Oh yeah, another advantage of this PR, LLVM won't be a requirement to compile scry! 🌮
😄 |
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.
@faustinoaq Originally I was against this idea, but I think the benefit of not needing to package the entire Crystal compiler is a big win.
@bmulvihill I second your comments. I've been swayed. This is a good idea. If there were a way to interact with the compiler programmatically without all the weight I'd be for that, but this works well in this form. |
So, I think this is ready, WDYT about merging this? |
Hi, this PR implements lightweight features:
Before:
With this PR changes:
Same features and behaviors, more RAM friendly and lightweight binary
19.2MB
vs4.7MB
Oh, also compilation time has been reduced drastically:
Previously scry compilation used a huge amout of RAM (above 1GB) and took several minutes to compile in my pc 😓
Fixes #30
Related comment on #48 (comment)