Top
Best
New

Posted by indigodaddy 21 hours ago

If AI writes your code, why use Python?(medium.com)
755 points | 787 commentspage 8
tom_ 16 hours ago|
Well don't ask us. If AI writes your code, why not ask it? You could probably make it write a whole article for ya.
tabbott 13 hours ago||
I think the author misunderstands what is good about Python.

One of the big strengths of Python is legibility: most developers find it easy to read and understand.

If you are planning to have humans verify the code you're using in production, to confirm it implements your intent, the readability of the code you are producing is important.

Performance is valuable, but for a lot of code, performance is less important than correctness and ease of verifying it.

If you are imagining your codebase being one where nobody but Claude reads the code, you might as well do Rust for the better performance. But I don't think a lot of organizations are doing that.

jdw64 14 hours ago||
To put it simply, Python feels recoverable when something goes wrong, but Rust often feels like solving a compiler puzzle. Honestly, I still do not really know how to handle lifetimes properly.

When I use AI to help with coding, there is almost always a point where it gets stuck and I have to solve the problem myself. If I were using Rust at that point, it would be much more painful.

I know Rust has a very strong reputation in the community, but to be honest, I find it a difficult and frustrating language to work with. I would use it when I truly need systems-level performance, but for most high-level work I would rather use Python, because I can move much faster. In most projects, that level of raw performance is not actually necessary.

blululu 11 hours ago||
I'm sure there are plenty of caveats and breaking points, but if we do adhere to the claim that an LLM coding tool is a nondeterministic sort of compiler then it really does make sense to pick the most performant language available. Obviously there are caveats of libraries and native advantages of various languages. I've been doing stuff in C++ for the past month or so and the only slow down from the language choice is compilation time.
winrid 16 hours ago||
Claude writes java pretty well, and faster than Rust. It's a great middle ground for some projects. I've switched back from Rust to Java for some things.

I don't know why you would use Python at all except for small iterative projects. If you hate java for some reason, there's Go...

jeremyjh 15 hours ago|
It certainly makes sense to use python for ML or data science.
winrid 14 hours ago||
Right sorry, that's not in my wheelhouse so I didn't think of that. I should be more specific. For general backend / data processing/pipeline stuff, API servers ...
shibaprasadb 7 hours ago||
Python is the 2nd/3rd best language for almost everything. So I guess it helps.
headcanon 17 hours ago||
As others have said, the main benefit with Python over Rust is library support especially with ML features. The other gap as I see it with Rust is the lack of native flexible UI support. The nice thing about Rust though is it can serve as a very fast and stable core for an app and offload specifics to TS and Python as their strengths allow, so you get the best of all worlds.

My current goto for desktop apps is Tauri, which give us a rust backend and TS fronted (usually React). Local ML features can be easily loaded as a python sidecar. Production bundling can be a little challenging but it seems to work well so far.

Sidenote: Golang is also an amazing language for LLM use, I generally do most of my "infra" stuff in Golang over Rust, but either work fine most of the time.

locusofself 12 hours ago||
Most of the article makese sense but what is this supposed to mean? "Native Rust binaries are hostile to serverless runtimes" . I don't think that is true.
nallerooth 3 hours ago|
It feels like a really strange thing to say. I've deployed Rust binaries to both Lambda and Fargate in AWS and they've been very performant.
dsiegel2275 6 hours ago|
10-100x faster? Maybe for strictly IO bound applications - but if you are building a web app you won't see that performance as network latency dominates.
More comments...