Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102076 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2162 invoked from network); 26 Apr 2018 09:25:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Apr 2018 09:25:44 -0000 Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain zend.com from 104.47.36.128 cause and error) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 104.47.36.128 mail-sn1nam02on0128.outbound.protection.outlook.com Received: from [104.47.36.128] ([104.47.36.128:21062] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 8F/AC-33084-61B91EA5 for ; Thu, 26 Apr 2018 05:25:43 -0400 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; bh=NJ99PI9JTu8PlxiiVeTmpxu+rzYEoYYDH3USIfnnj9s=; b=sr5crDlQZkUJJMD8xWOXVSV9OUKyvPwnv3/r7FN1bGWAgfgoJX4cFPZECXYLzJFYcJzAHi81RUYD5tIs+9Py8ctL2vkiEwGiezRaEoQrM8y4mVdo1F4MVjpXcqTSxL7nOdjwLt9ntJV8zbO5RNYLGK+HsZZRKrHCqhoUi4neFp8= Received: from DM5PR02MB3243.namprd02.prod.outlook.com (10.164.148.21) by DM5PR02MB2202.namprd02.prod.outlook.com (10.168.173.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.696.13; Thu, 26 Apr 2018 09:25:38 +0000 Received: from DM5PR02MB3243.namprd02.prod.outlook.com ([fe80::2da5:6474:eb5a:22d]) by DM5PR02MB3243.namprd02.prod.outlook.com ([fe80::2da5:6474:eb5a:22d%13]) with mapi id 15.20.0696.016; Thu, 26 Apr 2018 09:25:38 +0000 To: Michael Wallner CC: Dmitry Stogov , Stanislav Malyshev , Zeev Suraski , Xinchen Hui , Nikita Popov , Bob Weinand , "Anatol Belski (ab@php.net)" , PHP internals list Thread-Topic: [PHP-DEV] PHP FFI extenesion Thread-Index: AQHT0yrBnLpXxgz1HEWdw/jxKSLJkaQEFM4AgABk3QCAABugkIAOJYwAgAAf5oM= Date: Thu, 26 Apr 2018 09:25:37 +0000 Message-ID: <6760eb1f-4345-48d2-a5c2-727cd98e3ac2@email.android.com> References: <56794c33-a728-d399-2462-b62ba1b7a509@gmail.com> ,<739e66c6-e60b-005e-acb0-d5c4fb2da11d@php.net> In-Reply-To: <739e66c6-e60b-005e-acb0-d5c4fb2da11d@php.net> 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;DM5PR02MB2202;7:XLykjjnGrA3PGHRKSbyo5m9COTiq+U+knILYYnFvYqGMzNEE4UgiVTgZrFXFLDCHkD1EWYeTfyDGmTn1RwVVst31o2VhfbluBVpwR8xg1NuJhZkWvyIuv2E0CG4pIqxSOpvtaJAcZm8qZHCzQq4qEDy+IujiUkU9gPhRinKQ47TMEs1dtYn1lrAJ2sV5c6INEOGcT4cpS4umM7fz/k7gGVoYGwP+2rfvj5lQ/bnLJVkvBDd4XgMqXWEIVLnwz21P x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-forefront-antispam-report: SFV:SKI;SCL:-1;SFV:NSPM;SFS:(10019020)(376002)(39850400004)(346002)(366004)(39380400002)(396003)(199004)(189003)(3280700002)(25786009)(4326008)(14454004)(3660700001)(68736007)(8936002)(97736004)(6436002)(81156014)(2900100001)(8676002)(86362001)(446003)(5250100002)(54906003)(33896004)(102836004)(81166006)(6506007)(7736002)(59450400001)(3846002)(478600001)(99286004)(31696002)(316002)(476003)(11346002)(486006)(76176011)(2906002)(105586002)(5660300001)(6486002)(229853002)(93886005)(6512007)(186003)(106356001)(31686004)(6246003)(53936002)(66066001)(53546011)(9686003)(6116002)(6916009)(26005)(54896002)(39060400002)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR02MB2202;H:DM5PR02MB3243.namprd02.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:DM5PR02MB2202; x-ms-traffictypediagnostic: DM5PR02MB2202: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(158342451672863)(192374486261705); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231232)(944501410)(52105095)(3002001)(10201501046)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR02MB2202;BCL:0;PCL:0;RULEID:;SRVR:DM5PR02MB2202; x-forefront-prvs: 0654257CF5 received-spf: None (protection.outlook.com: zend.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 0o2iACn9oQ0+fC52RzB+tt2aiy8zxizNcxhsYP2M7hiffGqBINma+Luzmdk1vC8U8FvbM+MOGswV/tsWCMgO4euxO+aQH8IyWSk1RBNqbWoOTdNxTuNM1Pffoa16awlwAOUuTvvIOsIlodExJwnehNgsQENa/+iZZqHV9PsjtQFaKbMyQMznVAyhLPanUxad spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_6760eb1f434548d2a5c2727cd98e3ac2emailandroidcom_" MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: d50a85ff-8e7d-456b-2b88-08d5ab57ac17 X-OriginatorOrg: zend.com X-MS-Exchange-CrossTenant-Network-Message-Id: d50a85ff-8e7d-456b-2b88-08d5ab57ac17 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Apr 2018 09:25:37.9247 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 32210298-c08b-4829-8097-6b12c025a892 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR02MB2202 Subject: Re: [PHP-DEV] PHP FFI extenesion From: dmitry@zend.com (Dmitry Stogov) --_000_6760eb1f434548d2a5c2727cd98e3ac2emailandroidcom_ Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: quoted-printable hi Michael, On Apr 26, 2018 10:31 AM, Michael Wallner wrote: Hey Dmitry! On 17/04/18 09:29, Dmitry Stogov wrote: > hi Michael, > > it's pitty, I didn't found this extension before. > thanks for pointing, I'll definetly take a look. Did you have a chance to look at it yet? Yeah. I took a look through API and implementation, but didn't try to use i= t in action. I exited by the amount of work you did, and see advantages in your approach= , but in general, I like to provide a bit different thing. Acttually, my FFI extension inspired by LuaJit implementation (copied by Py= thon cffi ABI mode). I prefer exteremely simple API, simple and compact implementation. I especi= ally, selected run-time binding, because plan to integrate FFI with JIT (ma= in advantage of LuaJit). [see below] > I, also, like the idea of preloading ffi definitions on startup, but I > would prefer to allow preloading any php files. Especially for FFI, PHP > wrappers would able to hide dangerous implementation details. > I'm not sure the one depends on the other, and how would that be different to opcache? With PSI everything related C is encapsulated, you cannot change anything regarding the access or calling scheme at runtime. I admit, PSI is far away from being optimized or even finished yet, but there are a few important key differentiation points: - the system administrator controls FFI - parses C headers, no need to duplicate declarations - function call and data access is pre-defined, not at runtime Yeah. I see these differences. Reuse of system headers is definitely a big = advantage. Pre-loading and absence of run-time definition, is good from security poin = of view, but makes usage a bit more complex. The thing, I don't like, is a = special binding language. Most probably, both FFI and PSI might be better, taking ideas from the othe= r... Did you use PSI with some complex libraries? Thanks. Dmitry. -- Regards, Mike Hey Dmitry! On 17/04/18 09:29, Dmitry Stogov wrote: > hi Michael, > > it's pitty, I didn't found this extension before. > thanks for pointing, I'll definetly take a look. Did you have a chance to look at it yet? > I, also, like the idea of preloading ffi definitions on startup, but I > would prefer to allow preloading any php files. Especially for FFI, PHP > wrappers would able to hide dangerous implementation details. > I'm not sure the one depends on the other, and how would that be different to opcache? With PSI everything related C is encapsulated, you cannot change anything regarding the access or calling scheme at runtime. I admit, PSI is far away from being optimized or even finished yet, but there are a few important key differentiation points: - the system administrator controls FFI - parses C headers, no need to duplicate declarations - function call and data access is pre-defined, not at runtime -- Regards, Mike --_000_6760eb1f434548d2a5c2727cd98e3ac2emailandroidcom_--