Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Regarding PHP specifically, the interpreter's opcodes are all described in a meta language, and the actual PHP interpreter can be code-generated in 4 different styles depending on what is fastest for the target C compiler.

See ZEND_VM_KIND_CALL / SWITCH / GOTO / HYBRID in php-src/Zend/zend_vm_gen.php



Even more wild is the JavaScriptCore bytecode VM which is written in a Ruby DSL which is either compiled to C or directly to ASM.

I'm jealous we don't have something like this for CRuby!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: