If AI writes your code, why use Python?
991–1000 of 1001 posts
Re: If AI writes your code, why use Python?
#992Earlier quoted context omitted.
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…
You explained the magic behind this better than I ever could. But hey, I'm one of the nuschool kids on this, and we want this great language to breach escape velocity too!
The irony is that Lisp looks cryptic to newcomers precisely because there's almost zero syntactic sugar hiding the structure. Once you adjust, you realize the "weird syntax" is actually the absence of magic - it's the parse tree, exposed directly. Alas, people prefer sugar flavored lies instead of "inconvenient" truth. I was pretty much the same - wasted years of my life, circling around shit that was all about "magic". At some point, your mind just can't take it anymore - it wants "plain & stupid". Because when shit just works - it doesn't feel that stupid anymore.
Re: If AI writes your code, why use Python?
#993Earlier quoted context omitted.
If you are taking request, I was hoping to see clojure on there.
My spider sense tells me the immutable-ness would help with correctness, but I'm not sure how much difference it would make in practice. Would love to see some numbers. A relative lack of training data might have a bigger effect though.
Nope. Not with Lisps. I've been using LLMs with Clojure/Clojurescript, Elisp and Fennel - for my personal stuff. And Python, Java, JS/TS, Go for work. LLMs are surprisingly good with Lisps, perhaps precisely because there's less fragmentation. There is so much variability with say Python for a given task, because the training set is enormous. But how many ways there exist to do the same thing in Clojure? Python/Java/TS's enormous training set is almost a liability for quality - the model has seen every beginner tutorial, every legacy pattern, every conflicting style guide. With Clojure it's more like the model learned from a curated corpus by default. Lisps have nearly zero syntactic noise - the AST is the source. This means an LLM doesn't need to learn parsing heuristics; structure is always explicit. That likely makes correct generation easier even with less data.
Re: If AI writes your code, why use Python?
#994Earlier 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.
I've noticed that with clojure(script) unless you specifically instruct them to keep nesting levels low, they can hit a point where they make a paren placement error and can't debug their way out of it. Although in my case while one model made the error then couldn't find what it had done, a second model that I switched to was then able to identify it and back it out. So I suspect this is a transient weakness in toda…
Whoa, it seems you're using LLM to generate Clojure code like you'd do it with any other "static" PL. Give it a live REPL - it works wondrously.
Re: If AI writes your code, why use Python?
#995Earlier quoted context omitted.
I picked Go because it tends to use fewer resources than Node.js, and startup time is quite fast.
I've never used Node, so I can't judge it. I'm still stuck in the C# world. So, I am curious how Go performs in comparison. I'll need to do some research. Though, it was a slap in the face for a lot of C#-ers when Go beat out C# for the Typescript compiler rewrite. I personally do not mind because C# is my Enterprise language, but it's not my favorite language or anything.
The GitHub listener written in Go has a CPU limit of 50m, but actual usage of 10m. Memory consumption is around 34MB of a 64MB limit.
The Linear listener written in Typescript consumes around 20m/250m CPU, but 235MB/500MB memory.
The 2x CPU and 9-10x memory consumption is significant, especially as we scale usage or add services.
(Yes, I know we need to do more right-sizing.)
Re: If AI writes your code, why use Python?
#996Earlier quoted context omitted.
> Go has a huge stable standard library no other language even comes close to Well, Java and Python do.
Python has a quite random collection of stuff, and it's often quite low quality and people don't use it anyway. I wouldn't say it is close to Go. I haven't used Java for a decade or so but as I recall its standard library was pretty bare bones (similar to Rust). Apparently C# has a pretty comprehensive standard library but I've never used it.
Even a decade ago (and more) the collections library in the Java standard lib was second to none. It's standard lib only got better since then (e.g. `HttpClient`).
Re: If AI writes your code, why use Python?
#997Earlier quoted context omitted.
Ironically it also created a ton of really badly written Python in the process.
Commercially, almost all Python is fairly badly written, with types either not documented or not passing with any consistency even when documented. It is the default state of Python. I blame Python for it because it could have made type definition and conformance a default, but it didn't.
Re: If AI writes your code, why use Python?
#998Earlier quoted context omitted.
his comment is that any self respecting article ought to have been written by AI, and if so it should have been written in Lojban. > It's strange to me that this blog post was written in English. If AI is available, why aren't we all communicating in Lojban? your comment seems to have not gotten his joke which was a recursion on English of the point of the article vis a vis Python
I understood his joke just fine. I just disagree, because I think he missed that it was AI-written in a way which is actually already implementing his suggestion of 'lowering' the original high-level human input into a more rigid, formalized schematic, easily-parsed language, which I call "AInglish", and which we increasingly are all communicating in, as exemplified by OP, due to the fact that many people find it sup…
Re: If AI writes your code, why use Python?
#999Earlier quoted context omitted.
Python has type annotations now [1] that type checkers, IDEs, etc. can use. [1] https://docs.python.org/3/library/typing.htmlhttps://docs.py...
Yes, but: a) they're a second class citizen, not guaranteed to be used in whatever niche of the python ecosystem you find yourself in and there's already an n+1 problem with multiple type checker written by third parties, rather than having 1st class language support tool that's consistent. You're not going to get it by default, you're usually going to have to do some configuration (and maybe bike shedding) to get it…
The winning architectural approach: enforcement at the borders, but flexibility within. The agent uses Pydantic for validating FastAPI schemas and models for the database—those are the contracts that need validation. The internal logic the agent produces is subject to line-by-line analysis, rather than being inferred from type propagation.
That's the right way to do things. It isn't some sort of a compromise. There is a clear boundary between validated "external input" and internal logic. And you aren't counting on type inference to propagate across the codebase. You catch errors at the border, where they come into or out of your codebase.
Your criticism of the type system in Python is spot on. The problem is that it is an add-on. It isn't consistent. And a language developed from the ground up for type annotations will do a far better job. However, this isn't the general case for agent-generated codebases.
Re: If AI writes your code, why use Python?
#1000Earlier quoted context omitted.
Reaaaally? I think a lot of the readability of python is in the fact you don't need to be recently familiar with it to pick up what its doing most of the time. Over my career I've dipped in and out of rust, typescript, perl, swift, etc codebases. I'm no expert in any of these, but every single time I have to look something up to understand what this set of arcane symbols or syntax means. When I dip into Python I just…
I dunno, as someone who doesn't program in Python, I find dunders to be very confusing. Like, how is this readable? _foo foo_ __foo _Foo__bar __foo__ foo__bar All of that is valid Python, and some of those forms mean different things depending on where they are used.
But I'd still argue the average Python codebase tends to be pretty legible and simple to read.