Is it possible to develop a functional language based on PHP opcode?
Similar to Scala/bytecode or F#/CIL
Has somebody done this already?
|
Is it possible to develop a functional language based on PHP opcode? Similar to Scala/bytecode or F#/CIL Has somebody done this already? |
|||||
|
|
As PHP opcodes and the functional languages you listed are Turing Complete the answer is trivially, yes, it is possible. It may be more interesting though to ask if anyone has done this already. After a bit of search on google and a few online code repositories there do seem to be people dabling in functional PHP http://www.sitepoint.com/the-state-of-functional-programming-in-php/ however I don't see anything approaching a new language implemented in opcodes. |
||||
|
|
|
As @jk. writes, since PHP opcode is Turing Complete it's definitely possible. But you should keep in mind that the Zend Engine is developed and optimized with only PHP in mind and it's not supposed to be a virtual machine that supports other languages. AFAIK no one has proposed building a new language for the Zend Engine, functional or not. What you may find interesting though is the Parrot VM, which supports PHP (via Pipp) and a long list of other languages, including the nearly pure esoteric functional language Unlambda and Arc, a dialect of Lisp. On Parrot's functional support, Wikipedia tell us:
PHP does provide some functional concepts, like anonymous functions, but I don't think it would be practical to consider building a functional language on top of the Zend Engine. |
|||||||||
|