A language without a spec ? Damn, php is even worse than I thought. Still, FB may turn it (with hack and HMMV) into something interesting.
That's not uncommon for implementation-defined languages. Ruby didn't have a language specification until the community set up rubyspec as it started getting serious about alternative implementations. Facebook is apparently getting serious about its own alternative implementation (or at least intending to be taken seriously) and are thus stepping in with a spec.
Announcing a specification for PHP
31–40 of 263 posts
Re: Announcing a specification for PHP
#32Re: Announcing a specification for PHP
#33Rock on, @saramg
Re: Announcing a specification for PHP
#34This is great news for the PHP community, and I for one applaud their effort. Contrary to what many HN hipsters seems to believe, PHP is quite a capable language, and HHVM / Hack is really pushing things forward. * Hack introduces type hinting, imo the major lacking part in PHP. * HHVM introduces speed to php. On a personal project calculating perlin noise, I got about 8x speedup on HHVM. * The specification helps pa…
This attitude really frustrates me. I'm a developer with over 20 years of experience. I don't use PHP because (a) I have had poor experiences with it in the past, (b) I am enjoying my current stack (Java8/Clojure/Groovy), and (c) would go with stacks like RoR over PHP if I had to choose, simply because I've had good experiences with Rails.
You're implication that this has something to do with trendiness is frankly insulting.
Re: Announcing a specification for PHP
#35After recently having to work with modern PHP, I have to say a lot of the criticism of the language is unfounded. It's changed a lot since I first used it. But the stdlib is still hard to manage. Different naming conventions, different order on the parameters for functions that do almost the same thing, and every function is global. Couldn't they keep all that for backwards compatibility, but create more sane wrapper…
EDIT: i totally agree that the standard functions are a complete mess in PHP. But they have to stay around for backwards compatibility. Have a look at the SPL classes: http://php.net/manual/en/book.spl-types.php
Re: Announcing a specification for PHP
#36The PHP grammar in BNF starts at line 10354. It not that extensive as some may think and rather similar to what Java BNF looks like. The expression statement is a bit more extensive than in most languages, as PHP also supports the little known template-style (if elseif endif;): http://php.net/manual/en/control-structures.alternative-synt... Thanks for the PHP spec. Btw. GitHub says "Sorry, this blob took too long to…
I got the same message on GitHub. Did you checkout the repo in order to read it? Personally, this is exciting news, but I'm not sure that PHP is ready for this after 20 years. There's plenty of cleanup that needs to be done to userland naming conventions and parameter orders that in all likelihood won't get done anytime soon to avoid breaking BC
PHP ships with a lot of third party C libraries that are exposed in PHP with usually their original function names. Object orientation came with PHP 4 and later with PHP 5 the new better one (5.3+ with namespace support, traits, etc.).
You can think of PHP as a mixture of C, C++ and Java for web development and CLI tools. I personally use all four languages, each one for specific purposes where the fit best. You can find function names like strstr in C, C++ and PHP (= indexOf in Java and JavaScript) - not a big deal.
Re: Announcing a specification for PHP
#37After recently having to work with modern PHP, I have to say a lot of the criticism of the language is unfounded. It's changed a lot since I first used it. But the stdlib is still hard to manage. Different naming conventions, different order on the parameters for functions that do almost the same thing, and every function is global. Couldn't they keep all that for backwards compatibility, but create more sane wrapper…
As the new ones get more use, slowly deprecate and remove the original global namespaced functions, in the same way they phased out register_globals
Re: Announcing a specification for PHP
#38Rookie question, but what does a language specification for PHP do or mean? I assume this is good, but don't know why. :)
Re: Announcing a specification for PHP
#39After recently having to work with modern PHP, I have to say a lot of the criticism of the language is unfounded. It's changed a lot since I first used it. But the stdlib is still hard to manage. Different naming conventions, different order on the parameters for functions that do almost the same thing, and every function is global. Couldn't they keep all that for backwards compatibility, but create more sane wrapper…
Myself, I like this proposal.
Re: Announcing a specification for PHP
#40After recently having to work with modern PHP, I have to say a lot of the criticism of the language is unfounded. It's changed a lot since I first used it. But the stdlib is still hard to manage. Different naming conventions, different order on the parameters for functions that do almost the same thing, and every function is global. Couldn't they keep all that for backwards compatibility, but create more sane wrapper…
If you want to order your program in a specific way, you introduce the appropriate level of abstraction. Same as with any other language. EDIT: i totally agree that the standard functions are a complete mess in PHP. But they have to stay around for backwards compatibility. Have a look at the SPL classes: http://php.net/manual/en/book.spl-types.php