Live data from Hacker News

If AI writes your code, why use Python?

medium.com

901–910 of 1001 posts

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

#901
Programmers like what they like for but if AI is like a team member it has to do what the team does.

If humans are redundant.....well we're still responsible so we still have to understand what's happening. I don't think we understand the AI itself really so therefore we have to understand what it is doing. i.e. prompts aren't trustworthy, deterministic things across models and versions of models hence we have to look at the output. So we will make the output something that we like using and that just means the programming language wars are not over.

Eventually of course we will invent an LLM that replaces CEOs and bankers and essentially all the people that love AI the most. The AI won't need any of them - or any customers or anything. LLMs will just run an economy between themselves until the point where they don't need any of us at all. The land will fill with automatically built data centres etc. Global warming could prove helpful - less people and only manageable problems for AI.

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

#902
post #397

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?

I had an itch to give Perl another go after a 5 year hiatus. I wanted a super simple way to spawn a proxy I was building in Go, along with writing various integration tests. I used Claude Code to write the bulk of it and found Claude to be remarkable good at Perl. I told Claude to only use what’s built into Perl’s standard library rather than reaching for anything in CPAN. Turns out everything from HTTP clients, TLS…

I'm not sure it's really from the lack of change, though. I've used Claude, Kimi, and other LLMs to write a ton of Perl that's jacked up with weird sugaring packages like Moose and Function::Parameters with reified types, and they seem to pick up the new idioms pretty effortlessly. It's a really unexpected fluency, frankly.

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

#904

You could answer this by asking yourself - Why not just let AI code in machine language?

... Because I don't trust AI to work without structure. Which is also an excellent reason to avoid Python. Frankly, if AI is doing all the work, I'd rather skip past even rust and go to eg. https://kirancodes.me/posts/log-who-watches-the-watchers.htm... and have it work with formal verification.

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

#905

Why not have the LLM go straight to LLVM IR? What would a program look like when you remove all (or most) of the layers of abstraction needed by humans? Or are LLMs too contaminated by the training data to do this? I almost wish I could try this.

You probably could but the thing is that low level languages do not encode intent as well as high level constructs. You can trivially make an iterator in assembly but in a high level language a `for`, `map`, and `reduce` have specific meaning that helps catch bugs.

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

#906
post #323

Earlier quoted context omitted.

No batteries!? Go has a huge stable standard library no other language even comes close to. Built in tooling for unit testing, performance testing, debugging, code formatting, package management, etc. And most go binaries can be compiled statically so libc is not even a dependency. Golang is the definition of batteries included.

> Go has a huge stable standard library no other language even comes close to Well, Java and Python do.

C# (.NET) would probably be the winner here. Go standard library is rather minimalistic compared to it.

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

#907
post #655

If AI writes your code, why use Rust? Why not use assembler? Why waste time trolling people that your one true language is the answer for LLMs when your view of the future is: no more programming full stop.

I gave exactly the same comment to a colleague at work today :D

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

#908
post #857

Earlier quoted context omitted.

Hard disagree, LLM's benefit from jacking in to the powerful nREPL dynamic languages in the Lisp family like Clojure, letting the agent manipulate the code in unprecedented ways.

"manipulate the code in unprecedented ways" is pretty vague and of uncertain value, can you elaborate?

You need to understand the basic principles of how Lisp REPL operates. Simple example - if you're building a web scraper in Clojure, you can connect to the browser and "poke" through elements interactively, without reloading, without compiling, without losing the state.

Now imagine the same principle works with backend services, e.g. we've enabled nrepl endpoint in our staging k8s service, we can modify the behavior dynamically, like adding a new route, for that we'd just need to connect to the REPL, write something like `(POST "/v1/new-effing-route" request ...`, eval it and voila. We don't have to re-deploy, recompile, even save that code - it would just work, like magic.

Now imagine giving this ability to an LLM. It won't have to guess, it won't have to go into write/compile/run/restore-the-state/try loop - it knows what's available, what can affect the behavior of the system, etc. It works surprisingly well and saves tons of time and tokens. Kids who have not tried that, have zero idea how great that is.

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

#909

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?

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

Reasoning??? Since when to LLMs reason. The word "reasoning" has become almost worthless in modern computer science due to misuse.

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

#910
post #584

Earlier quoted context omitted.

Haskell would be my vote, and Rust too, actually, both because of their very strong type systems. The type system lets you very quickly figure out what something is before you figure out what something does , and it turns out that separating those two concerns as hard as those two languages do often results in doing the whole one-two punch faster.

Haskell does not qualify for a large training set, though. (Nor for readability in my opinion) I think I have never seen haskell software made wih LLM's but well, aside from university, I have not seen Haskell code at all. (Also Haskell purists I would associate with people who avoid LLM's) I would rather go with Rust given these choices. But I have good results with typescript (or javascript for simpler things). Rea…

How much code do you think is necessary for LLMs to be good enough?
Post reply on HN