Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I'm not disagreeing with you, but

> Symbols persist across multiple requests; this is a big part of why they are so beneficial.

That is still not really useful, PHP throws the entire execution context away after the request has finished. There is no sharing nor anything to persist unless you're doing so with an external data-store.



Wait, isn't that just if it's used/configured as a CGI? If you use it as a webserver module (Apache/IIS/Lightspeed), the execution environment can persist in a similar way to an app domain, right?


Nope, it's still cleared at the end of the request (as it should be, this is not a bug or mis-feature, and is actually one of the things PHP got right for scalable apps).

What doesn't happen compared to CGI, IIRC, is loading the whole PHP engine from the start for every invocation. But no request specific memory is ever shared between invocations.


The only way to set PHP up as a daemon with shared execution and shared processes responding to requests is to use something like ReactPHP[0] -- even with mod_php, php5-fpm or similar, the execution context is still thrown away. The only difference between that and CGI is that the compiled byte code can be cached and the start-up costs are minimised as the bare interpreter process is kept around.

Shared-nothing turns out to be really nice for scaling web apps. One of the few things PHP got right from the get-go.

[0] http://reactphp.org


Girvo, I was not saying that within the context of how PHP operates symbols/atoms would be beneficial.

The parent stated, "Sorry, but those are entirely trivial syntactic issues, and not very interesting at that either..."

My point was that symbols/atoms are much more than just a syntactic difference and that they are in fact quite interesting. Chicago Boss, an Erlang framework, takes these ideas to an extreme to push the limits of shared immutable memory on a web server.

http://www.chicagoboss.org/about.htm

I'm not a big fan of the way he trashes pretty much every alternative at the beginning of his description; there are many web frameworks built on many different languages that the market has proved out are sufficiently scalable.

It is however an interesting and different approach that I think we can both agree goes far beyond "trivial syntactic issues".




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: