logoalt Hacker News

onion2k • today at 4:46 PM • 1 reply • view on HN

Why?

A type hint says "only accept things that look like this" and a compiling or a type checker can statically analyse the code to make sure that's valid everywhere. If you don't have that then the LLM would need to track back through the call tree to the originating point that defines the shape of the thing being passed to understand if it's valid all the way through the app in order to know that the data is correct. As it can't know where the originating call starts, it needs context of everything. It might only read the code it needs to read, and that can be done easily with an agent driving a small model, but it still needs complete access to every part of the app in order to trace what it needs to. With type hints it can just run the type checker to validate the code is OK and then trust the type hints.


Replies

win311fwg • today at 5:03 PM

> If you don't have that

Why wouldn't you have that? It is looking more and more likely that you accidentally replied to the wrong thread.