The static vs dynamic language debate is decisively over and static has won. I called this out back in 2023, and I've only become more convinced since then. Statically typed languages are easier for the reader because you can see the types and quickly jump to their definitions (or even just hover over them in some IDEs). They're easier for the AI because they provide natural guardrails and feedback to guide it, as we…
If AI writes your code, why use Python?
831–840 of 1001 posts
Re: If AI writes your code, why use Python?
#832The static vs dynamic language debate is decisively over and static has won. I called this out back in 2023, and I've only become more convinced since then. Statically typed languages are easier for the reader because you can see the types and quickly jump to their definitions (or even just hover over them in some IDEs). They're easier for the AI because they provide natural guardrails and feedback to guide it, as we…
If static has won, why are dynamic languages more popular now (even since 2023). Comically, I’ve witnessed people say this since the 90s. For me, I don’t care about static because dynamic is easier. For the very few conditions where it matters, I’ll use static. Otherwise I like the simplicity of dynamic languages, especially python. IDEs provide support and jump to definitions in dynamic languages, too.
Re: If AI writes your code, why use Python?
#833The static vs dynamic language debate is decisively over and static has won. I called this out back in 2023, and I've only become more convinced since then. Statically typed languages are easier for the reader because you can see the types and quickly jump to their definitions (or even just hover over them in some IDEs). They're easier for the AI because they provide natural guardrails and feedback to guide it, as we…
Strong typing has clearly won. However, verbose typing is likely a negative for LLMs. Algorithms written in "pseudo-code", aka a higher level language without type information, are far more readable to a human, and thus likely an LLM too. In regards to control flow and general concept of what code is doing, types provide very little info over well named variables. In fact they often impair understanding by breaking u…
Types guarantee invariants at compile time, adding type info to a variable name is just a prayer that the next human or robot will enforce the invariants with respect to that type when it matters. This is like saying you don't need a saw stop because you should just avoid sticking your hand in the saw blade.
Re: If AI writes your code, why use Python?
#834To answer the title question though, why use Python? I think Python and higher level languages will become even more valuable since pairing up with code assistants requires keeping a higher level view of what is going on. You want to avoid the weeds, not emphasize them. You want the language used to be as easy for the human as possible so the human can stay involved. That means that my opening argument stays intact, use the language that the team knows best 99% of the time and only when needed force a language that is 'faster' when that is actually required.
Re: If AI writes your code, why use Python?
#835Earlier quoted context omitted.
- The majority of the environments can be played where the agent writes code to work the environment towards a goal. So the model is problem solving, and it has to do so in a particular language, and some languages outperform others. We have a lot of data to back up the improved compiled language performance, but note these are for successful code submissions (failures are counted in a different metric). With the Lan…
I think my problem is that I’m not sure I understand whether you evals are testing language abilities or reasoning abilities. It seems to present results as if they’re testing language abilities, but the problems seem to be reasoning problems.
Re: If AI writes your code, why use Python?
#836Earlier quoted context omitted.
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…
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?
#837Re: If AI writes your code, why use Python?
#838Re: If AI writes your code, why use Python?
#839Re: If AI writes your code, why use Python?
#840Earlier quoted context omitted.
Strong typing has clearly won. However, verbose typing is likely a negative for LLMs. Algorithms written in "pseudo-code", aka a higher level language without type information, are far more readable to a human, and thus likely an LLM too. In regards to control flow and general concept of what code is doing, types provide very little info over well named variables. In fact they often impair understanding by breaking u…
> Algorithms written in "pseudo-code", aka a higher level language without type information, are far more readable to a human, and thus likely an LLM too. What’s the basis of this claim? There are many many more lines of code LLM’s are trained versus pseudo-code. Also I agree, anecdotally the self-correction is key benefit from static types. If there is a mistake, it is caught at compile time and not at runtime.
Humans are trained on human language. LLMs are trained on human language.
Thus something that is easier for a human to understand is likely easier for an LLM to understand.
That higher level language with well named variables reads more comprehensibly than code:VERB with:PREPOSITION types:NOUN, intermixed:ADJECTIVE, stems:VERB from:PREPOSITION first:ADJECTIVE principles:NOUN too:ADVERB