RE: [PHP-DEV] One API to rule them all? (Was: Extension Prepend Files)
| From: | François Laupretre | Date: | Mon, 12 Jan 2015 12:58:15 +0000 |
| Subject: | RE: [PHP-DEV] One API to rule them all? (Was: Extension Prepend Files) | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-80417@lists.php.net to get a copy of this message | ||
> De : php@golemon.com [mailto:php@golemon.com] De la part de Sara
> Golemon
> Why so limited? Like, why disallow objects completely? That feels
> like a big step backward for PHP. Any why not computed constants?
> (Assuming they stay constant throughout the process lifetime)
This is not what we will release, if we decide to do it one day. This scope only applies to a first
prototype: just enough to evaluate the concept, but not too much to avoid spending too much time
before having a working prototype. The same for you when you add the code to generate for HHVM. I
think it's enough to agree on a concept.
> I'll be honest, I'm not a big fan of code-generation. I find it
> introduces complexity and it's not needed here. Lots of languages
> manage to put together a stable API without resorting to code
> generators.
I am not crazy about it either, I just want to generate code for argument parsing (removing every
access to zval, dealing with 'mixed' type, checks...), return value (convert to zval,
maybe a pair of checks), and the global 'glue' code (global header file, function/constant
declare/undeclare, all the boring stuff). Some of this is too complex for C macros. The rest is
provided by the user in C and stays in C. This code will use C macros to access what we want to
abstract.
Regards
François