4 ms·
Theoretically, you almost could (with quite a bit of difficulty), but then there's the problem of "eval". You can "solve" that by embedding an interpreter (or
by zbentley 9y ago
Theoretically, you almost could (with quite a bit of difficulty), but then there's the problem of "eval".
You can "solve" that by embedding an interpreter (or a copy of your compiler) into your runtime, but most interpreted platforms in that situation consider the interpreter "good enough" and work on making optimizations (e.g. JIT compilation to native code) on it rather than making a static compiler.
- toast0 9y agoI mean, eval is a thing, and I'm sure people use it, but I don't recall using it much while a PHP developer. It's just more likely to footgun than anything else. I think you can credibly release a tool that will compile PHP into a standalone executable, as long as it doesn't call eval.