Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80443 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 46198 invoked from network); 14 Jan 2015 07:11:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jan 2015 07:11:01 -0000 Authentication-Results: pb1.pair.com header.from=andi@zend.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=andi@zend.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.214.169 as permitted sender) X-PHP-List-Original-Sender: andi@zend.com X-Host-Fingerprint: 209.85.214.169 mail-ob0-f169.google.com Received: from [209.85.214.169] ([209.85.214.169:63186] helo=mail-ob0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 7A/10-43840-48616B45 for ; Wed, 14 Jan 2015 02:11:01 -0500 Received: by mail-ob0-f169.google.com with SMTP id vb8so6649066obc.0 for ; Tue, 13 Jan 2015 23:10:57 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:content-type:mime-version:subject:from :in-reply-to:date:cc:content-transfer-encoding:message-id:references :to; bh=nuM+uVGp9CU97mPqjhLQCqgiWjnk3OFDO9zgYj4e6Ig=; b=HoZk68v7ZZAMrxaVKs1Y8frP7xzubwgJDpkPxKqMMR33gMex7LZ38CfvnJGao++6D4 JWN3Ip7BjqD4XJMHeN1nnyoADhluBC2Dk/Zj9TYbUp6OAxYPH6Wg4byZy0yFdMtYcPeL orHCAL4DLQddwgBQkMWLZTfG/9BXg90asNzDY2q6R5JuTa9kVfBzoG0OaMdBwpq86gdV nF6sVdwjhkY9RfTgpCppBypgl+i9HPUlczPRLuREFSmlog3xZtddGQwvF6UfdfOCUlgH OCm16y35bpSlWB7ehfwK9/Js9CazSWRi+pLhImpXV1krDP825pFcgBgzMeVRqnJnsWaf 4qvA== X-Gm-Message-State: ALoCoQm/81ozH0vAj5Ly+VymGrkvPOrdqd/6EVDmZEUyi5f8p0woSH2QrgbKsygFeIaH3dq9Js7M/0YKMMQsTjtjV//tStLZQ3C+NyTKzEi0ZGwheNOb5CEXppe/mSu8utGyJf8uEdaaeEr0QsW8DnzBZeWPIukrpw== X-Received: by 10.60.103.164 with SMTP id fx4mr1451790oeb.81.1421219456858; Tue, 13 Jan 2015 23:10:56 -0800 (PST) Received: from [192.168.2.129] (107-137-69-239.lightspeed.sntcca.sbcglobal.net. [107.137.69.239]) by mx.google.com with ESMTPSA id rv3sm11526095oeb.16.2015.01.13.23.10.55 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 23:10:56 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) X-Mailer: iPhone Mail (12B440) In-Reply-To: Date: Tue, 13 Jan 2015 23:10:56 -0800 Cc: Pierre Joye , PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: References: To: Sara Golemon Subject: Re: [PHP-DEV] One API to rule them all? (Was: Extension Prepend Files) From: andi@zend.com (Andi Gutmans) > On Jan 9, 2015, at 5:10 PM, Sara Golemon wrote: >=20 >> On Thu, Jan 8, 2015 at 5:44 PM, Pierre Joye wrote:= >> The fact that hhvm implements a significant part of the extensions (or >> other areas) using PHP+additional syntax as well as adding cleaner >> APIs or mechanisms for the C parts only confirms me one thing: the >> very 1st problem we have to solve is to ease the extension creation, >> by drastically changing the internals APIs & tools. Bundling script >> does not help here, we are using a scotch tape to repair something >> that should have been replaced or redesigned since long already. I am >> not blaming anyone, the engine design, historically, does not make >> such changes easy. > Funny to see you mention this. I literally just pulled together a > meeting today to discuss HHVM's admittedly unstable extension API. > One idea to emerge from this was to design a new extension API > agnostic of underlying implementation. An API which, if done right, > could be adapted equally to both PHP7 and HHVM *and* provide the > opportunity to introduce PHP5 shims so that a single extension could > be written to function identically under any PHP runtime, and any > version. If done right, could make extensions not just source > compatible, but *binary* compatible as well. The engine details can > change, but the public-facing extension API could offer a consistent > way of doing the one and only thing that extensions should have to do: > Glue PHP into external libraries. >=20 > That's a bit pie in the sky, I'll admit, but wouldn't that be cool? > Fact is, JNI does this for Java already, so there's precedence to > learn from. Heck, we're actually halfway there with HHVM's > "ext_zend_compat" layer, which makes PHP extensions (mostly) source > compatible with HHVM. >=20 I was a *very* heavy user of JNI. Sucked big time. You pay a high price for t= rying to keep a consistent API and marshaling. While this is slightly differ= ent I don't see how you avoid some of the additional overhead plus it will b= e very challenging to really cover everything that's needed.=20 Just my 2 cents. Had to respond because of how crappy JNI was/is :) Andi > While I could work on this in the dark, manipulating HHVM's APIs with > one hand and adding proxy interfaces to PHP (as an extension) with the > other, I'd much rather have involvement from others. >=20 > What do you think? >=20 > -Sara >=20 > --=20 > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php >=20