Content deleted Content added
→Generated code?: the reason for vala is to generate C code, so the generated C isn't just an interesting technical detail |
→C++: Pro 2 is only a pro in that wrapping can make the API OOP, where as C++ can call the C API as is. |
||
Line 38:
* Vala generates C code that relies on GLib/GObject for it's object system. Benchmarks show that generated Vala code is generally as fast or faster than hand-coded C++ (see link at bottom of article).
* Vala also makes it extremely easy to use external C libraries: you just have to wrap the header in a Vala API file (called a VAPI), and declare what functions you'll be using. There are already a bunch of VAPIs for GNOME related stuff like libglade and gstreamer.
** I think it's worth pointing out that C++ can call the C libraries without any need to wrap the API in most cases. Vala just makes it easy to wrap the C API to fit into Vala's OOP style. [[User:Losinggeneration|Losinggeneration]] ([[User talk:Losinggeneration|talk]]) 10:01, 27 February 2009 (UTC)
* Vala also makes it easy to write C libraries -- you can use Vala to write libraries, compile them to C files, then distribute the C files. Vala can even generate a VAPI for the library along with the C files, so that you can use the compiled library from Vala -- i.e., you can use Vala to write a C library that can be used from any application with a C ABI and natively from Vala itself (the tutorial shows an example of this near the bottom).
* Since it is so tightly coupled with Glib/Gobject it obviously make it easier working with libraries that also use GLib/GObject.
|