3 ms·
Fault isolation is good, but are the fault isolation benefits worth everything else though? Windows COM does have a way to run the server out-of-process with a
by mitxela 26d ago
Fault isolation is good, but are the fault isolation benefits worth everything else though?
Windows COM does have a way to run the server out-of-process with a performance cost, and this fact is transparent to the client (if it only uses COM interfaces and not global variables or something). I assume you can even switch between the modes at runtime (with restarting the plugin).
- braiamp 26d agoWhy not implement unix sockets too, since we want to avoid the ip/tcp stack? Now you have two platforms to support for no real gain. Also, LSP applications are shared between projects/users, how you centralize that if each system needs its own installed program and dependencies? Using networking is the path of least resistance and it's drawbacks are well understood between the ones that need to communicate, there's no point to implement IPC based communication.
- simonask 26d agoI think this is a very reasonable question to ask. Language servers are certainly a significant source of slowdowns and editor unresponsiveness, and any time you're doing IPC, that's another source of latency and fragility. My current Zed editor instance has 5 different language servers running, implemented in at least 3 different languages, some of which require a full VM runtime. Could Zed (written in Rust) host a full .NET runtime to run the Roslyn language server for C#? Could an Electron-based editor? It feels a bit daunting. Plugins could be native shared libraries, but what happens when multiple language plugins all try to initialize huge process-wide runtimes like .NET or the JVM? Even multiple instances of the Python runtime are going to potentially be stepping on each others' toes. IPC and separate processes is probably the pragmatic solution for now, even though I would love to live in a world where in-process was more of an option. WASM could be the solution, but would lock language server authors into the subset of programming languages that can be compiled to WASM, and WASM still looks a lot like IPC in practice. (Zed already uses WASM components for its plugins.)
- mitxela 26d agoI think you can totally start a .NET Runtime for a plugin. There are windows explorer plugins written in .NET - I know because Raymond Chen analyzed how they broke things :) If you have freedom then you have the the freedom to make mistakes. In Windows globals are tightly scoped to a DLL and cannot accidentally cross over, so multiple python interpreters are no problem if the python interpreter is statically linked in each python plugin.
- simonask 26d agoIt’s just much easier for an editor to manage a single interface for plugins over having to host a bunch of very large runtimes. Also, I doubt that you would have a very great time running both .NET and JVM in the same process. For one, both of them install signal handlers, and both of them do funky things with threads.
- mitxela 26d agoThey are not mutually exclusive.