Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80408 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79658 invoked from network); 12 Jan 2015 05:50:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Jan 2015 05:50:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.217.179 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.217.179 mail-lb0-f179.google.com Received: from [209.85.217.179] ([209.85.217.179:36501] helo=mail-lb0-f179.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/70-08273-0A063B45 for ; Mon, 12 Jan 2015 00:50:25 -0500 Received: by mail-lb0-f179.google.com with SMTP id z11so15940560lbi.10 for ; Sun, 11 Jan 2015 21:50:21 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=CYFpvZZMGoAn+/1jBy/jYowex+7VE//BCvE8GUa/JZo=; b=IxHRvWuCPejmRoBQaQKhCmD1fkaIgxe7/Ph6/DCgCgnclwR0o7mpPCaTTpzVAHreB9 3J980AQd3EVDxSYTKrHy3zvxKXSzMlPoA10t00qQBIqsQ5t9+zlag2e4U9HBWKxwBDWq wBcmbZiP9iVCtkTmWT79BJ/u60T5LnP248DeV2DgwPVtjOG5uWzZhVFCv36rHfW51Abh LeW8HGgFl/9SMwdM6uILiE1NfzjLv95voC5ww3IyzJpZbkOR8Ij9OgaEKEX0H1Oxq63w KbU5s1kxVqGCumAglYjIFqZ2X8ZpMds7UB+Dtic5S+hERqqbPzNovB+IIZyVPd/2DqZ/ ADPg== X-Gm-Message-State: ALoCoQmym1QUG8Xw/VnkW7BVo1YEjnf4r1ppcPLhXmhAbG+jTUmhRkTge0Xz5qjlILzIndtayfsA MIME-Version: 1.0 X-Received: by 10.152.8.225 with SMTP id u1mr34842328laa.21.1421041821124; Sun, 11 Jan 2015 21:50:21 -0800 (PST) Sender: php@golemon.com Received: by 10.112.171.97 with HTTP; Sun, 11 Jan 2015 21:50:21 -0800 (PST) X-Originating-IP: [199.201.64.2] In-Reply-To: <005a01d02e1a$02d27a00$08776e00$@tekwire.net> References: <54B1AA31.6050703@gmail.com> <003901d02de5$53732480$fa596d80$@tekwire.net> <005a01d02e1a$02d27a00$08776e00$@tekwire.net> Date: Sun, 11 Jan 2015 21:50:21 -0800 X-Google-Sender-Auth: R2u-yHFbWC5MYM1Kr_VoFIufIAg Message-ID: To: francois@tekwire.net Cc: Pierre Joye , Stanislav Malyshev , PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] One API to rule them all? (Was: Extension Prepend Files) From: pollita@php.net (Sara Golemon) On Sun, Jan 11, 2015 at 7:44 PM, Fran=C3=A7ois Laupretre wrote: > - Extension exposes only PHP functions and constants (no OO), > - Each PHP function argument must accept a scalar, an array, or both ('mi= xed' case). > - one or more PHP function arguments can be optional > - PHP function arguments can be passed by value or by reference. > - PHP functions return value must be a fixed type (cannot return differen= t types depending on context). Return value type can be null, bool, long, d= ouble, string, or array. > - Constant value must be static (cannot be computed during MINIT). > 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) > I have pushed a first half-baked version of the extension generator I was= thinking about. > Just for a look, don't try to run it. I started with json and yaml suppor= t for metadata definition. > We can easily add another supported syntax if needed but these should be = enough. > Look at https://github.com/flaupretre/php-ext-gen/tree/develop > 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. -Sara