Hacker News new | past | comments | ask | show | jobs | submit login

I always wondered, in a world where

1. people seem to hate writing (old?) PHP, and

2. there are a good dozen languages that were created solely because people hate this other language Javascript, which both compile to Javascript and have the semantics of Javascript, just not the syntax or stdlib of Javascript;

...why we didn’t end up with languages compiling to PHP, targeting the Zend VM, or whatever you’d have to do to get the PHP module in Apache to interpret non-PHP code.






Because Javascript is the only thing that runs on the client side.

And for many “LAMP” hosting environments—such as the tiny ones many ISPs and/or universities hand out like conference swag—(secured, sandboxed) PHP is the only thing that runs on the server side. Same with many “WordPress hosts”—they don’t let you run code per se, but they let you install arbitrary WordPress plugins, so you could deploy your own code into the site... if you’re willing to write PHP.

(Secured) PHP is used by these environments in about the same way that Server Side Includes and .htaccess files were used by Apache in the late 90s: as a way to give users the ability to add some dynamism to a website, without actually giving them a Turing-complete environment that they could use to run bots on.

And yes, I’m not being facetious, it’s really not Turing-complete: most of these environments have fixed request timeouts, fixed memory quotas, and no ability for the runtime to write to disk or make network requests. So there’s no infinite tape! This is “PHP as pushdown automata.” ;)

As such, the language I’m talking about would actually have to be built to understand that it it’s operating in this super-limited environment (more limited than PHP normally is.) I would expect that this would be presented less as a “programming language” per se, and more as something you can use in a Static Site Generator to inject a bit of server-side dynamism to your generated “static” site.




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

Search: