Live data from Hacker News

If AI writes your code, why use Python?

medium.com

431–440 of 1001 posts

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

#431

Earlier quoted context omitted.

I would love to see how they do with functional languages and especially Lisps here. I've noticed pretty good performance with Emacs Lisp relative to overall model strength, but I haven't used LLMs to application code in any such languages. It would also be interesting to see how Python compares to other languages in its niche (Ruby, Perl, Raku). Thanks for putting this together! It's interesting.

That's a good idea. Would you rather see Lisp or Scala? Any interest in Prolog? We are trying to be selective to keep the data concentrated, but we will eventually add a couple more, most likely to sample different programming paradigms.

If you are taking request, I was hoping to see clojure on there.

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

#432
post #399
post #301

Earlier quoted context omitted.

The LLMs are generally still pretty bad at (deductive) reasoning. IME they go along more with the things like variable names and comments than the actual program logic (it would be an interesting experiment to compare LLM's understanding of three identical programs with different identifiers, one with normal identifiers, one with obfuscated identifiers, and one with deliberately misleading identifiers). I also think…

wait till you look inside a neural network and realize they're incapable of deductive reasoning! amazing how many devs that talk about "AI" would probably have a hard time telling apart deductive and inductive reasoning.

That's actually untrue. Yes, training a neural network is mostly inductive reasoning process. However, the ability of LLMs to reason deductively (as a chain of thought, although it's probably not the only mechanism) is an emergent phenomenon, rising up from the training it on data and problems that exhibit deductive reasoning.

But of course, because the deductive reasoning is inductively taught, there might be various shortcuts which compromise the soundness of deductive reasoning. That's why my claim - LLMs are not as good at it as other algorithms, although they have many other strengths that make up for it.

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

#433
Not just for LLMs, but in general if code is produced automatically by a tool and isn't going to be a hundred percent proofread and tested by humans who could have written it manually, it's always better to use the safest possible language so that the compiler can catch most of the errors. So yeah, Rust or OCaml are good candidates. Performance is also a good point but it's a secondary issue in my opinion.

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

#434

Why Python? Because I have written it for 10+ years, know how to debug it and I can smell it within 10 seconds of the agent writing code if it does something that is going to end in a huge foot gun. With any other language, not so much; I would need to relearn a lot. So I am going to be preferring python; where even with the speed that AI crams out code, I still feel somewhat in control. If I did this with Go or Rust…

Exactly that. Plus I need to be able to make adjustments here and there without the whole thing collapsing on me.

If you know Rust inside and out (if, as one example in TFA, you co-wrote The Rust Programming Language!) then sure, why not Rust?

But if not, it would be unwise.

That said, I use AI to write small C utilities that compile and run on any Windows version starting with Vista (which neither Go nor Rust can do). Yet I'm not a C programmer; but I can read and adjust it when needed, and the whole thing does work.

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

#435
post #319

Earlier quoted context omitted.

Yeah C# is fantastic. I also love EF. I stopped using it because overall it feels like Microsoft has lost the plot with .NET.

What I hate about .NET is the atrocious naming. Net Core, Net Framework, Net Common Core, .NET.. And God forbid any of these frameworks ever expose what they are in a config file. You start a project, hand it to a colleague and he can't figure out whether it's Framework or Core by looking at the files. You Google and are immediately bombarded by 15 year old threads.

If you start a project with .NET Framework in 2026, you're doing it wrong, plain and simple.

And the .csproj files do tell you which .NET they are.

v4. or net4 is the old framework. Also, if the file is an unreadable mess listing all .cs files, it's generally .NET Framework.

netstandard2.0 is .NET Standard 2.0, which means this library can be consumed from either Framework or modern .NET.

And finally, netX.0 (X >= 5) is the modern .NET.

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

#436
post #235

Earlier quoted context omitted.

Hah, I was just thinking that Python likely has a vast ocean of training data, but it's likely of lower quality, being much of it is written by beginners and those who aren't primarily programmers.

There's a broken idea that AI know Python because they're written in Python. Not how any of it works.

Not what anyone was talking about. Training corpus ≠ inference engine.

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

#437

Earlier quoted context omitted.

I’m super surprised that C++ scores so high, this does not match our experience at all, and for anything performance critical it always drops the ball completely. I also don’t understand how these “games” map to real world complex problems. How are you measuring success? How does “adversarial customer service” map to “this LLM is better at C++ than the other” ? How are you sure you’re not just benchmarking language s…

- The majority of the environments can be played where the agent writes code to work the environment towards a goal. So the model is problem solving, and it has to do so in a particular language, and some languages outperform others. We have a lot of data to back up the improved compiled language performance, but note these are for successful code submissions (failures are counted in a different metric). With the Lan…

I've found the current cream of the crop to be quite good at resource management. I've sic'd Opus on some very gnarly lambda context bugs and it has directly improved the stability of the product I'm working on right now in a very substantial way. It couldn't quite do it entirely by itself, but with the right nudges here and there, it has absolutely accellerated the debugging work. It is particularly good at analyzing crashes and piecing together the detective work of what preconditions must exist for certain crashes to occur.

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

#438
post #420

Earlier quoted context omitted.

Surprisingly, LLMs are actually much worse at reasoning in Python than other common programming languages for agentic coding tasks. Data here: https://gertlabs.com/rankings?mode=agentic_coding

My feeling is that for agentic tasks this is not only language design but also LSPs, error messages and static analysis capabilities that dominate the benchmarks. It would IMHO be interesting to look into better subsets of python and style/rewrite techniques as well as alternative linter and their effects on performance.

A strict compiler is basically a free feedback loop for the LLM.

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

#439

Read the first few comments and surprised I didn’t see it, but training data. The voluminous amount of Python in the training data. I could write in brainfuck with ai, but I presume, wouldn’t get the same results than if going with python. My follow up question: with AI now, why care about a lang until you need to?

1) the models do generalise so concepts translate 2) languages with more opinionated semantics and a better, more coherent community seem to be better. Python is a broad shitshow with multiple ways to achieve the same thing. Elixir is tight and focused. Claude is much better at elixir.
Post reply on HN