Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: GNOME's Git Tool Has Been Ported To Vala

  1. #1
    Join Date
    Jan 2007
    Posts
    13,466

    Default GNOME's Git Tool Has Been Ported To Vala

    Phoronix: GNOME's Git Tool Has Been Ported To Vala

    GitG v0.3.1 has been announced as their first release under the code's major rewrite...

    http://www.phoronix.com/vr.php?view=MTU2MTA

  2. #2
    Join Date
    Nov 2013
    Location
    127.0.0.1
    Posts
    112

    Default

    Why?

  3. #3
    Join Date
    Oct 2007
    Location
    Under the bridge
    Posts
    2,099

    Default

    Because it's easier to write a UI in Vala than in C. It really makes a difference, especially in projects with a small developer base.

  4. #4
    Join Date
    Nov 2013
    Location
    127.0.0.1
    Posts
    112

    Default

    Quote Originally Posted by BlackStar View Post
    Because it's easier to write a UI in Vala than in C. It really makes a difference, especially in projects with a small developer base.
    Yes but they alrealy had the UI, they didn't start a new project
    I don't know, I think rewriting the codebase from C to Vala would be more difficult than just working with gtk+ in C

    Another question: why not some other language? Some gnome projects already use javascript, C# (I think) and Python. Why vala over them?
    Last edited by Annabel; 01-06-2014 at 05:11 AM.

  5. #5
    Join Date
    Oct 2007
    Location
    Under the bridge
    Posts
    2,099

    Default

    Quote Originally Posted by Annabel View Post
    Yes but they alrealy had the UI, they didn't start a new project
    I don't know, I think rewriting the codebase from C to Vala would be more difficult than just working with gtk+ in C
    You'd be surprised

    For low-level code, the difference is not so significant, but for a UI it's huge. Given that they were planning to rewrite the core, anyway, to use libgit2 instead of system("git blah") commands, someone did the crazy step of rewriting the whole thing in a simpler language.

    Now that this is done, I expect GitG development to speed up considerably.

  6. #6

    Default

    Quote Originally Posted by Annabel View Post
    Another question: why not some other language? Some gnome projects already use javascript, C# (I think) and Python. Why vala over them?
    My guess is that it is because it gives best performance, lowest memory usage, fewest runtime dependencies compared to the others, while still being a nice (enough) high level language for UI coding.

    I have the impression that those who would have picked javascript, C# or python would have done that because that is what they are familiar with.

    I would have picked vala too for this job.

  7. #7
    Join Date
    Nov 2013
    Posts
    68

    Default

    Quote Originally Posted by BlackStar View Post
    For low-level code, the difference is not so significant, but for a UI it's huge.
    I would even say for low-level code, especially if we are talking about libraries.

    You get to work with a nice high-level language, yet your result is ultimately a library with a C API.

    Cheers,
    _

  8. #8
    Join Date
    Oct 2007
    Location
    Under the bridge
    Posts
    2,099

    Default

    Quote Originally Posted by anda_skoa View Post
    I would even say for low-level code, especially if we are talking about libraries.

    You get to work with a nice high-level language, yet your result is ultimately a library with a C API.

    Cheers,
    _
    Can you actually create a library in Vala and consume it from C without jumping through too many hoops? Like, can you create a C header to describe a Vala interface in some sort of automated fashion?

    If so, then that's massively impressive.

  9. #9
    Join Date
    Nov 2013
    Posts
    68

    Default

    Quote Originally Posted by BlackStar View Post
    Can you actually create a library in Vala and consume it from C without jumping through too many hoops? Like, can you create a C header to describe a Vala interface in some sort of automated fashion?
    Yes
    If you create a library in Vala, the build process will generate both a Vala API description as well as a "public" C header (public as in "will be installed on make install").

    Quote Originally Posted by BlackStar View Post
    If so, then that's massively impressive.
    Indeed! If I had vote for a single feature for "the best feature", that would be it.

    Once you understand how the name mapping works (how Vala namespace/class/function names are translated into C symbol names) you could use Vala to write drop-in replacements for bascially any GObject library.

    Cheers,
    _

  10. #10
    Join Date
    Oct 2007
    Location
    Under the bridge
    Posts
    2,099

    Default

    Quote Originally Posted by anda_skoa View Post
    Yes
    If you create a library in Vala, the build process will generate both a Vala API description as well as a "public" C header (public as in "will be installed on make install").



    Indeed! If I had vote for a single feature for "the best feature", that would be it.

    Once you understand how the name mapping works (how Vala namespace/class/function names are translated into C symbol names) you could use Vala to write drop-in replacements for bascially any GObject library.

    Cheers,
    _
    I'm intrigued.

    GObject is a tad too heavy for my current C projects (massively parallel, real-time embedded stuff), but I'll definitely have to take a closer look to Vala now. A tool that generates a proper C API from higher level code sounds mighty attractive.

    Indeed, roughly one-third of the code in these projects is boilerplate code: API headers, parameter contracts, argument validation, variable initialization, logging, namespace_object_create(), namespace_object_destroy() etc etc. Maintaining all these by hand is awkward, but you have to be extremely defensive or you won't get far in such a complex project without an operating system to protect you.

    Other than memory overhead, Vala appears to hit all the right spots so far!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •