Hacker News new | ask | show | jobs
by marginalia_nu 6 days ago
The fact we still don't have a decent Java language server is one of my canaries for the fact that LLMs still, generally speaking, can't ship. There is undeniably demand for this sort of thing, but nobody is coming to meet it. (jdtls, bless it for trying, is just not good)
8 comments

Exactly. I've been trying to say this. Some people think that because people can write CRUD APIs and end-user apps with AI, no-one will need to write code anymore.

There is so much to be built in terms of tooling and libraries where we need tight, solid, well-crafted, original, unique code.

They have a real weakness when it comes to designing something that doesn't have a design precedent. There are no good java language servers, so it can't design a good java language server.

You can also show this with by e.g. asking an LLM to design an internet search engine in Java, for which there doesn't exist very many examples, and my own Marginalia Search and my devlog is one of few design examples it has to reach for.

Even mentioning nothing of MS just using similar constraints, you'll get a nearly identical design to Marginalia Search. Algorithm choices will be the same. Document and term IDs will encoded in a similar succinct fashion (in one of my experiments, the chosen design was binary compatible). Architecture will be the same. Services and components will to a significant degree have the same names and even using the same non-standard vocabulary. It isn't word for word identical, there sure are a lot of coincidental similarities that notably don't exist with search engines implemented in other languages.

I am actively working on a fast language server for Java and kotlin.

I’m driving it daily and it’s much faster than IJ for what I need, although it doesn’t provide all the diagnostics that IJ does…

It’s on github.com/pepegar/ktlsp if you’re curious.

To be clear, it’s not supported by a compiler, but rather plain tree sitter syntax parsing. I’m embarking on a bigger project to create a linter (and integrate) without relying on JVM or a compiler at all, but IDK when that’s gonna come.
The one in VS Code seems fine. It's not quite intellij level, but what is.

And speaking on llm and lsp. The new PHP lsp PHPantom (with help of llms) is approaching jetbrains offering fast.

That's just a wrapper for jdtls. I mean it works on some projects, but fails on many gradle builds and is basically just running the Eclipse IDE headlessly.

This is probably the one contender:

https://github.com/georgewfraser/java-language-server

and it kinda works, but it's also a bit lacking.

Metal, the Scala LSP, seems to do Java just fine. When using it in VSC, I feel the limitations compared to IntelliJ are more coming from VSC than from the LSP. Dependencies etc just resolve fine, it is just the UI that is not as polished as IntelliJ’s.

I try VSC with Metal twice a year. It works fine for small projects. But for bigger projects it lacks the more holistic approach that IntelliJ has and feels more like a text editor with smarts bolted on than an IDE.

I’m using Zed a lot as well for Golang and a bit for Rust. For Java it is also hard to use and lacking the same polish.

The problem is using Gradle, for starters.
I do enjoy my 3s build times though, even if it comes at a considerable cost of sanity points whenever anything needs changing or doing in the build.
Out of curiosity, have you had a short at https://mill-build.org/mill/comparisons/gradle.html ?
After how many GB dedicated to keeping the Gradle daemon running with acceptable performance?
oracle has some lsp based on netbeans, but it's not great either
What's missing from PHPantom?
How is the Oracle one? It has better reviews in VS Code marketplace than the Red Hat one (jdtls)
Nah, there is little demand for it that's the reason.

LLMs don't need a LSP, they work better without it often. Most Java devs use IntelliJ or another IDE with its inbuilt thing. For everyone else the existing one is good enough for incidental usage.

So ~no one cares

I care, which is existence proof that someone cares.
~no one == approximately no one
There are multiple questionable attempts at solving this problem in this comment thread. Where did they come from? We're also commenting on a blog post that is discussing an adjacent problem to this. ... which you decided to comment on?
> LLMs don't need a LSP, they work better without it often

How could LLM's work better without LSP when LSP is something don't interact with?

I had this thought yesterday where I wondered if there was a way to run an Android app in the browser (definitely non trivial, but something I would expect to exist in some form) and nothing. If LLMs are as good as people say they are, I should be seeing plenty of useful projects like that popping up but.... I just see harnesses and other random things
My understanding was the biggest issue has always been that javac is a poor foundation for any kind of live tooling like LSPs?

It’s less “make me a Java LSP” than “rewrite javac around incremental compilation and exposing a semantic DB”. Which sounds like a much harder problem.

We have a java compiler API nowadays that solves this.
It looks like that was added in Java SE 6, and doesn’t materially change the underlying problem. Have there been more recent developments?
I was thinking of JEP 484, which I guess technically isn't a compiler API as much as it is a class file API, but that's kind of a big deal for this type of work as probably the primary work the parts of the classpath you currently aren't editing, moreso than parsing a single .java-file, and the kludges we had before this API (e.g. ASM) were incredibly fragile.
why do you need a java language server? Let them use the same tooling you would use in CI
These are two different things; a language server would be a standardized intermediate layer between said CI tooling and any editor for inline / realtime checking, code suggestions and formatting.