News for hackers. Stuff that matters.
Re:Crystal Programming Language by daptaq on Friday September 02, 2022 @05:58AM (#32688805)
> 2. No language server (apparently it's just impossible due to the way the language works). Tbh, I'd be happy with just "Go to definition" but alas, no-can-do!

Emacs' dumb-jump appears to have some basic support for go to definition: https://github.com/jacktasia/dumb-jump/blob/master/dumb-jump...

But out of curiosity, what is the issue from a technical point of view?

Re:Crystal Programming Language by straight-shoota on Friday September 02, 2022 @06:19AM (#32688948)
The technical challenge is that a Crystal program needs to be inspected as a whole. Simplified, changes in location A can have effects on some completely unrelated location B. That makes it hard to cache intermediary results and a semantic analysis needs to cover the entire program (including the standard library), not just the files that were changed since the last time.

This applies to the responsiveness and memory consumption of the language server as well as the regular compilation process. So this is an important topic, and we're working on improvements. It's a complex topic, but there are some ideas.

Re:Crystal Programming Language by heynowheynow on Friday September 02, 2022 @06:38AM (#32689046)
This is the same problem with Ruby, Python. or any interpreted language.

What most LSPs do is approximate it rather than worry about perfection and deliver nothing.

Re:Crystal Programming Language by zw963 on Friday September 02, 2022 @11:39AM (#32692059)
I totally agree with this idea, Crystal core member seems to think less of it from a beginner programmer's perspective.
Re:Crystal Programming Language by u89012 on Friday September 02, 2022 @06:30AM (#32689016)
Good to know. I've got zero emacs skills and I'm on vscode and nothing works there. From what I understand the lack of type info until the whole program is compiled creates this issue.