Le 10/11/2013 05:44, Matthew Brush a écrit :
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. [...]
Well… it's a little complicated. I agree that features from a higher-level language could help, it being C++, Vala or something. It's definitely shorter to write some things in those languages than in C, and memory management is definitely easier. I see one advantage in Vala over C++: that it actually is C ([1]), just like our current code.
I agree that Vala would help if we want to port the code to something more OOP-style -- since obviously the language supports it by itself. I agree it's probably a good idea. But the port won't happen magically.
The problem I see is that using C from Vala requires a more or less manual interfacing, even if quite easy to write. This adds actual complexity. We could try by porting leaf modules to Vala and see (maybe utils?) -- since calling Vala API from C is native --, but it's probably not the modules that would benefit the most from the language.
To sum up, my point is that having more than one language might add too much of a glue layer for it not to weight down the idea.
Sorry Matthew, but it's kind of an "I like Vala but I don't know" :)
- 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).
Not to mention bugfixes in bindings, that are much less frequent today but weren't rare a dozen months ago or something.
- 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).
I think Vala supports targeting a particular GLib version for what it itself generates (vs. what API you explicitly use in your own code), so it may not be an issue. And I think e.g. GTK is just a lib to Vala's eyes, so you just have to use the part of it that match your preferred version, just like we already do.
Regards, Colomban
[1] so allows to keep full C compatibility without only using an uninteresting subset of the language, unlike the C++ discussion suggested, which was basically "use C++ but nothing in headers that's not C compatible, so excluding classes, and much of the interesting stuff in C++". If you wanna continue on this, use another thread :)