Hi all,
In the spirit of the previous discussions about using C99 and C++ in Geany code with similar subject lines, I'd like to take a poll/discussion for allowing the use of Vala for new/re-written Geany code. The pros and cons likely will be slightly biased since I would obviously like to use Vala in Geany, but here they are anyway:
Pros:
-----
* Power of high-level OOP language using existing GObject backend with no C boilerplate required
* Uses same type-system as existing C code
* Automatic memory management
* Clean expressive syntax (foreach, as, properties, signals, async, etc.)
* Exceptions (which uses C/GError-style exceptions in generated C code)
* No extra dependency for release users (generated C code can be shipped)
* Can generate Gobject-Introspection bindings automatically allowing use from a bunch of cool languages like Python, JavaScript, etc (and as many other languages as support Gobject-Introspection) for plugins.
* Easy to learn for anyone who's used C++, Java, C#, etc.
* Uses all existing dependencies as its runtime library (ex. GLib/GIO).
* Can generate C/H code that is usable from within existing C code, so no requirement to completely re-write, can just add on modular code as needed.
* Can be tuned to output optimized C code, or call optimized C code quite easily
* Can sometimes generate clever and/or optimized code that would be tedious to write in C.
* Has Autotools and Waf support already, and using from plain GNU Make is trivial.
* Actively developed and supported, and having active mailing list and IRC channels. (ex. it's easier to submit a patch to Vala language than ISO C).
* AFAIK it generates C89-compliant code :)
Cons:
-----
* A fairly new language (since 2006). It's hard to argue against this, but also impossible to move forward without adopting new stuff at some point.
* Some dark corners/bugs due to being such a new language (compared to C/C++).
* Actively developed so sometimes we probably have to require specific valac versions to support certain features (ie. nothing like c89, c99, c++98, etc but not unlike supporting newer G* versions).
* As with above, may require to use fairly modern/specific dependency versions of the G* C libraries (ex. might not work on RHEL or some other LTS distros).
* Extra dependency (valac) for maintainers/developers.
* Using non-GLib-based libraries requires to write boring but trivial binding .vapi files (not huge deal for existing Geany code).
* Can sometimes generate heap-heavy or non-optimized code.
* Can sometimes generate C code that causes warnings with common compiler warning flags, would require to disable some compiler warnings on generated C code to have a completely clean build (ex. use -w on all .vala code)
* The documentation isn't as great as an ISO language that existed since forever. The official language specification isn't as complete or fleshed-out (ex. has TODOs) as an ISO language. There is lots of documentation out there, for example on the official Wiki, but it's still no substitude for definitive language reference and decades of books/literature on the subject.
* More people know C than C++/C#/Java (ie. style of Vala). IMO, this one is untrue since people who use C nowadays are either well-versed embedded programmers who already know the higher-level stuff, C/Gobject/Gtk+ programmers who already know or can easily understand how the higher-level stuff works (ex. by looking at generated C code), high-level-only programmers who for the most part don't need to care about how the underpinnings work and already would know Vala since it's basically C#(/Java), or finally, and I believe the least likely; complete n00bs who would be much safer writing garbage in any high-level language than directly in something like C/C++ anyway.
[...]
Cheers,
Matthew Brush
_______________________________________________
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel