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:
')
- The code can be compiled, performance will increase and memory consumption will decrease.
- Some important level of protection appears.
- Code exported as C extension
PHP generation:
- PHP will run wherever php itself is available (shared hosting, restricted servers, other PHP implementations)
- The code is exported as a library in PHP
Using C extensions:
- In production, when performance is required and installation of the extension is feasible
Using PHP:
- Development / Testing, other PHP implementations
Possible cons
- C-code blocks cannot be transferred to PHP
- Integration with C-libraries cannot be exported to PHP
- Possible incompatibilities due to different execution environments (can be resolved using tests)
Looking forward to your comments.