Re: [PHP-LANG] Approaching the First Draft [of a language spec]

[email protected] (Zeev Suraski)
Newsgroups php.dev,php.lang
Message-ID <[email protected]>
At 01:57 21/11/2000, Sascha Schumann wrote:
> > Thus, what we need is a descriptive specification, rather than a defining
> > specification.  Much like the ANSI C++ spec is or at least used to be
> > useless because not a single compiler in existence implemented it (and is
> > thus rather useless for practical purposes), defining a spec that is not
> > backed up by the existing implementation would be useless for end users.
>
>     Well, C++ has been basically reinvented during the
>     standardization process. I don't see this happening with PHP.
>     The base for this specification will be PHP 3/the Zend
>     engine, so you don't really need to fear that the Zend engine
>     and the specification will be incompatible.
>
>     I'm not sure how the end-user will be able to benefit from a
>     list of syntactical rules. Can you elaborate what you have in
>     mind?

Well, I guess I see that a bit the other way around.  I see the goal as a 
document that can make the user community know what the language definition 
is.  The kind of document you are talking about, which is similar to say, 
ANSI C/ANSI C++ specs, are specs that are useful for compiler developers.

Today, quite often, people come out with questions of 'what happens in this 
case'.  For instance, someone asked me today on IRC whether !$foo checks if 
$foo is false, or if $foo is set.  Today, there's no place he can go to and 
find an answer to his question.  The way I was imagining the language spec, 
I thought it would address exactly those needs (well, that was just a 
simple example :).

Syntactical rules can be useful to end users, and they're common in 
programming language books.  If we add a description of the semantics 
surrounding these rules, we can end up with a document that would be useful 
for the average PHP programmer.

Zeev


--
Zeev Suraski   <[email protected]>
CTO, Zend Technologies Ltd.  http://www.zend.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.