Hi!

> I’m sorry; you’ve lost me here.
>
> How does "short-lived" execution fail in serverless or event-driven
> environments? Isn’t that the entire point? Serverless is basically a
> reinvention of CGI, which PHP excels at. However, the people who built
> these runtimes didn’t realise what they were reinventing to run long-lived
> applications and didn’t include PHP because "PHP is dying" for the last 20
> years. This is a failure of the people who built the runtimes, not PHP’s
> execution model. It is a political issue, not a technical one.
>

I just wanted to sprinkle some different perspectives into this statement.
AWS Lambda came out in preview in November 2014 and was GA by April 2015.
While the "PHP is dying" mantra didn't help PHP, it also isn't 100% the
context. Back then, PHP was in the middle of PHP 5.4 / PHP 6, no
predictable release cadence and to top it off it has a hard module-based
system where the PHP binary on its own: 1) doesn't handle HTTP requests 2)
doesn't have Request/Response object 3) requires a collection of PHP
Extensions to reach its level of usefulness (think php-mbstring,
php-session, php-xml, php-dom, php-tokenizer, php-pdo-mysql, php-pdo-pgsql,
php-mysqli, php-curl, php-openssl, etc, etc). Building an opinionated
platform that provides the flavour of PHP you need is no easy feat and by
the time AWS started paying attention to PHP on Lambda, https://bref.sh was
already delivering an amazing developer-experience for free. Nowadays,
you're more likely to find an AWS Account Manager recommending Bref to
customers that want to run PHP on Lambda and even sharing content around
Bref than trying to reinvent anything. It's almost like if PHP wanted to
reinvent Composer: high cost, low (or even negative) reward.

As the author of more than 123 commits that lead to the release of Bref
2.0, I tried and failed to build the onboarding experience that languages
like Node and Python have: write a hello world straight into AWS Console
and it just works in your browser. Bref requires you to use Composer to do
the same Hello World, not so much as Bref's shortcomings, but more because
PHP, the language that we (myself included!) love to say that powers 70% of
the internet, is unable to handle HTTP Request / Response without external
tooling, like most web languages can.

-- 
Marco Deleu

Reply via email to