Re: [PHP-DEV] PHP FFI extenesion

2018-04-27 Thread Dmitry Stogov
internals list Subject: Re: [PHP-DEV] PHP FFI extenesion Hi Michael, I've, also, tried to implement FFI definition pre-loading (currently just H files). I spent just two hours and implementation misses a lot of details, but it looks like this may work with FFI extension almost out of th

Re: [PHP-DEV] PHP FFI extenesion

2018-04-26 Thread Dmitry Stogov
ki (a...@php.net); PHP internals list Subject: Re: [PHP-DEV] PHP FFI extenesion Hey! > On 26 04 2018, at 20:47, Dmitry Stogov wrote: > > Hi Michael, > > > I've just tried to run PSI with php-master (32-bit DEBUG build) and got > SIGSEGV on the simplest test. > > Use &quo

Re: [PHP-DEV] PHP FFI extenesion

2018-04-26 Thread Michael Wallner
> On 26 04 2018, at 11:25, Dmitry Stogov wrote: > > > Did you use PSI with some complex libraries? Define complex. There’s a working sqlite test (quite simple use case for sqlite, though): https://github.com/m6w6/ext-psi/blob/master/tests/sqlite/sqlite001.phpt

Re: [PHP-DEV] PHP FFI extenesion

2018-04-26 Thread Michael Wallner
Hey! > On 26 04 2018, at 20:47, Dmitry Stogov wrote: > > Hi Michael, > > > I've just tried to run PSI with php-master (32-bit DEBUG build) and got > SIGSEGV on the simplest test. > > Use "psi.d/string.psi" and attemt to call psi\strerror(10) > > > #0 0xf44916ba in psi_call_frame_parse_arg

Re: [PHP-DEV] PHP FFI extenesion

2018-04-26 Thread Dmitry Stogov
natol Belski (a...@php.net); PHP internals list Subject: Re: [PHP-DEV] PHP FFI extenesion 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. >

Re: [PHP-DEV] PHP FFI extenesion

2018-04-26 Thread Dmitry Stogov
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

Re: [PHP-DEV] PHP FFI extenesion

2018-04-26 Thread Michael Wallner
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 p

Re: [PHP-DEV] PHP FFI extenesion

2018-04-17 Thread Michał Brzuchalski
April 17, 2018 10:51:32 AM > > *To:* Dmitry Stogov > *Cc:* Stanislav Malyshev; Zeev Suraski; Xinchen Hui; Nikita Popov; Bob > Weinand; Anatol Belski (a...@php.net); PHP internals list > *Subject:* Re: [PHP-DEV] PHP FFI extenesion > > > > 2018-04-17 9:46 GMT+02:00 Dmitry Stogov

Re: [PHP-DEV] PHP FFI extenesion

2018-04-17 Thread Dmitry Stogov
ov Cc: Stanislav Malyshev; Zeev Suraski; Xinchen Hui; Nikita Popov; Bob Weinand; Anatol Belski (a...@php.net); PHP internals list Subject: Re: [PHP-DEV] PHP FFI extenesion 2018-04-17 9:46 GMT+02:00 Dmitry Stogov mailto:dmi...@zend.com>>: Hi Michal, I didn't think in this way. I liked to m

Re: [PHP-DEV] PHP FFI extenesion

2018-04-17 Thread Michał Brzuchalski
ead. > > > Thanks. Dmitry. > -- > *From:* Michał Brzuchalski > *Sent:* Tuesday, April 17, 2018 10:24:02 AM > *To:* Dmitry Stogov > *Cc:* Stanislav Malyshev; Zeev Suraski; Xinchen Hui; Nikita Popov; Bob > Weinand; Anatol Belski (a...@php.net); PHP inte

Re: [PHP-DEV] PHP FFI extenesion

2018-04-17 Thread Dmitry Stogov
0:24:02 AM To: Dmitry Stogov Cc: Stanislav Malyshev; Zeev Suraski; Xinchen Hui; Nikita Popov; Bob Weinand; Anatol Belski (a...@php.net); PHP internals list Subject: Re: [PHP-DEV] PHP FFI extenesion Hi Dmitry! I am not much experienced with C but as a user, I'm just wondering if there is a

Re: [PHP-DEV] PHP FFI extenesion

2018-04-17 Thread Dmitry Stogov
hi Michael, it's pitty, I didn't found this extension before. thanks for pointing, I'll definetly take a look. 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 imp

Re: [PHP-DEV] PHP FFI extenesion

2018-04-17 Thread Michał Brzuchalski
Hi Dmitry! I am not much experienced with C but as a user, I'm just wondering if there is a possibility to extend FFI class and autoregister all or just chosen structs as classes, for eg. class Libc extends FFI { public function __construct() { parent::__construct("...code", "...lib");

Re: [PHP-DEV] PHP FFI extenesion

2018-04-17 Thread Dmitry Stogov
On Apr 17, 2018 2:49 AM, Stanislav Malyshev wrote: Hi! > I've spent some time thinking about simple FFI for PHP, and finally, borrowed > most ideas from LuaJIT. > > This is an initial PoC. It was tested on Linux only. > > > https://github.com/dstogov/php-ffi > > > I would appreciate review, co

Re: [PHP-DEV] PHP FFI extenesion

2018-04-16 Thread Michael Wallner
Hi! Nice that FFI is of interest again, so may I kindly point you to ext-psi? https://github.com/m6w6/ext-psi It follows a different approach, though, that it requires definition files on startup, not at runtime. Basically: $ cat >time.psi < /* time_t time(time_t *tloc); man 2 time */ function

Re: [PHP-DEV] PHP FFI extenesion

2018-04-16 Thread Stanislav Malyshev
Hi! > I've spent some time thinking about simple FFI for PHP, and finally, borrowed > most ideas from LuaJIT. > > This is an initial PoC. It was tested on Linux only. > > > https://github.com/dstogov/php-ffi > > > I would appreciate review, comments and ideas about missing features and > fu

Re: [PHP-DEV] PHP FFI extenesion

2018-04-13 Thread Levi Morrison
On Fri, Apr 13, 2018 at 7:27 AM, Dmitry Stogov wrote: > I've spent some time thinking about simple FFI for PHP, and finally, borrowed > most ideas from LuaJIT. > This is an initial PoC. It was tested on Linux only. > > https://github.com/dstogov/php-ffi > > I would appreciate review, comments and

Re: [PHP-DEV] PHP FFI extenesion

2018-04-13 Thread Dmitry Stogov
ov Cc: Zeev Suraski; Xinchen Hui; Nikita Popov; Bob Weinand; Anatol Belski (a...@php.net); PHP internals list Subject: Re: [PHP-DEV] PHP FFI extenesion 2018-04-13 16:27 GMT+03:00 Dmitry Stogov mailto:dmi...@zend.com>>: Hi, I've spent some time thinking about simple FFI for PHP, and f

Re: [PHP-DEV] PHP FFI extenesion

2018-04-13 Thread Arvids Godjuks
2018-04-13 16:27 GMT+03:00 Dmitry Stogov : > Hi, > > > I've spent some time thinking about simple FFI for PHP, and finally, > borrowed most ideas from LuaJIT. > > This is an initial PoC. It was tested on Linux only. > > > https://github.com/dstogov/php-ffi > > > I would appreciate review, comments