News for hackers. Stuff that matters.
Re:If AI writes your code, why use Python? by regularfry on Tuesday May 12, 2026 @04:50AM (#48105811)
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 today's models, not something fundamental.
Re:If AI writes your code, why use Python? by forlorn_mammoth on Tuesday May 12, 2026 @09:48AM (#48108267)
That's because you are holding it wrong. Just replace the ( with rs, like in strawberry.
Re:If AI writes your code, why use Python? by isityettime on Tuesday May 12, 2026 @10:49AM (#48109137)
It's a bit of a pitiful way to fail. I wonder if diffusion models could handle parenthesis matching better. And I wonder if you could rig up tools for structural editing, like with paredit.
Re:If AI writes your code, why use Python? by regularfry on Tuesday May 12, 2026 @01:10PM (#48111157)
It's one of the drawbacks of having quite so little syntax. There's just less to grab hold of.
Re:If AI writes your code, why use Python? by chamomeal on Tuesday May 12, 2026 @06:17PM (#48115340)
I don’t know, I think it might be fundamental. They think in tokens, and )))))))) might look equivalent to ))))))). Just like the strawberry problem.

The calva backseat driver extension even includes a specific paren balancer for this reason, and it works quite well

Re:If AI writes your code, why use Python? by regularfry on Wednesday May 13, 2026 @05:17AM (#48119604)
It's fundamental in that it's harder because there's less information per token. But we know it's not impossible because they can get nesting right at all, it's just a question of where the boundary is today. And if different models have different crapping-out points, then there's a gradient there and future models can do better.

In token terms it's more like the fingers problem than the strawberry problem. ")" is a single token, but the model gets confused by several repeats of the same thing.

Re:If AI writes your code, why use Python? by iLemming on Wednesday May 13, 2026 @02:20PM (#48125503)
> can't debug their way out of it

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.