Giter Club home page Giter Club logo

Comments (7)

landall avatar landall commented on May 25, 2024

今天初步读了一下代码,我发现这个项目似乎是用C++重写了整个php解析器?
然后我没找到zend虚拟机,是自己重新实现了vm还是我看漏了?

from polarphp.

xywf221 avatar xywf221 commented on May 25, 2024

今天初步读了一下代码,我发现这个项目似乎是用C++重写了整个php解析器?
然后我没找到zend虚拟机,是自己重新实现了vm还是我看漏了?

这个项目最初是有zend vm的,作者现在移除了zend vm准备用c++重写整个php解析器!

from polarphp.

landall avatar landall commented on May 25, 2024

原来如此。有一个最近注意到的问题,算是给项目一点建议吧。
在多线程支持方面,目前所有的线程库都没办法让线程继承当时的zend环境,所以对autoload非常不友好,常量也会有失效。所以实现架构时我建议能把所有zend虚拟机的状态变成可持久化的。
另外php现在非常缺乏类似于liblua这样的场景,所以尽量减少核心部件的动态库依赖,尽量静态编译。毕竟文件尺寸对于现在的应用来讲阻碍已经很小了。

from polarphp.

landall avatar landall commented on May 25, 2024

另外扩展库方面的损失,可以通过直接import 普通dll的方式补上,这样有一块市场可以快速占据,就是php作为嵌入式脚本语言的市场,这块跟lua python有的打的。最近写c++程序郁闷死了,恨不得直接嵌入个php vm……

from polarphp.

xywf221 avatar xywf221 commented on May 25, 2024

另外扩展库方面的损失,可以通过直接import 普通dll的方式补上,这样有一块市场可以快速占据,就是php作为嵌入式脚本语言的市场,这块跟lua python有的打的。最近写c++程序郁闷死了,恨不得直接嵌入个php vm……

线程问题这个还得具体等测试版本出来才好说,静态编译这东西我估计作者应该不会去搞,涉及东西太多。我对 php的扩展库一直有俩难题: 不会写、不好编译尤其是windows下,我看作者的下一步想法是使用gyp,我也期望作者可以简化扩展库的编写难度。

from polarphp.

landall avatar landall commented on May 25, 2024

另外扩展库方面的损失,可以通过直接import 普通dll的方式补上,这样有一块市场可以快速占据,就是php作为嵌入式脚本语言的市场,这块跟lua python有的打的。最近写c++程序郁闷死了,恨不得直接嵌入个php vm……

线程问题这个还得具体等测试版本出来才好说,静态编译这东西我估计作者应该不会去搞,涉及东西太多。我对 php的扩展库一直有俩难题: 不会写、不好编译尤其是windows下,我看作者的下一步想法是使用gyp,我也期望作者可以简化扩展库的编写难度。

php扩展库的难点在于,它不是提供了接口然后让大家各自写,而是渗透了一堆宏。。。然后没文档。。。如果是像JNI那样的话,其实也不难。。。

静态编译其实不麻烦,把所有文件全link到一起去就行了。php现在的代码是默认做dllexport的,把这个标记去掉就行了,不影响结果的。

from polarphp.

xywf221 avatar xywf221 commented on May 25, 2024

另外扩展库方面的损失,可以通过直接import 普通dll的方式补上,这样有一块市场可以快速占据,就是php作为嵌入式脚本语言的市场,这块跟lua python有的打的。最近写c++程序郁闷死了,恨不得直接嵌入个php vm……

线程问题这个还得具体等测试版本出来才好说,静态编译这东西我估计作者应该不会去搞,涉及东西太多。我对 php的扩展库一直有俩难题: 不会写、不好编译尤其是windows下,我看作者的下一步想法是使用gyp,我也期望作者可以简化扩展库的编写难度。

php扩展库的难点在于,它不是提供了接口然后让大家各自写,而是渗透了一堆宏。。。然后没文档。。。如果是像JNI那样的话,其实也不难。。。

静态编译其实不麻烦,把所有文件全link到一起去就行了。php现在的代码是默认做dllexport的,把这个标记去掉就行了,不影响结果的。

这个我就不太懂了,等测试版本吧。现在每次编译都需要docker,有时候把他那些编译脚本不用手动拿出来编译还报错~~

from polarphp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.