by pampa · 3d ago · 0 comments
It was a baroque implementation of a rails-style framework, that was heavily influenced by enterprise java coding style.
It's rather elegant, and exceptionally well-documented.
However it is probably not what you want for an app in the LLM era. There seem to be considerable simplifications in this design that are more appropriate for Go.
The main advantage here will be the integration with Inertia, though I guess Livewire is a much bigger challenge to implement.
I came from Java (and a little bit of Go) into a PHP Laravel world, have been there for 2 years. I find the Laravel documentation extremely lacking. The official documentation is very high level, vague and sparse. The code itself has almost no documentation at all. A lot of the times if you need to know how something low level works, you have to start reading code. And there's a lot of code in there.
I found the Java and Spring ecosystem (even though I hate it a lot) extremely well documented, and Go also very well documented. Laravel's documentation pales in comparison.
Against the average PHP project perhaps but against Symfony it's not.
Laravel documentation has always focused primarily on the new user forgetting that the thing about new users is that it is a temporary state.
It worked for them clearly so hard to say it's a bad idea but I always (and still do) prefer the way Symfony more thoroughly documents everything.
Not so much. When you come back to an app after years, this clarity of purpose is useful. Or when you have 32 years of built-up web developer cruft in your head.
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.
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.
Details ?
Laravel docs & ecosystem are top-shelf
(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.)
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.
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).
Of course, that could change tomorrow with a fork, but idk if we’ll see if. If the agent is writing the code, it can slop out the same UI with Inertia. Tbh Livewire and Inertia are quite similar in that at their core, they are more both wire protocols with well defined behavior and outputs. The difference is that Inertia targets json as an output format and Livewire returns html/blade in a manner not terribly different from HTMX (though not the same and with more JS under the hood).
You have request()->params, response() in the framework But all the raw data is still there in $_GET & $_POST, file_get_contents('php://input'). You can still echo "" to the browser, and still send header() from everywhere.
It almost looks like php developers around 2009 were really wanting to write enterprise Java, but had to use php at their day jobs, so they gradually made php pretend to be something else.
I was not talking about PHP, but Laravel.
$result = ' PHP 8.6 '
|> trim(...)
|> strtolower(...)
|> str_replace(' ', '-', ?)
|> (fn(string $s): string => match ($s) {
'php-8.6' => 'New hotness!',
default => 'Something else',
});
People always seem to get hung up on the standard library and the runtime, but the language itself is amazing by now.I think scripting languages tend to represent too great an attack surface, for humdrum reasons (like over-capable default configurations).
So I welcome this effort (not least because I quite like Go)
PHP usage target is not to have a uselessly too much verbose code like there is in Java where you have for example 3 km long imports. PHP needs stricter typing for sure, but not enterprise grade Java over bloated syntax.
If you really want to write Java, just write Java and don't try to change PHP.
Laravel uses autoloading (so as most other PHP frameworks), and magic methods (https://www.php.net/manual/en/language.oop5.magic.php) etc, which are features of PHP language.
Of course you can replace most of them, for example, swap `__get` with a manually implemented `.get`, but then you're talking about general programming patterns, not language/framework any more.
For Go specifically, it don't have class method override or even class, the `struct` embedding works a little bit differently. So at least that part will be different, and the difference will probably water fall all the way down to the point it effects how user use the framework.
It is some sort of a cargo cult engineering where you feel like you’re building a legacy enterprise app to achieve trivial outcomes.
Not worth it at all.
But Go is great as is, not need for a Laravel on top.