Search code examples
phpgccphp-extensionvala

How Do I Make a PHP Module with the Vala Programming Language?


This new language called Vala, which is said to be C#-like and supposedly easier than C++ or C, compiles down into C on Linux with the GCC compiler.

Sounds great. Now I want to use it to make a PHP extension module so that slow PHP code can be made in Vala and imported into PHP as a function.

How do I accomplish this in Vala? Is it even possible?


Solution

  • You need to use or write (if it doesn't exist) a VAPI file for the C library you need to use. It's quite easy, you just need to watch at the existing examples: http://live.gnome.org/Vala/Bindings or simply: http://git.gnome.org/browse/vala/tree/vapi