Is it possible to translate everething written in OCaml to PHP? for example will it be hard to translate such lib as lib for Fast content-aware image resizing
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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).