views:

85

answers:

1

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?

+2  A: 

I don't know Vala, but if you can call native code, declare C structures and pass them as pointers to said native code, and define functions that use C calling conventions, it should be possible. But it will certainly be easier to do it in C/C++.

Edit: its homepage says

valac produces C source and header files from Vala source files as if you've written your library or application directly in C. Using a Vala library from a C application won't look different than using any other GObject-based library. There won't be a vala runtime library and applications can distribute the generated C code with their tarballs, so there are no additional run- or build-time dependencies for users.

So, although this is not definitive, I'd say you probably can.

Artefacto