tami: ... a framework ... might be viewed as a ... extension to PHP

Beitrag lesen

hi 1UnitedPower,

Das klingt total aufregend, ist aber im Endeffekt keine große Errungenschaft. Die reinen PHP-Extensions bieten keinen qualitativen Mehrwert. Es wird dadurch nicht möglich, neue Sprach-Features zu entwickeln, wie es etwa mit Makros gehen würde. Es gibt auch keine exklusiven, privilegierten APIs, die nur Extensions zur Verfügung stehen (oder?). Der enzige echte Unterschied zu eine 0815-Bibliothek ist, dass PHP-Extensions zusammen mit HHVM kompiliert werden. Diese mitkompilierten Funktionen stehen dann immer und überall in der HHVM-Umgebung zur Verfügung. Die Funktionen müssen also weder manuell noch durch einen Autoloader geladen werden.

https://github.com/facebook/hhvm/wiki/Extension-API

»»

Jo: [TC 26:22] – “With HHVM you can write php extensions in PHP. So with PHP you can easily extend the core of the language, but you have to write C-code to do that. With HHVM you can actually write PHP extensions in PHP. There is a [...] is a library that allows you to perform native calls. And if you look at the HHVM which is open source it’s available on git hub they have the file info extension for example. And I think a few others are written in PHP. You can actually read the PHP code of the PHP-extension. That’s very very interesting. Because if you think about all those frameworks: what do frameworks do? Frameworks add layers of abstraction to make things easier for developers. [...] Abstraction means: it will get slower. The more abstraction there is, the more complexity, the more stuff you need to do at runtime. Now in a compiled language we might actually have the abstraction in the source code which makes it more readable and more maintainable to us. But we can optimize out those abstractions before we execute the code. There are some approaches doing that in PHP as well [...] Zend had the PHP-Optimizer [...] (discontinued?) [...] I think that optimizing byte-code or PHP-code or what ever code while you compile it is a very very appealing concept. With a traditional interpreted language you can’t really do that. Because you don’t know how much time you are going to spend optimizing it. And if you do it in the execution step you will probably not end up with a runtime benefit. (If you do it) in the compilation step and compile up front optimizing becomes very appealing. And well with the HHVM and the hiphop-approach I think optimizing might be easier to do because you have a lower level language which is easier to understand from a technical point of view not from humanid point of view so its probably easier to optimize. I think this might be a killer feature. Because a framework suddenly might be viewed as a kind of extension to PHP as a kind of library. Some framework developers say: “You know we as frameworks we provide abstraction from the actual language, so if the language changes and evolves, you don’t need to modify your applications.” And there are a lot of possibilities in that.”  [TC 29:13]
mfg

tami