Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:103409 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 37864 invoked from network); 29 Oct 2018 14:38:00 -0000 Received: from unknown (HELO NAM01-BY2-obe.outbound.protection.outlook.com) (104.47.34.137) by pb1.pair.com with SMTP; 29 Oct 2018 14:38:00 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=RWSoftware.onmicrosoft.com; s=selector1-zend-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=MIzlmS0L2R1HHpUs9PyMfH6U2YESNGfKyuQS8bkizQY=; b=E3gKbvP6mIXQnCgJRJeUKw4MF2Ayk4jAoTQ4OfJwBuYpZhUEDvjJWMd+iXy1FnQtwwEd19E+2Tur2vIw/LjxkHhEYTrfn0J2RsR6L710G9vKA7CbVOiL1+NbXD6JnF9ehVJHcEUXw1bwAQ8bKH4RZMpJL02R1tHEBTIKAw1OQCk= Received: from BY1PR02MB1260.namprd02.prod.outlook.com (10.162.109.14) by BY1PR02MB1276.namprd02.prod.outlook.com (10.162.109.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.26; Mon, 29 Oct 2018 10:54:17 +0000 Received: from BY1PR02MB1260.namprd02.prod.outlook.com ([fe80::99cd:5586:ada3:35e7]) by BY1PR02MB1260.namprd02.prod.outlook.com ([fe80::99cd:5586:ada3:35e7%3]) with mapi id 15.20.1273.027; Mon, 29 Oct 2018 10:54:17 +0000 To: Crocodile CC: Michael Wallner , Sara Golemon , PHP internals Thread-Topic: [PHP-DEV] [RFC] Preloading Thread-Index: AQHUaHW8X0eBNvKRIEWtwVo7MdVXjaUvnQyAgAAOq4CABmwBAIAAArCM Date: Mon, 29 Oct 2018 10:54:17 +0000 Message-ID: References: <5e03c825-0079-4a4e-8cbe-2750efdad9e2@email.android.com> <5f8379f2-fccd-1c0e-c824-8238159842c5@zend.com>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=dmitry@zend.com; x-originating-ip: [212.232.72.197] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;BY1PR02MB1276;6:1cz5DCWNqbtp92LVTeG5OD+zRGa/7QxNGW7bI9TGomfqV7byfT68/V2FjItK3gPsoCBKg/3+4THy+87wc4Al+nFfbNkM7oyFpA3TmOaE++262t0+/1PFCtuzSLdebNeD3j+c8hGnjXP312sLttylD5+zyWyeKwF0RkdTKTFPOqq+IJOoU84FLs+EofK0U+HHV0JrKqJ/uRz9bSwTNxGzlguS6/UZP84eKrQHrOEMdA/nF43CDi6V0pVQnAcb1CdkpnkrKdWnUWoLYxUG4apEzWSllW+kM2xzlGZLFOAj5uWxEW8cZ1Cnp2xbypVfGapGl5ccZMGcETS8bD49TGF+5OnGoEXFRZHznzuykopX6lK8b8mAPMTEiB3pbY+mU75hylhPalWGrTFMFapAHMoRsBlUIvpG+QAZFGSN0LLkfiNOUyr+h3JHuLw4cKSqV2CJKiWehnWwS+KqPxeF7VKDmFLvR1T/KEJRb27mTZUHLCg=;5:xcWnXTkxITKG8FSdjT8IvH9mA+7NEaoqh0o46idT3RxJUJD55Vd/71cdnwmSedvV4GxGTEIj0hEEf1esTXvy8pIhlkA6q4Ns5noBcX3VFCX9EIeqL0Tm0HcdGgAWjEDsLrW5sK+68LP3VJ/2Swi4+BvLzQIy5e9l2VM8urI9Uwg=;7:Uy/Mh012V9wuprXtBS4Rh7NLZ/Gl62O2wFh36mXuQ29k/BOzdlPbl0HE7gPp9aDbyJW5jn6551x5B1clZblZeiFWQrR1dfmCfa6FURBtCk6od6Tv/x858a4nm/zATKLXTo7AaCzv5fCaX+NmTSWEzw== x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 5312c634-7101-4715-1685-08d63d8cdfb9 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020);SRVR:BY1PR02MB1276; x-ms-traffictypediagnostic: BY1PR02MB1276: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(85827821059158)(166708455590820)(23657631684272); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3231382)(944501410)(4982022)(52105095)(93006095)(93001095)(10201501046)(3002001)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095);SRVR:BY1PR02MB1276;BCL:0;PCL:0;RULEID:;SRVR:BY1PR02MB1276; x-forefront-prvs: 084080FC15 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(396003)(376002)(39850400004)(366004)(136003)(346002)(189003)(199004)(52314003)(15188155005)(6506007)(53546011)(53936002)(6246003)(102836004)(966005)(7736002)(16799955002)(71190400001)(71200400001)(8936002)(86362001)(74316002)(4326008)(14454004)(54896002)(316002)(33656002)(39060400002)(76176011)(7696005)(55016002)(25786009)(93886005)(26005)(99286004)(9686003)(6306002)(54906003)(256004)(236005)(186003)(106356001)(105586002)(6606003)(5250100002)(6916009)(97736004)(2900100001)(478600001)(6436002)(66066001)(5660300001)(486006)(3846002)(1411001)(476003)(8676002)(81156014)(81166006)(19627405001)(68736007)(11346002)(6116002)(229853002)(446003)(2906002)(606006);DIR:OUT;SFP:1102;SCL:1;SRVR:BY1PR02MB1276;H:BY1PR02MB1260.namprd02.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: zend.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: YnnIpVFEVdD2mYlqwkC7Pfqw8UDQHJNllzyXtWk2etGZGYW0j5G4I/PWQA7dz3545xGk1bcY+DcLrZ6wxjmy0GFanSqckeCKnn0r7km4kWU1utKOKOaAlStmmuDEXvvkUTyWOXZmNGLvJIET2FF02Yxnn/p/rTM85ain4clEm0RCT1Ya4JAFgn+NX1IIgYMp/HLBQN7aj5mhIm62YxhW0FwhhRxFmA6li4ChN6C88Q4ek8sDeRvRuX0kFP3bn4hjq/9sllJUJ+XeezUjmvX/nnwZHwkro6Q/vVIVJzjnm0Z6DsTs4namtSuz/38rQ0XRXTQtJQ6CD+sUm5Pxd5mx3liBgbrTIvbHHstp7qVHZHA= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_BY1PR02MB12605F7BB950EE0526CDBDFCBFF30BY1PR02MB1260namp_" MIME-Version: 1.0 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5312c634-7101-4715-1685-08d63d8cdfb9 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2018 10:54:17.5637 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR02MB1276 Subject: Re: [PHP-DEV] [RFC] Preloading From: dmitry@zend.com (Dmitry Stogov) --_000_BY1PR02MB12605F7BB950EE0526CDBDFCBFF30BY1PR02MB1260namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Yes. --rf/--rc work for preloaded classes/functions. ________________________________ From: Crocodile Sent: Monday, October 29, 2018 1:44:08 PM To: Dmitry Stogov Cc: Michael Wallner; Sara Golemon; PHP internals Subject: Re: [PHP-DEV] [RFC] Preloading Just a side question: will the information on preloaded userland classes an= d functions be available via php --rc / php --rf commands? On Thu, Oct 25, 2018 at 10:42 AM Dmitry Stogov > wrote: On 10/25/18 10:47 AM, Michael Wallner wrote: > On 20/10/2018 15:06, Dmitry Stogov wrote: >> >> On Oct 19, 2018 5:20 PM, Sara Golemon > wrote: >> On Fri, Oct 19, 2018 at 3:17 AM Dmitry Stogov > wrote: >>> I would like to start discussion on a Preloadng RFC https://wiki.php.ne= t/rfc/preload >>> >> 4) "In conjunction with ext/FFI (dangerous extension), we may allow >> FFI functionality only in preloaded PHP files, but not in regular >> ones." Is there any interest in something like HHVM's HNI interface? >> FFI always sounds nice in theory, but complex types mean that a little >> bit of glue code is often a plus. > > As always when it comes to PHP and FFI I'd like to point out ext-psi [1] > which uses a different approach than other PHP FFIs until now. > > It parses PSI files at startup, which basically are C header files > augmented with the PHP userland interface decls, see for example the PSI > file for time.h [2] > > As you can see, marshalling from and to native types has been taken > seriously, and while we're capable of recursively unmarshalling e.g. > addrinfo structs [3] and handling sqlite callbacks [4] it's still not > possible yet for something like curl_easy_setopt. > > > > [1] https://github.com/m6w6/ext-psi > [2] https://github.com/m6w6/ext-psi/blob/master/psi.d/time.psi > [3] https://github.com/m6w6/ext-psi/blob/master/psi.d/netdb.psi#L70 > [3] https://github.com/m6w6/ext-psi/blob/master/tests/netdb/gai001.phpt > [4] https://github.com/m6w6/ext-psi/blob/master/tests/sqlite/sqlite.psi#L= 56 > [4] https://github.com/m6w6/ext-psi/blob/master/tests/sqlite/sqlite001.ph= pt > > hi Michael, You made a great job developing ext-psi. But anyway, I more like my own FFI implementation (at least because it's simpler and it's mine). FFI::load() in conjunction with preloading, would provide functionality similar to PSI files loading on startup. In the future, I would like to push ext/FFI into core and integrate it with JIT (similar to LuaJIT way). In any case, this thread is about preloading, that is interesting by itself. FFI and JIT are the future scope. Thanks. Dmitry. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php -- Best regards, Victor Bolshov --_000_BY1PR02MB12605F7BB950EE0526CDBDFCBFF30BY1PR02MB1260namp_--