logoalt Hacker News

dakiolyesterday at 9:27 PM8 repliesview on HN

Problem with Python and other non-strict typed languages is that if you let an LLM to write some stuff, you cannot truly be confident that nothing has broken. Even if your tests all pass. The LLM could have broken some path that only gets run in production in a very specific case. At least with strongly-typed languages you get a compiler error. In big codebases is non-negotiable


Replies

mjr00today at 12:30 AM

Python has had type hinting for quite a while, and adding validation with mypy/pyright/ty as a step in CLAUDE.md (as well as having it as part of your CI pipeline) can emulate static type checking pretty well.

show 1 reply
bee_ridertoday at 12:32 AM

Dynamically typed languages just add one more type of bug that can’t be caught at compile time. That’s not helpful, sure, but it’s one type of bug among many.

The issue you mention, execution paths not hit by test cases, is made worse by having more complicated code. Duck-typing can help reduce the number of paths.

Static vs dynamic… I don’t see an obvious winner here.

ttfleetoday at 2:12 AM

Perhaps we could do it in Python in the first pass for validation purpose. And then vibe rewrite it in Haskell.

fyredgetoday at 12:33 AM

My take is that I can never be confident that anything an LLM produce will not be broken. Since I will have to check everything it produces anyways, why not write it in a human friendly language, i.e. python? C and rust may have better strictness, but the amount of boiler code to set up that system takes up a lot of mental space that could be better used to architect the problem at hand.

serfyesterday at 9:30 PM

so it just boils down to strictness even when we're talking LLMs?

I agree with you about fast failure being a nice feature , but I also think that if you're TDDing a bunch of stuff and it fails in some categorical way , well then the test suite was lazy.

show 2 replies
faangguyindiatoday at 1:06 AM

This is why you should use Haskell.

show 1 reply
__mharrison__yesterday at 9:36 PM

My anecdotal (sample size 1) experience is not consistent with this. I code fast. Refactor fast. My stuff doesn't break. But my methodology isn't the same as other's.

QuadmasterXLIIyesterday at 9:29 PM

i have bad news

show 1 reply