Live data from Hacker News

If AI writes your code, why use Python?

medium.com

641–650 of 1001 posts

Re: If AI writes your code, why use Python?

#641

No reason, unless the project is simple. The more you can offload onto your compiler/typer - the shorter is the feedback loop, the better agents work. Lack of strictly enforced static typing make agents fail much sooner with Python. In my opinion, Rust and Scala are the best targets for agentic flows - and, coincidentally, they have the most advanced typers among mainstream languages. But any statically typed languag…

Rust is a fantastic language to emit from AI. Studies report that the language design tends to result in lower defect code (vs peers such as Go and Java) due to how the syntax aids error handling, logic flow, and API design. You don't need to know Rust to begin using it. You'll learn it quickly enough. The code is easy to read, and Serde makes parsing, especially JSON, extremely pleasant. Writing HTTP services is a b…

> AI makes Rust development go 10x faster. The borrow checker isn't even an issue. It's invisible now.

What happens when things break and the AI agent can't fix it?

Re: If AI writes your code, why use Python?

#642
The challenge is always to get things the way I want. Sometimes I need to explain it in code terms. Sometimes I even have to throw in the towel and write what I mean by hand, and I can't do that unless I'm very comfortable with the code the model writes.

Re: If AI writes your code, why use Python?

#643

No reason, unless the project is simple. The more you can offload onto your compiler/typer - the shorter is the feedback loop, the better agents work. Lack of strictly enforced static typing make agents fail much sooner with Python. In my opinion, Rust and Scala are the best targets for agentic flows - and, coincidentally, they have the most advanced typers among mainstream languages. But any statically typed languag…

Rust is a fantastic language to emit from AI. Studies report that the language design tends to result in lower defect code (vs peers such as Go and Java) due to how the syntax aids error handling, logic flow, and API design. You don't need to know Rust to begin using it. You'll learn it quickly enough. The code is easy to read, and Serde makes parsing, especially JSON, extremely pleasant. Writing HTTP services is a b…

What study?

And I don't see how Go design patterns would be any worse. The main issue people have with it is the repetition/verbosity, which LLMs handle just fine.

Re: If AI writes your code, why use Python?

#644

Earlier quoted context omitted.

Correct — and honestly? Not just correct, but perceptive. You didn't just read the post — you saw through it. That's not pattern matching — that's instinct.

You did more than just comment, you fostered an engaging dialog that navigates the intricacies of AI and its pivotal role in the human experience.

This is the real unlock.

Re: If AI writes your code, why use Python?

#645
post #641

Earlier quoted context omitted.

Rust is a fantastic language to emit from AI. Studies report that the language design tends to result in lower defect code (vs peers such as Go and Java) due to how the syntax aids error handling, logic flow, and API design. You don't need to know Rust to begin using it. You'll learn it quickly enough. The code is easy to read, and Serde makes parsing, especially JSON, extremely pleasant. Writing HTTP services is a b…

> AI makes Rust development go 10x faster. The borrow checker isn't even an issue. It's invisible now. What happens when things break and the AI agent can't fix it?

That would be bad, which is why Rust is preferred to python. In Rust when things break the AI gets a clear error message that makes it clear how to fix. In Python when things break, the AI will randomly spin its wheels for days trying different things without being able root cause the issue.

A failure to compile is by far the easiest thing for the AI to fix.

Re: If AI writes your code, why use Python?

#646
post #641

Earlier quoted context omitted.

Rust is a fantastic language to emit from AI. Studies report that the language design tends to result in lower defect code (vs peers such as Go and Java) due to how the syntax aids error handling, logic flow, and API design. You don't need to know Rust to begin using it. You'll learn it quickly enough. The code is easy to read, and Serde makes parsing, especially JSON, extremely pleasant. Writing HTTP services is a b…

> AI makes Rust development go 10x faster. The borrow checker isn't even an issue. It's invisible now. What happens when things break and the AI agent can't fix it?

You'll learn Rust faster with AI and should be able to solve it yourself.

You're unlikely to wind up in such a situation though. The design work Claude does in Rust is really sensible and idiomatic, and I really don't think you'll be unable to refactor or redesign things. Claude is extremely good with Rust generation, refactoring, and manipulation.

I'll go as far as to say that AI has removed most of the complaints people had with learning or using Rust. It's not even a speed bump now.

Re: If AI writes your code, why use Python?

#647

Really controversial but my honest opinion: That's because programming languages, and its natural language counterpart, too, are nowadays increasing and more likely in becoming a political tool, rather than itself being a tech tool. I observed this through observation of the attacks to Rust due to the huge presence of LGBT people. Now while I'm pretty much straight myself, I don't reject LGBT people and don't want to…

Most of the attacks on Rust, I have seen, have nothing in common what people are implementing Rust.

It has a lot in common with the fact Rust is very low level language, a direct C++ competitor, and many people use it for apps that could be easily implemented in much higher languages and run fast enough.

A driver or kernel extension in Rust? No problem. A todolist SaaS startup with no users? It's better to use Rails, Django, or Laravel for that.

Re: If AI writes your code, why use Python?

#649

No reason, unless the project is simple. The more you can offload onto your compiler/typer - the shorter is the feedback loop, the better agents work. Lack of strictly enforced static typing make agents fail much sooner with Python. In my opinion, Rust and Scala are the best targets for agentic flows - and, coincidentally, they have the most advanced typers among mainstream languages. But any statically typed languag…

What if you want to offload a lot of the work to libraries rather than generating (and presumably reviewing?) it yourself? Python has a very strong ecosystem of useful libraries because it's been around so long and is popular in a number of application domains.

Re: If AI writes your code, why use Python?

#650

Earlier quoted context omitted.

hmm, yeah given LLM's ability to churn out lots of code quickly and be overly verbose in that code that is a potential downside. That it could in a quick one time edit create so much intellectual overhead that Python might be the wrong language to understand what is going on. What language do you feel is easier to reason about in the large?

I'd say Java, because it has a massive footprint amenable for training, and a strong type system (does not have sum types though and those are trendy). You'd have to steer the LLM to use the style you want, and not massively overarchitect things though, but that's going to be an issue nonetheless.

Java has sum types - they are fairly recent, called sealed records, and can be exhaustively pattern matched on.

(I do agree however, Java is a great target for LLMs)

Post reply on HN