Is it possible to create PHP extensions in Haskell?

荒凉一梦 提交于 2019-12-05 00:20:01

You can certainly do this, though I'm not sure anyone has tried. Haskell interoperates with C via its FFI mechanism, and you can certainly:

so if you can call C from PHP, and that C calls Haskell, you're in business.


Why would you want to do this? Faster, safer, simple code for your core algorithms or safety-critical code, perhaps. Or to take advantage of say, a parallel or multicore server backend via Haskell.

Yes, its possible. Just make sure you wrap everything and translate arguments between php -> c -> haskell and the way back correctly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!