Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80311 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 18545 invoked from network); 10 Jan 2015 01:10:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jan 2015 01:10:08 -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.215.47 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.215.47 mail-la0-f47.google.com Received: from [209.85.215.47] ([209.85.215.47:33670] helo=mail-la0-f47.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 43/C0-11748-FEB70B45 for ; Fri, 09 Jan 2015 20:10:08 -0500 Received: by mail-la0-f47.google.com with SMTP id hz20so17165906lab.6 for ; Fri, 09 Jan 2015 17:10:05 -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:date:message-id:subject:from :to:content-type; bh=5ee5pcRbBVXw/trus9AeRvYSXV8g7A9p4KE2GAvz2ko=; b=SidBtc54aRaGYwFscYqmkZB17jtrPztS0uWta+00B409aCcX5HCV5/5JJht9vwgKsF GpOr/JJoonOe5fSnf9CkIt+/OHcxriI+6MV7htzqEGvast9BjPLI/MbmU9oMFeMBUi06 N45RdEwtQ+M95HsaHk9bAlxiH7GJ9DvqW/sF0xQOQCktXxXigf4fEeTrd7qC6tpNWas2 xHhPdrUSZLkq47I1KPwtEhrKYjg1vJp7hl9KNAoIpxhLm47lF12tug6hjcJIMFrXCfbm M/QzLd7mkNIlA5t7ERYVEwPok1cLqt1JwwHl5oq8RuPwl6cA8d9PMP83bntfTBGQup4R 0vSw== X-Gm-Message-State: ALoCoQlJOh6msf9e6I5/nOoC2F12pv8zH7iEcbnK9jSCOp7i7rjdhLGqiQP3yjuAuNCzV3gKLlpF MIME-Version: 1.0 X-Received: by 10.152.43.103 with SMTP id v7mr24684418lal.29.1420852205044; Fri, 09 Jan 2015 17:10:05 -0800 (PST) Sender: php@golemon.com Received: by 10.112.171.97 with HTTP; Fri, 9 Jan 2015 17:10:04 -0800 (PST) X-Originating-IP: [73.189.247.124] Date: Fri, 9 Jan 2015 17:10:04 -0800 X-Google-Sender-Auth: NPQAgX3ERrWd5tM8uszHCmoDCWc Message-ID: To: Pierre Joye , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: One API to rule them all? (Was: Extension Prepend Files) From: pollita@php.net (Sara Golemon) 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. 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. 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. What do you think? -Sara