Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80444 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 48098 invoked from network); 14 Jan 2015 07:30:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Jan 2015 07:30:39 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.192.52 as permitted sender) X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.192.52 mail-qg0-f52.google.com Received: from [209.85.192.52] ([209.85.192.52:48044] helo=mail-qg0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/70-43840-E1B16B45 for ; Wed, 14 Jan 2015 02:30:38 -0500 Received: by mail-qg0-f52.google.com with SMTP id i50so5808207qgf.11 for ; Tue, 13 Jan 2015 23:30:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=YmMz62MXzza/ftJtzkhAE5z5FN1Um5Eh+GWk6+TpU+Q=; b=hhT3mGaAwty8Hg5Em+gUo97qqwQnt6Wa/ciUMqvkAcwCr3/nmlhkGm9OAgMdHq+NTN RKv5Puooe9sQ0i6dMrOuoKkbQzx0VaFMEafd+ndYpJ8D3hYeteYZyeM/G8XTUlCXz9fk WIvyhFn+ZdN2T8r4na6JrrtZIflI0tzC7elQu15so7x2WMgmzUkoWHX1K5stdbN9Sw25 /G2bLdgHpmpAtQ/oGUTRPmuXo6Z2aIDOSlH3So4wnM7OB0LBRgB8tniHbiX8BLvw9lss ifX3euiSe6qHab6le7ozZpIQ3UIkvhhJeMPEzYSUtP8ZUHVED/ZPlyn6owAVugPX6fI+ QGtg== MIME-Version: 1.0 X-Received: by 10.224.15.78 with SMTP id j14mr4543500qaa.0.1421220635107; Tue, 13 Jan 2015 23:30:35 -0800 (PST) Received: by 10.140.22.106 with HTTP; Tue, 13 Jan 2015 23:30:35 -0800 (PST) In-Reply-To: References: Date: Wed, 14 Jan 2015 08:30:35 +0100 Message-ID: To: Andi Gutmans Cc: Sara Golemon , 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: pierre.php@gmail.com (Pierre Joye) On Wed, Jan 14, 2015 at 8:10 AM, Andi Gutmans wrote: > >> On Jan 9, 2015, at 5:10 PM, Sara Golemon wrote: >> >>> On Thu, Jan 8, 2015 at 5:44 PM, Pierre Joye wrot= e: >>> 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. >> >> 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. >> > > I was a *very* heavy user of JNI. Sucked big time. You pay a high price f= or trying to keep a consistent API and marshaling. While this is slightly d= ifferent I don't see how you avoid some of the additional overhead plus it = will be very challenging to really cover everything that's needed. > Just my 2 cents. Had to respond because of how crappy JNI was/is :) I fully agree. JNI is crap. However, let face it, our internals APIs is really not good. Yes, there were/are on going efforts for small parts but overall it is a pain to achieve simple things. --=20 Pierre @pierrejoye | http://www.libgd.org