Описание тега zephir
Zephir Language
Zephir - Ze(nd Engine) Ph(p) I(nte)r(mediate) - is an open source high level language that eases the creation and maintainability of C-extensions for php.
Zephir extensions are exported to C code that can be compiled and optimized by major c compilers such as gcc/ clang/ vc++. Functionality is exposed to the php language.
Zephir aims for near full interoperability with existing php code.
Main features:
- Both dynamic/static typing
- Reduced execution overhead compared with full interpretation
- Restricted procedural programming, promoting OOP
- Memory safety
- Ahead-of-time compiler
Compiler design goals:
- Multi-pass compilation
- Type speculation/inference
- Allow runtime profile-guided optimizations
- Allow pseudo-constant propagation
- Allow indirect/virtual function inlining
Installation
xx is the parser for the language:
Requirements:
json-c re2c
Installation on Ubuntu
sudo apt-get install libjson0 libjson0-dev libjson0-dbg
sudo apt-get install re2c
Once you have the required packages installed, you can generate the parser as follows:
./generate
Usage
Compile the extension:
./zephir
The code produced is placed in ext/, there you can perform the standard compilation:
cd ext/
sudo ./install
The code is maintained on Github
Zephir is going to be the language that will drive the development of phalcon 2.0 ( http://www.phalconphp.com/en/)
Support
Due to the fact that the language is very young, support is not offered at this point. General questions can be posted in the Phalcon Forum.