开发者

Is it possible to translate everething written in OCaml to PHP?

开发者 https://www.devze.com 2022-12-26 15:58 出处:网络
Is it possible to translate everething written in OCaml to PHP? for example will it be hard to translate such lib 开发者_JS百科as lib for Fast content-aware image resizing Short answer, yes, long answ

Is it possible to translate everething written in OCaml to PHP? for example will it be hard to translate such lib 开发者_JS百科as lib for Fast content-aware image resizing


Short answer, yes, long answer yes, but it might be difficult. In this particular case the author translated code from Python (code found here) into OCaml. Additionally you can read the paper that presents the algorithm here (pdf link). Given that you have two implementations and access to the paper describing the algorithm I'd say guess that it won't be difficult to implement in PHP.

That said, OCaml is a compiled language and will run a lot faster than PHP. The Python implementation uses a lot of C libraries to speed it up (and is still half as fast as the OCaml implementation).

0

精彩评论

暂无评论...
验证码 换一张
取 消