📜 ⬆️ ⬇️

Rethinking Zephir

After several months of working on Zephir, we are very pleased with the progress. Within a few months we will release the beta version and will be able to use all its features. The project has collected over 1000 commits and still a lot needs to be done. The project allowed us to do more computer science research and it was very interesting for us.
In addition, although we are not sure about what will happen with PHP in the future, one way or another, we are creating a tool that allows you to use another PHP feature (C extensions), which previously was only available to experienced C programmers.
Also in Zephir, we implemented the features that many dreamed of, but for one reason or another they are not in PHP now:



We believe that all this will help us improve the framework and can help you in creating your own tools in a new way. Not everyone needs these features and not everyone agrees with them, but somehow we hope that one day they will end up in PHP. Whatever happens, we hope that PHP will continue to evolve despite the path.
Zephir was originally conceived as a high-level language that creates an abstraction over the low-level details of the PHP core. It generates C code, which can later be compiled by popular compilers such as gcc / clang / vc.
Since Zephir is a high-level language, it can work as a meta-language, and not just DSL .
After some deliberation, I created this topic to discuss with you a new idea.
If we redo Zephir so that it can generate both PHP and C code, then Zephir will become more powerful and flexible.

Generation C:
')


PHP generation:



Using C extensions:


Using PHP:



Possible cons



Looking forward to your comments.

Source: https://habr.com/ru/post/212975/


All Articles