RE: [PHP-DEV] One API to rule them all? (Was: Extension Prepend Files)
| From: | François Laupretre | Date: | Mon, 12 Jan 2015 12:38:13 +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-80416@lists.php.net to get a copy of this message | ||
De : Pierre Joye [mailto:pierre.php@gmail.com]
Also I am really not a fan of yaml&co to generate C code but having critical parts in C and
everything else in straight php :)
I don't use yaml to generate C, just to define metadata, like extension name, arguments/return
value characteristics, etc. The glue C code is then generated from this metadata.
A constant definition, for instance, defines a name, a type, and a value. This definition will be
given in yaml or json. That's all it is used for. The user writes the function body (between
arg parsing and return value) in C.
PHP is fine but defining a tree of metadata in json or yaml is really easier than writing nested
array statements.
Regards
François