Top
Best
New

Posted by indigodaddy 16 hours ago

If AI writes your code, why use Python?(medium.com)
571 points | 610 commentspage 3
rundigen12 2 hours ago|
And why use readable variable names? "aA=q_(c8z,fW8)"

Seriously though, almost all the examples in TFA are of rewriting existing code. It may be that Python is still best for the rapid dev iteration. Then sure, cross-compile into Rust via the LLM.

Plus, If we care about token usage counts, Python has a lot more opportunities for compact "import thing_I_need" than having to generate entire libraries in Rust.

librasteve 14 hours ago||
Many here propose replacing Python with more performant, but less familiar languages - mostly Rust, Go. But I find the argument that the AI - HUMAN interface is the most important. A simple version of this is “no, stick with Python if that’s what you know”. A more interesting version is “use this new found AI leeway to move up the abstraction level”, “try something more expressive and human oriented”, “make a DSL and parser that suits the domain (and focuses the AI)”. Despite being a minority language, Raku is ideal for these aspects (esp with built in Grammars and general kitchen sink repartee) and works surprisingly well with most popular LLMs.
hirvi74 10 hours ago||
I honestly think Mojo is the dark horse in this race. That is assuming all the roadmap goals are fulfilled. We're talking about C++-like performance, Python syntax, complete compatibility with Python, designed from the start to interface with AI, compile-time metaprogramming like Zig, and all kinds of other goodies.

So yes, people can bless Go and Rust all they want. Nothing is wrong with the languages, but I agree that learning them for the sake of AI usage is probably not the best idea if one is competent in a language already.

Disclosure: Lattner is one of my programming heroes, so I might be biased.

zephen 9 hours ago||
I really wanted to like Mojo, but the more I read about it, the more it really wasn't Python even though, starting out, that was a major claim to fame.

There is an excellent chance it will be awesome stuff. But they did themselves a huge disservice with the initial claim about trying to be Python compatible.

qotgalaxy 12 hours ago||
[dead]
kekpek 1 hour ago||
I also try to use Ruby because it's much more readable than anything else. And yes, still need to review and understand what code AI generated there
alkonaut 2 hours ago||
Agreed. Even if Python or JS was the language I knew well, even if the platform ecosystem is the one I need, I'd _still_ make very sure to use at least strong types (even if not static) for anything an AI co-creates and is maintained longer term.

Rust isn't perfect due to rather long turnaround for compile/test iterations, but a lot of those can be avoided if the type checking is quicker than compilation. Rust is also more verbose than python and other very high level languages, which means your token budget is eaten more quickly as it works on a lower level.

deng 7 hours ago||
> Nicholas Carlini, a researcher at Anthropic, orchestrated 16 parallel Claude agents to write a production C compiler in Rust.

No he didn't. The compiler is bascially useless as it produces vastly inferior code than gcc/clang.

benced 5 hours ago||
The lumping together of Typescript with Python is a mistake. Typescript is much faster (mostly due to engine investment), is much saner, has more expressive types, and generally has better ergonomics for the backend than Python.
dsiegel2275 1 hour 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.
beshrkayali 6 hours ago||
For now it’s the exact same reason why you’d use Python when you’re writing by hand: so the code is more easily readable/editable by humans who are more likely to know Python than something like Zig. But I understand the point the post is trying to make, I don’t think we’re there yet.
stringfood 6 hours ago|
The world where automation writes in a language no human understands reminds me of the completely pitch black Chinese automation factories, where humans are lost and confused but robots at home
beshrkayali 6 hours ago||
Everyone is trying to figure out how and what are the optimal use cases. It could be like you said but it doesn’t have to be. There’s a lot of incentive for it not to end up like that.
redbell 4 hours ago||
> Andreas Kling, creator of the Ladybird browser and a career C++ engineer, ported Ladybird’s JavaScript engine from C++ to Rust in two weeks

Discussed here with 698 comments (https://news.ycombinator.com/item?id=47120899)

b800h 6 hours ago|
If you're working with an agent to write code, you want it in the most quickly-readable format possible. That's generally Python, although YMMV. I want to be able to skim and zoom in on parts of code that might need attention. This makes it easy.

If the code were written in Java, I'd have more to read. If it were in JavaScript, I'd be slower following the calls (although the type system might catch issues more quickly - not a problem in my experience). I think Python is a good choice.

munksbeer 5 hours ago|
> If the code were written in Java, I'd have more to read.

That is not really the downside people think it is. Java is a remarkably easy language to read and understand.

More comments...