5 ms·
Can someone explain to a layman why this is significant? I'm genuinely curious.
by juddlyon 12y ago
Can someone explain to a layman why this is significant? I'm genuinely curious.
- oddevan 12y agoAs far as I know, this is providing a better answer to "How do we know this is valid PHP code?" Currently, the answer to that question is "Because it does/doesn't compile using the standard PHP interpreter." When this spec is finalized, the answer will change to "Because it does/doesn't follow the rules laid out in the PHP specification." In practice, there is a PHP spec, it's just an "unwritten" spec that is defined in the code of the PHP interpreter. With an official "written" spec, it will open the door to alternative PHP interpreters (like HHVM), since they will be able to say that they also support "PHP" as defined in the spec. Hope this helps!
- ionforce 12y agoHoping to tide you over until a better answer comes along... Generally when complex programs (like an entire programming language) are made, there is usually a "specification" of its behaviors. This way, you can communicate to people, hey, my program does ABC and does NOT do XYZ. Also, it helps you delineate between bugs and what not. My program does AB DEF. Is that a bug? Or a feature? What does the specification say? Not all programs have a specification. It's a bit formal and unnecessary. Except in a specific scenario where you have multiple/competing implementations of the same programming language. Now that there are multiple players, we need to know exactly which behaviors are per the spec and which behaviors are per the implementation. All coffee makers must make ABC XYZ. This is the spec. Sony CoffeeMate makes ABC DEF XYZ. It matches the spec and throws in some extra features. Samsung Coffee Xtreme makes ABC PQR XY. This also throws in extra features but is actually missing one from the spec. TL;DR it helps a language evolve independently of its implementations (come the day that a language != its implementation)
- nawitus 12y agoAnother way to answer this question is that a programming language specification tells what the language does in the case there's no stack overflow answer for the question.
- kodablah 12y agoThere are a myriad of PHP "gotchas" and many change per release and are undocumented. This should help alleviate that.
- steamboiler 12y agoA language spec is roughly analogous to the definitions of scientific units of measurement[1]. They among other things, allow us to verify something independently of a specific kind of measuring device. [1] http://physics.nist.gov/cuu/Units/current.html http://physics.nist.gov/cuu/Units/current.html
- ahoge 12y agoFor one, a language specification is mandatory if you want to standardize it (ECMA, ISO, JIS, ...). Secondly, it paves the way for competing implementations. Having more implementations automatically means more performance, because they compete with each other. And finally, a language specification is also super useful to people who create tools such as IDEs, linters, or compilers/transpilers.