Is the Zend engine embeddable outside of PHP?
One of the 开发者_开发知识库original designs of the Zend engine, if I recall, was that it was to be relatively easy to embed for other languages one might wish to create. Basically, the PHP syntax without all the PHP modules. Is this still the case?
Well, the Zend Engine is basically a Virtual Machine that interprets PHP bytecode. Basically what you would have to do is create a parser for a language and a compiler and have it compile it into PHP bytecode therefore it could be executed by the Zend Engine.
Now I bet this isn't as easy as it sounds. I think the Zend Engine is pretty tightly intergrated with PHP and seperating it so it would execute your own bytecode could be quite a hassle.
Hope this helps.
精彩评论