Talk by Anders Hejlsberg on interplay between editors and compiler

Found this 35 minute talk on Hacker News (recent repost, original post) titled “Anders Hejlsberg on Modern Compiler Construction”.

I thought he made some pretty interesting points regarding a compiler having to act more in a ‘pull’ mode than a ‘push’ mode to achieve fast code completion in an editor. He also mentioned a language server that’s shared between different editors and potentially even maintained as part of the language itself.

Just wondering what people’s thoughts are on this topic and how it relates to the current approaches taken for Julia editor plugins.

4 Likes

https://github.com/JuliaEditorSupport/LanguageServer.jl

1 Like

Ah, I was confused. I thought that since this was an implementation of the Microsoft Language Server Protocol it was only for VS Code.

Nah, microsoft’s LSP has hit it big.
They did a good.
It is supported by tons of text-editors / IDE’s now.

It is by no means a unique idea.
YouCompleteMe setup a very similar framework about 6 years ago.
Editor agnostic Language Server running as a separate process talking HTTP (locally),
to a client that was an editor plug-in.
The author had big dreams of clients in many editors, but I think only the vim one took off.
(At which point YCM looks crazy over-engineered)

Rust has Racer which uses something similar (inspired by YCM)

But with LSP microsoft apparently just got enough momentum that it is working out great.
The more languages and editors that support it, the more others want to.
And it hit critical mass

3 Likes

Cool, thanks for the info.

So what about his other points, especially regarding the integration between compiler and language server? I see that LanguageServer.jl uses CSTParser.jl. I just skimmed the package really briefly, but it seems to me like CSTParser.jl would indeed be pretty susceptible to getting out of sync with the language itself. I guess it also doesn’t go all the way down to the type inference level, or am I mistaken?