logoalt Hacker News

sampsonjlast Sunday at 9:08 PM2 repliesview on HN

The LLM approach is simpler and more flexible since it works with every library and language out of the box.

Looking up official documentation would require shipping sophisticated parsers for each language, plus a way to map tokens to their corresponding docs. I'd also need to maintain those mappings as libraries evolve and documentation moves. Some ecosystems make this easier (Rust with docs.rs), but others would be much harder (AWS documentation, for example).

I also want explanations visible directly in hover hints rather than linking out to external docs. So even with official documentation, I'd need to extract and present the relevant content anyway.

Beyond that, the LLM approach adapts to context in ways static docs can't. It generates explanations for code within the documentation you're reading, and it works on code that doesn't compile, like snippets with stubs or incomplete examples.

It could be interesting in the future to look into doing some type of hybrid approach where an LLM goes out and searches up the documentation, that way it's a little bit more flexible. But that would also be a bit slower and more costly.


Replies

ramon156last Sunday at 10:47 PM

> Looking up official documentation would require shipping sophisticated parsers for each language,

You could just token match (use tree-sitter or something similar) and fetch the official docs. Keep it dead-simple so there's no way you can provide false positives (unlike what's happening rn where hallucinations will creep in).

> It generates explanation

Again, I don't want that. It's not a feature, it's a limitation that right now gives you fake information.

nativeitlast Sunday at 9:16 PM

> The LLM approach is simpler

For whom? The whole reason I want to consult docs is to get the official documentation on a given topic. How could I trust anything it says, and what’s to say any earned trust is durable over time?

show 1 reply