4

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?

DaveRandom
  • 87,921
  • 11
  • 154
  • 174
Darrell Brogdon
  • 6,843
  • 9
  • 47
  • 62
  • Yes. But I think the real question is how much expertise in `c` and language design would you need to pull it off... – gahooa Jan 06 '10 at 18:01
  • I would think you'd need more expertise in C than language design. The benefit of the Zend Engine is that it would provide all the syntax for you already. If you wanted to mimic full PHP functionality you'd have to implement all the modules in PHP itself rather than C. – Darrell Brogdon Jan 06 '10 at 18:46

1 Answers1

5

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.

mishmash
  • 4,422
  • 3
  • 34
  • 56