Live data from Hacker News

If AI writes your code, why use Python?

medium.com

91–100 of 1001 posts

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

#91
post #86

Earlier quoted context omitted.

Absolutely. And in this same thread I am noticing people offering Java (lol). Yeah, we all need 1.5s startup time for one-off scripts, surely.

Well, these days a small CLI program in Java (say, ls) starts up cold, runs, and terminates in ~70ms, not 1500ms, but yeah, sometimes 70ms is too long to wait for a script.

People never believe me when I say it but I start noticing scripts needing 75-100ms to start. Modern hardware is ultra fast; I want my programs to make full use of it. I got no patience for tech or people who keep insisting "it's not much, it'll not kill you". Well duh, obviously it will not but that's not the point and never was. I want stuff to work between my blinking my eyes and I have achieved that hundreds of times over the course of my career.

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

#92
Devs still have to maintain this code, the Python devs can definitely get the LLM to write (some kind of) Rust, but when it goes wrong and you hit the wall with the LLM then they can will have to learn Rust which might take a while, this sounds like a bit of a project risk.

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

#93

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?

Training data can't be the whole answer. LLMs are really good at translating to different programming languages. This makes sense, given that they are derived from text translation systems. I'm getting great results in languages with comparatively small bodies of freely available code. The bigger hurdle is usually that LLMs tend to copy common idioms in the target language and if it is an "enterprise-y" language like Java or C#, the amount of useless boilerplate can skyrocket immediately, which creates a real danger that the result grows beyond the usable context window size and the quality suffers.

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

#94

Earlier quoted context omitted.

The JVM takes tens of milliseconds to boot up, not a second and a half.

Obviously it depends on a bunch of factors but -- not on my machines. They are all with Intel and AMD CPUs and I don't use M-series Macs. Never saw an instantly starting JVM in my life though.

Java runs a Hello World, cold, in a packaged JAR, in about 40ms. What you've seen isn't JVM startup but programs that do a lot at initialisation (like MS Word), as many Java programs like to do (because they often expect to run for a long time, so they don't care about startup time).

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

#95
post #86

Earlier quoted context omitted.

Well, these days a small CLI program in Java (say, ls) starts up cold, runs, and terminates in ~70ms, not 1500ms, but yeah, sometimes 70ms is too long to wait for a script.

People never believe me when I say it but I start noticing scripts needing 75-100ms to start. Modern hardware is ultra fast ; I want my programs to make full use of it. I got no patience for tech or people who keep insisting "it's not much, it'll not kill you". Well duh, obviously it will not but that's not the point and never was. I want stuff to work between my blinking my eyes and I have achieved that hundreds of…

That's perfectly fine, and I totally understand people who don't want to sit and wait 70ms for their script to finish running (that 70ms is not the time it takes to start), but let's not turn a <40ms startup into 1.5s. Now, it is true that if you want to launch a minimal HTTP server in Java you may need to wait ~100ms, which may be too long for you, but is also a far cry from 1.5s.

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

#96
I think it is an interesting question what kind of programming language one needs for an era of agents. It is clear that the programming language that was designed for humans is not necessarily the best for AI-driven software development. I guess the qualities one would want is some formal correctness guarantees, high performance. A question is whether this language is Rust or it is possible to design a better new language.

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

#97
post #21

You can of course use any language but here is my advice: you should use the language that you know best to make your life as uncomplicated as possible when you want to understand what the LLM was creating. Remember, you are the judge whether the code is OK and if you use assembler you might get really performant code, but can you trust it? Of course it might be a good incentive to learn rust or go. Or challenge your…

Previously in my life as an IC, I wrote a lot of Golang. I worked on the larger end to end encrypted video calling service.

I hated it. I was dreaming of Rust the entire time to release me from the hell of if err != nil dozens of time per day.

After hours with LLMs I've changed my tune. There have been 5 clients of mine (who have excellent engineering teams) but cannot get coherent results out of LLMs using python or Typescript.

I arrived back at Golang being a frustratingly simple, consistent, and low-thrash programming language which inadvertently made itself well represented in the training corpus [1].

My concession is that if you are going to write a median program (reading/writing files, network, db, etc.)...

Pick Golang especially if you've never used it. LLMs are extremely good at it, frustratingly so.

[1] https://jry.io/writing/use-boring-languages-with-llms/

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

#98
post #94

Earlier quoted context omitted.

Obviously it depends on a bunch of factors but -- not on my machines. They are all with Intel and AMD CPUs and I don't use M-series Macs. Never saw an instantly starting JVM in my life though.

Java runs a Hello World, cold, in a packaged JAR, in about 40ms. What you've seen isn't JVM startup but programs that do a lot at initialisation (like MS Word), as many Java programs like to do (because they often expect to run for a long time, so they don't care about startup time).

I have not worked with Java in a long time but I seem to remember that most Java programs also accrue a good amount of dependencies and some of them have their own init routines.

That adds up, fast. No idea how is it nowadays, admittedly. Maybe a ton of optimization work was done.

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

#99
post #85

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 wrote about the meta thesis of programming languages in the training data here https://jry.io/writing/use-boring-languages-with-llms/

Please distill instead of having me navigate off site. Include link for additional info.

edit: side -> site

Post reply on HN