Why would you write PHP with LLMs? The whole point of PHP / laravel is trading performance for speed of development. LLMs inherently solve speed of development so why even use PHP any more unless you're supporting a legacy code base?
I've worked on a single laravel project in the past and I didn't like it. Whenever I needed something just a little more complex than what the docs suggested I felt I had no way of figuring out how to do it and support forums were scarce of solutions.
For the same reason you would build something in React in the LLM era... because it's what the LLMs are good at. What Laravel has going for it is that it's opinionated, those opinions are conventions (loosely) and that is consistency. That results in llms being very good at building laravel things the laravel way.
In the same way they're great at building things on React.
But I don't know, I'm just some rando who built a whole huge ass "factory" (that would be an understatement) on Laravel, for mostly (albeit, here lately, mostly not) Laravel projects and it's _insane_. I may be biased. I may also be lucky to have jumped on that bandwagon.
And why follow it to Rust/Go? Same reason. The opinionated wave of consistency and quality into languages with different strengths.
> you would build something in React in the LLM era... because it's what the LLMs are good at
LLMs are very good at rust / go too. Rust / Go are also a lot more performant than php / laravel
> And why follow it to Rust/Go? Same reason
except if you want performance and decide to go for Rust / Go then LLMs wouldn't have been trained on laravel for rust / go because it's new so you'd be better off using an old framework.
LLMs do not care. I have written my own language/repl/vm in C3, and an AI generates my own language just fine. Its a totally new language, new syntax with semi general semantics (its basicallt go channels on an beam like runtime) that have (and will always have) one user, me.
Who guarantees that LLMs will generate code that fulfils quality and security requirements? A human still has to be responsible for the resulting product and when the human can't follow what the AI does, it is worthless. For a human to follow the AI results he has to read and understand the code, which brings us back to a well documented framework that helps to follow along.
> Whenever I needed something just a little more complex than what the docs suggested I felt I had no way of figuring out how to do it and support forums were scarce of solutions
> The whole point of PHP / laravel is trading performance for speed of development.
(For my 12-year-old self, it was being able to push a bunch of .php to a free host and have them run. I later even considered learning Haxe to have a better language while still being able to compile to PHP for that use case.)
On the other hand, why would you prefer any human-readable programming language or framework over another in the age of LLMs?
Like, why stop at Rust or Go when LLMs will soon be able to generate binaries for your target architecture better than any compiler can. The LLM could be writing dark verses in brainfuck behind the scenes for all I know. It doesn't matter anymore because we're not gonna read any of it.
Because they won’t be able to write assembly well. LLMs rely on strong guardrails and tools to perform well.
PHP performs poorly with LLMs not because it’s readable, but because it’s too dynamic and wishy-washy. Statically typed languages and strongly typed languages just perform better out of the gate, because the LLM has more context to reason about the code.
I program in PHP all day, I know. PHP is a bad language for LLMs. C# is better, Java is better, rust is better. LLMs will never replace compilers because they don’t need to. What compilers provide is a rich information system and strict structure. That’s exactly what LLMs rely on.
They do a piss-poor job as compared to the output of compiled languages. The assembly will be slower and more buggy, because assembly has no guardrails.
A type system and compiler is for correctness. Using them results in higher quality software. There’s just zero reason to have an AI write assembly. Unless it’s tiny pockets of ultra-optimized assembly in, say, a decoder.
Think of it this way. The mere fact a compiler exists allows the LLM to use 1/10 of the tokens to get the same result. Instead of constantly iterating through the logic in its context and trying to figure out what’s going on, it can rely on the compiler, which is deterministic, to help it.
LLMs are not much different from human programmers when it comes to seeing new code. If you were onboarding into a new codebase, with no context, would you prefer assembly, PHP, or dotnet? Dotnet first, PHP second, assembly last. Dotnet has more context in the code itself, so you can reason about it quicker, easier, and more accurately.
You should try out other languages and you’ll see the difference. LLMs hallucinate array keys that don’t exist, program extremely defensively (?? fucking everywhere) and make trivial type mistakes. It doesn’t see, or forgets, that a string was converted to a DateTime 500 lines earlier and then makes a mistake.
The LLM has almost no guardrails to fall back on. The best is php -l and unit tests. It has to reason about the code from scratch every time, and in doing so it makes mistakes and wrong assumptions. That’s much less of a problem in other languages.
> You should try out other languages and you’ll see the difference
I do? I work in several languages. Nothing has stood out about PHP that is worse for LLM reasoning. It's one of the most widely used languages in the world, it obviously performs pretty will with LLMs.
What languages are you working in?
> LLMs hallucinate array keys that don’t exist
I use data objects, which are typed. PHP has types, did you not know that? If you're using raw dynamic arrays, yeah, an LLM might hallucinate keys with enough context rot. That is true of any dynamic syntax, and using raw arrays hasn't been standard practice in quite some time.
> It doesn’t see, or forgets, that a string was converted to a DateTime 500 lines earlier and then makes a mistake
I don't know man, this is not remotely close to my experience. Unless you were doing this like 2 years ago when LLMs were an entirely different beast. That's the only explanation I can think of for your LLM being incapable of reading 500 lines of PHP code.
> It has to reason about the code from scratch every time, and in doing so it makes mistakes and wrong assumptions
This sentence makes less sense the more I read it. What about PHP do you think makes LLMs "reason from scratch every time"?
I use an LLM every day on a codebase that’s at least 10 million lines long.
LLMs perform poorly in huge monoliths (not enough context) and they perform poorly in PHP (not enough context in the code). It’s just intrinsic to how LLMs work.
The LLM era has made running any scripting language on a public-facing service a greater security risk.
In PHP's case, I currently judge that risk as unacceptable (and I've made a living off developing in PHP for decades).