logoalt Hacker News

jcranmertoday at 4:51 AM1 replyview on HN

That doesn't really fix anything. The filesystem is fundamentally a racy shared data structure. If you made the entrypoint API synchronous, any half-way decent editor would shove the LSP queries to the synchronous API into a different thread, because "Do Not Block the UI Thread" is a fundamental principle of good UI programming.

Once you get past that, JSON-over-TCP is just another kind of asynchronous RPC mechanism, one that has the advantage that you can build it in just about any language with out-of-the-box tools. Trying to make a plugin system or a COM or CORBA or OLE based system really cuts out the ability to build language servers in most languages, because you have to be able to build the code in just the right way.


Replies

mitxelatoday at 12:40 PM

Big assumption that the editor, which is required to make calls synchronously, would make them on a different thread. Isn't correctness more important than avoiding plugin calls in the UI thread? The good thing about having an actual function interface is that you can tailor each one to its actual needs, instead of insisting high-overhead async is okay for everything. It's like GDI vs X11.