Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make MFFI a pretty big deal #2

Open
sagebind opened this issue Oct 21, 2015 · 6 comments
Open

Make MFFI a pretty big deal #2

sagebind opened this issue Oct 21, 2015 · 6 comments

Comments

@sagebind
Copy link

Hello! I just wanted to create an issue here to discuss the future plans of this project. Personally I'd like to see this fleshed out and made rock-solid to ship as a stable extension right away. This is definitely something PHP lacks, and sorely needs in my opinion.

To go even further, this totally deserves to be in the core. You should consider making this an extension that would look nice as a core set of classes. I'm thinking the goal would be an RFC for PHP 7.1 to adopt the extension into the php-src codebase.

Thoughts? Nice extension, by the way. I'm glad someone else other than me is interested in this.

@hendrikmaus
Copy link

+1

1 similar comment
@afk11
Copy link

afk11 commented Oct 30, 2015

+1

@mgdm
Copy link
Owner

mgdm commented Dec 3, 2015

Hey, sorry, I didn't get a notification for this. I'm glad it's not just me that's interested :-)

I think there's a fair distance to go before it'll be ready for core. Also, I'm not quite sure if it's suited to that. It provides a fair number of ways to do really bad things to your system, so I expect that people might be wary of it. I'm all for proposing it to PECL some day though.

I've not really had a lot of time to play with the code recently. Any assistance you could provide would be great - even if it's just trying it out against your favourite libraries and documenting what works and what doesn't.

I'd like to have Windows support, though I don't currently have access to a machine running it. If that changes, I'll have another look.

@sagebind
Copy link
Author

sagebind commented Dec 3, 2015

Hey, glad you found it anyway!

That's fine; it's better to be stable and optional than sketchy and in the core. However, I'm convinced that the core needs a better FFI story. PHP has some awesome stuff, and has become one of my favorite (general-purpose even) programming languages, especially with all the awesome stuff in PHP 7. It just lacks proper FFI calling, which is keeping it from catapulting into the future, I think.

Not that it's a game of copycat, but languages like Python, Ruby, and Node JavaScript all have better things in place for FFI -- as a result, there's tons of userland bindings for practically everything, which is amazing. The only issue is when the libraries for writing bindings isn't readily accessible. So while putting the extension on PECL would be a huge step in the right direction, I'd still rather put it in the core extensions. That would just be a better out-of-the-box experience for working with external libraries.

So yeah... I think making this extension both more stable, and more talked about, could have pretty significant effects on the future of the language even.

@sagebind
Copy link
Author

sagebind commented Dec 3, 2015

Also, I'd love to help out! I've got some Windows machines to test on (not my primary OS though) and could probably play with the possibility of Windows support.

@m6w6
Copy link

m6w6 commented Apr 19, 2016

Hey, sorry to bust the show here, @mgdm.

I've also been fiddling with an FFI implementation for PHP the last few months. ext-psi takes a rather different approach than MFFI and pecl/ffi, because the FFIs are not specified dynamically (i.e. at runtime) but at PHP startup through a custom DSL (in .psi files).

I'd say give it a try (unless you're on Windows), but I just recently added Travis-CI support and it produces a shitload of crashes on that old Ubuntu, so it may be safer to assume "it's not there, yet" to say "give it a try" :)

Anyway, I'm currently working on more complex input marshaling (i.e. multi dimensional let statements), but that branch hash not been pushed, yet.

I'd appreciate if you checked it out and told me what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants