PHP 成为提前编译语言?

PHP to become ahead of time compiled language?

我探索了 PHP 的历史和名字 Personal Home Page。 简而言之,我发现了什么:

Dealing with gcc, make or ld for Web developers was not fun. To create web pages (Personal Home Pages) they found recompiling each time is complex.

这就是为什么 PHP 我们编写的内容会被解释(即使是我们有中间字节码的 HHVM)。

您是否发现任何技术问题,提前编译 PHP 是否明智?有什么计划吗?

PS。我希望 PHP 提前(预编译),而不是 JIT。


更新:

我发现项目 php-compiler 支持“提前”编译器选项。

Compile - Ahead Of Time Compilation

This compiler mode actually generates native machine code, and outputs it to an executable. This means, that you can take PHP code, and generate a standalone binary. One that's implemented without a VM. That means it's (in theory at least) as fast as native C. Well, that's not true. But it's pretty dang fast.

当Python代码第一次被调用时,它(通常)是parsed/interpreted一次转换为字节码并保存在.pyc文件中然后执行。下次调用代码时,会在 .pyc 文件中找到提前解释的字节代码并执行。

对于PHP,自PHP 5.5 以来,已包含一个opcode cache。当 PHP 代码第一次被调用时,它(通常)是 parsed/interpreted 一次进入字节码并保存在操作码缓存中然后执行。下次调用代码时,会在操作码缓存中找到提前解释的字节码并执行。

字节代码在性能上与本机代码足够接近。 Python 或 PHP 都没有太多动机提前编译为原生。你会放弃快速的编辑-保存-重新加载-浏览器开发周期以获得不必要的性能提升。