Hacker News new | ask | show | jobs
by barrkel 3264 days ago
What library supports C, C++, Lisp, Java, JS and C# callers?
2 comments

I think any C api should be target-able by all of those.
The JetBrains IDE libraries?

Those are separate libraries with support for C, C++, Clojure, Java, Kotlin, C#, JS, PHP, Python, and more.

All of them exposing the entire AST and the entire environment, which is far more than LSP ever did.

The question was not which library could present an AST for all those languages, but which kind of library format can be consumed from all those languages. And ideally without FFI and writing complex wrappers. C libraries non very convenient to use from C#, JVM, JS (node.js) or sometimes it isn't even possible (e.g. for JS in the browser).

The question is important, because otherwise one would constrain editors to be written only in a language which is compatible to the library format.

Using C libraries from C# or the JVM is very convenient, even today. There’s even automated systems to generate the entire bindings for the JVM, I’ve written bindings myself for a few libraries. You can just generate the interface file for Java from the .h with JNAerator, import it, and you’re done.
That doesn't solve the problem of a segfault in the C library crashing the entire JVM.
It does. Because there’s also libraries to automatically spawn a separate JVM and communicate with that via an IPC system. Or even spawn other things.

But if you want a system where I have to transfer gigabytes via a JSON IPC bus every minute, sure. That’s totally not going to destroy performance in projects that are several millions of code long with major auto-generated assets.

The language server protocol is useless for larger interwoven projects. The same issue appears already with JetBrains Rider (a C# IDE where the C# parser is implemented in a separate process)

> The same issue appears already with JetBrains Rider (a C# IDE where the C# parser is implemented in a separate process)

The fact that Resharper (which powers the Rider language processing bits) blocks the VS UI should tell you that this problem lies elsewhere.

Why would you be sending gigabytes of data? You don't have to send the whole project across every time a change is made.