One obvious reason is Python's extreme readability, it has often been described as being as close to executable pseudo-code as one can get. If you're using an LLM to write code I think the rules would be 1. Use a language you know really well so you can read it easily, and add to it as needed. 2. Use a language that has a large training set so the LLM can be most efficient. 3. Use a language that is easy to read. If…
> One obvious reason is Python's extreme readability, it has often been described as being as close to executable pseudo-code as one can get. But it's LLMs that read it not humans. At least that's the trend > Use a language that has a large training set so the LLM can be most efficient. It's pretty efficient with Rust.
If AI writes your code, why use Python?
531–540 of 1001 posts
Re: If AI writes your code, why use Python?
#532Re: If AI writes your code, why use Python?
#533Earlier quoted context omitted.
I never really understood what exactly is so readable about python. I've been developing in Python for 8 years now, and before that I was a C# developer, and I don't find Python to be that more readable. Sure there's less ceremony, and yes, you can have your project going with just a single file, but other than that...?
The "other than that" is whitespace, not brackets. Whether that's a big deal is up to you, but the carry on effect of that is that the code is indented the way the control flow interprets it, so there are no bugs from misplaced braces. (Plenty of other bugs for other reasons, unfortunately.)
And today with autofotnatters I think only Python is still vulnerable.
Re: If AI writes your code, why use Python?
#534One obvious reason is Python's extreme readability, it has often been described as being as close to executable pseudo-code as one can get. If you're using an LLM to write code I think the rules would be 1. Use a language you know really well so you can read it easily, and add to it as needed. 2. Use a language that has a large training set so the LLM can be most efficient. 3. Use a language that is easy to read. If…
I never really understood what exactly is so readable about python. I've been developing in Python for 8 years now, and before that I was a C# developer, and I don't find Python to be that more readable. Sure there's less ceremony, and yes, you can have your project going with just a single file, but other than that...?
Re: If AI writes your code, why use Python?
#535Discussed here with 698 comments (https://news.ycombinator.com/item?id=47120899)
Re: If AI writes your code, why use Python?
#536Earlier quoted context omitted.
The "other than that" is whitespace, not brackets. Whether that's a big deal is up to you, but the carry on effect of that is that the code is indented the way the control flow interprets it, so there are no bugs from misplaced braces. (Plenty of other bugs for other reasons, unfortunately.)
Python and C are the only language in which I have experienced that class of bugs. And that is due to if statements without brackets in C and because Python has meaningful indentation which people have accidentally messed up when refactoring. And today with autofotnatters I think only Python is still vulnerable.
Re: If AI writes your code, why use Python?
#537One obvious reason is Python's extreme readability, it has often been described as being as close to executable pseudo-code as one can get. If you're using an LLM to write code I think the rules would be 1. Use a language you know really well so you can read it easily, and add to it as needed. 2. Use a language that has a large training set so the LLM can be most efficient. 3. Use a language that is easy to read. If…
Python is locally readable. Reasoning about larger systems in Python is where things get really hard, because you have to describe how many small individually readable things interact with each other in a very limited vocabulary.
Do you have any recommendations for systems where reasoning about large systems is easier than in python?
Re: If AI writes your code, why use Python?
#538Re: If AI writes your code, why use Python?
#539Earlier quoted context omitted.
The "other than that" is whitespace, not brackets. Whether that's a big deal is up to you, but the carry on effect of that is that the code is indented the way the control flow interprets it, so there are no bugs from misplaced braces. (Plenty of other bugs for other reasons, unfortunately.)
I find brackets help me understand structure from a distance much better than whitespace. Misplaced brackets seem like a thing from the past to me when we didn't have IDEs. I don't remember ever having a bug due to that.
I can't imagine how. Whitespace physically lays out the block structure on the screen; braces expect you to count and balance matching symbols, and possibly scan for them within other line noise.
Re: If AI writes your code, why use Python?
#540Earlier quoted context omitted.
and yet dynamically typed elixir wipes the floor with go. https://github.com/Tencent-Hunyuan/AutoCodeBenchmark/blob/ma...
LLMs get ridiculous with elixir, especially with the repl, runtime, and ability to hot reload / directly test functions. It's really surprising to me it hasn't caught on more but I guess you have to see it to believe it.
In my opinion, the only thing holding elixir back as an llm deliverable is that there's not as much training data for llms to work with.
Of course if we had a new AI that could be trained on a minimum of existing training data, common lisp would absolutely beat out everything else. everything you mentioned about elixir (repl, runtime, and ability to hot reload / directly test functions) are possible and were invented in lisp with an AST instead of a syntactic language as the ultimate build artifact. CL lets you recover from exceptions and rewind the stack before reloading your fixes and continuing. I can't even fathom the workloads an LLM could conceive of working with that.