gnome-twitch icon indicating copy to clipboard operation
gnome-twitch copied to clipboard

Evaluate a rewrite in Vala

Open vinszent opened this issue 7 years ago • 6 comments

vinszent avatar Sep 29 '16 18:09 vinszent

What was the reason you wrote it in C in the first place? And why are you now thinking about rewriting in vala? Don't get me wrong, I'm all for it. I know plain old C and Gtk+, but C + gobject is something that kept me from writing some code and contributing simple patches from time to time. But rewriting the whole thing seems like a lot of work. Just curious what your motivation behind this is.

jangernert avatar Sep 30 '16 01:09 jangernert

Hello, I would also like to know why you think Vala is worth rewriting gnome-twitch. It would also be awesome to know of other issues or benefits you see moving a fairly large project like gnome-twitch to Vala :)

I'm learning GTK with python myself because C wasn't a language I really wanted to program in, I prefer OOP. I brushed off Vala originally because it seemed specific to GNOME and wouldn't be worth learning for other development. Plus I didn't know how portable it would be to other systems like Windows. I like the OOP aspect of Vala, the fact it converts into C code, and the appearance of Vala; it's a pretty language imo. But I'm still not sure myself if it's worth pursuing, would love to see what your conclusion is. Been following gnome-twitch for a while, great project!

julianrichen avatar Sep 30 '16 03:09 julianrichen

What was the reason you wrote it in C in the first place?

I knew C and had never heard about Vala at the time. Plus GObject is such a beautiful OOP system imo and I was fascinated by it at the time.

And why are you now thinking about rewriting in vala?

I would also like to know why you think Vala is worth rewriting gnome-twitch.

I'm currently writing another GNOME-esque project in Vala (might release it in the near future) and I've had a blast. It ties in really well with GTK+ and the GObject system, no overhead over C and it's super easy to integrate C code anyways.

With most of my projects, I mainly write them for my own consumption. I wrote the first version of GT very quickly in C and threw it up on GitHub for my friends to check out. Now lots of people use it, which was never my original intention :stuck_out_tongue: and I feel I need to rewrite it before it becomes unwieldy and development slows down to a crawl because of it. As much as I like GObject, recently I have spent most of my time writing boiler plate code (I use snippets but it's still a mental overhead) and using Vala would alleviate that.

Vala seems like a good choice because it will be super easy to transition to. Heck I can even keep some C code and just rewrite parts of it as I go. Plus it's an awesome language and everything I would've liked C++ to be.

I don't really think it will take all that much effort or time to rewrite either. I'd honestly give myself a weekend to rewrite the majority of it. Plus it's much easier to do it now than do it later when GT has an even larger codebase.

I haven't fully decided, but I think this is probably the route I will go. Hopefully this answers your questions :+1:

vinszent avatar Oct 01 '16 19:10 vinszent

Well, if you're planing to rewrite the code sooner or later in vala, then better do it sooner than later :) I pretty much share your opinion about vala (I also maintain a vala-gtk-app). And since I use gnome-twitch myself, I would be happy to contribute to it from time to time.

jangernert avatar Oct 01 '16 19:10 jangernert

Don't want to be the one to put a damper on things. But... https://blogs.gnome.org/despinosa/2016/09/30/should-we-drop-vala/

ZachBacon avatar Oct 06 '16 17:10 ZachBacon

@DoctorWho11 Thanks for the link, always good to get some external input!

I read the blog post and he didn't really say anything damning about Vala. He mainly talked about how Vala should be improved in certain areas to keep it "relevant".

Additionally I feel that the author's situation and mine are different. I'm of the position that libraries should be written in C, the lowest common denominator in most cases, and then simply binded to other languages with awesome tools like Swig. So I can see why the author's project might value a rewrite in C. GT on the other hand is a GUI application that no other program will rely on. So I don't need to worry so much about compatibility.

The main reason I've come to Vala is that it really isn't an entire new language and platform. It's really, just like the author wrote, syntactic sugar for C. Vala is built upon well tested libraries like GLib and GObject and is compiled with your standard C compiler. The Vala compiler in reality is just a transpiler of sorts. Vala also removes massive amounts of boiler plate code and streamlines development as well as adding a lot of nice syntactic features. It interops perfectly with C code so I can still write C code, which I will for plugins most likely.

Had Vala been it's own real language with it's own compiler like gcc, I would never consider rewriting GT to it, as obsoleteness can really kill such a language. However pretty much all the key language features are already in place so even if it was dropped today, I wouldn't be so worried. Plus seeing as C, GLib and GObject aren't going to change drastically anytime soon, I'd call Vala a pretty safe bet. If I ever wanted to go back to pure C, it wouldn't be such a big ordeal as say rewriting from Python.

I've already rewritten the majority of the project in a matter of days and I think that Vala is the way to go for easier development in the future.

@jangernert Oh wow! I didn't realise you were the author of FeedReader. It's my default RSS reader but I seem to never to be able to keep up with reading the news :stuck_out_tongue:

vinszent avatar Oct 06 '16 19:10 vinszent