On 11 November 2013 02:40, Colomban Wendling <lists.ban@herbesfolles.org> wrote:
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.

Yes, what I tried to express was that the problem is the design and organisation of Geany, and just changing the language won't change that without an actual effort to do so.  But thats not the subject here so I'll start another thread for it.

 

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.

Interesting that you say that, I proposed exactly the opposite based on being able to define the APIs of existing leaf C code in vala and a vala skeleton/infrastructure/framework (choose your preferred term :) is guaranteed to be able to call them.  Whereas I thought that adding Vala at the leaves meant you had to make the Vala API match the existing C one or you had to change the existing C code to match the Vala API.  In the first case you don't get the full Vala benefit as you say [2].  In the second case if the C core calling Vala has to change so it might as well be done in Vala in the first place, but that of course increases the size of each change.
 

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.

Yes, it makes the way I proposed less progressive I suppose, the vapis need defining and maintaining.


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.

That should always work for Linux, but there is always the Windows issue.

Cheers
Lex

 [2] and if you are using Vala to mimic existing C interfaces then you are constrained in some of its features as I understand it.  For example Vala "exceptions" require an Error return in the function signature, which our existing C functions don't have.


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 :)
_______________________________________________
Devel mailing list
Devel@lists.geany.org
https://lists.geany.org/cgi-bin/mailman/listinfo/devel