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

I remember someone on SO saying "Go isn't a programming language, it's a DSL for writing networked services", and, well, if we can squint and call Go that, we can definitely call PHP a DSL for dynamic webpages.


You don’t even really need to squint that hard.

That’s what it started as.

It’s entire process model (instantiating the world for each request then tearing it all back down, not having any shared state) is fairly unlike most other general purpose languages.

PHP inverts the usual assumption that “this code file is primarily code” on its head—it assumes any file it’s given contains other data until it finds the special open/close tags signifying a section that contains code. (Allowing you to embed it within HTML easily.)

The runtime handles things like GET/POST variables natively and has a special way to expose them. Ditto for file uploads.

The standard library isn’t extensive but contains a ton of functionality that revolves around managing web requests. (Managing HTTP headers, setting and reading cookies, ...)

Etc, etc.


I'd say any sufficiently elaborated template language becomes Php.


Damn that would be a pretty elaborate template language




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

Search: