From PHP to Machine Code
summary
Built a small PHP interpreter called piHP in Python that implements a usable subset of PHP, adds full Unicode string support, and uses PyPy JIT to speed hot loops — benchmarks claim about 3–5× faster than PHP 5.6 and competitive with PHP 7 on the tested microbench. It explains opcodes and how opcode cache simply skips parsing and bytecode generation. Also prototypes piyush pjs by compiling Python→C→JavaScript to run PHP in Node/browser; it works but is orders of magnitude slower (example: 24s vs 1s).
AI-written summary · about
chapters (7)
- 0:00Start
- 2:09COMPILERS TRANSLATE SOURCE CODE TO EXECUTABLE INSTRUCTIONS
- 13:17Opcode represents one operation in the VM, comparable to assembler commands
- 25:15SPECIALIZED CODE IS FAST
- 28:47AUTOMATIC SPECIALIZATION - JIT
- 40:58The Birth & Death of JavaScript
- 41:42QUESTIONS?








