Hacker News new | ask | show | jobs
by tempaccount420 109 days ago
LSPs suck. Compilers should be able to re-use their cache for queries, interfaced with through a simple CLI.

They should not need more RAM than what the compiler uses.

Most LSPs don't work well for big projects or with non-standard setups like Bazel.

Edit: is this really so controversial it has to be downvoted?

4 comments

But now your asking the compiler to also be a daemon. The compiler devs to add and maintain a not insignificant feature. The compiler to keep everything it caches for queries (whoops, look at that RAM usage climb!), and to cache data suitable for answering LSP queries (gosh! It's climbing a lot!)
Why does it need to be a daemon? Why isn't the on-disk cache enough? Running a compiler without making changes is instant. Many operations of LSPs feel slower than compiler's incremental compilation.

What cache is needed that the compiler doesn't already have?

One of the many advantages of LSPs is that they can continue to work even under the condition of compilation error.
This is not unique to LSPs, a good compiler will do the same.
Compilers only do one file at a time, but an LSP needs to parse all the files.

Also, an LSP needs to update incrementally when you edit the file, not just when you compile.

And not every language is compiled. And not everything that has an LSP is even a language. I don't think the gp comment was very thought through.
It's sad to see that the sane opinion is so heavily downvoted.

LSP as a protocol is fine, but the actual technical implementation of JSON RPC is braindead. Only web devs that don't know anything about native code could devise such an abomination. What happened to plugins and dll's?