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 <poll...@php.net> wrote:
>> On Fri, Oct 19, 2018 at 3:17 AM Dmitry Stogov <dmi...@zend.com> wrote:
>>> I would like to start discussion on a Preloadng RFC 
>>> https://wiki.php.net/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#L56
> [4] https://github.com/m6w6/ext-psi/blob/master/tests/sqlite/sqlite001.phpt
>
>
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

Reply via email to