Re: Would it be possible that gtk implementation in C++



In my experience, people get quite fond of a language, and this fondness is a MAJOR reason why a small development team will never rewrite their large project in some other language that some random person requests they drop everything and port to. There are other reasons of course, like the monumental task, years of ironing out bugs, zero gains and substantial losses. People sometimes ask me why I don't rewrite my Perl projects in Python or PHP ( or why I don't port to framework xyz or whatever ), and I always invite them to do such a port and maintain it, but I'm personally not interested in it at all, and will continue hacking in Perl.

I've observed that most Linux software is written in C. For this reason, I've done some C hacking myself, knowing that what I learn I can then apply to a large majority of the software I'd be interested in working on. It's really only QT / KDE that are written in C++, as far as I can tell. It was news to me that gcc have shifted to C++. Damn it, that means I'll have to stick with an old compiler for the next 3 years until it stabalises :/ Anyway I've never considered learning C++, as it just doesn't seem to have much penetration in the circles that I'm interested in.

That's the psychological answer that I believe would apply to a large majority of people you're asking.

Linus' take on C vs C++, for some light humour:
http://harmful.cat-v.org/software/c++/linus


Dan


On Fri, Aug 8, 2014 at 12:39 PM, Jasper St. Pierre <jstpierre mecheye net> wrote:
Rewriting a widely-used library in a new language, breaking all APIs, is not a good idea when we're already struggling to maintain our current codebase. Regardless of whether you like C++ or not, this isn't going to happen. Sorry.


On Thu, Aug 7, 2014 at 10:06 PM, 黄羽众 <ihyzi 163 com> wrote:
Thank you for point out predecessors' question!

I read the question and get some points, but I thinks the situtations change a lot and I am not ask the same question.

1. I am not ask for why GTK choose to implement in C, I know it have some historical reason. I want to make a proposal that gtk could be re-written with c++ just as GCC does. I want to discuss with you whether it is a good idea.

2. Situations change a lot. Back to the time GTK was born, C++ is also very primitive so the developers would rather implement an object-system by hand. But nowadays C++ is stable and have many cool features especially in C++11 and the in-coming C++14. C++'s object-system is becoming more and more complete and add many useful features in GUI development such as exception, multi-threads and so on. I think due to the same reason did GCC turn to C++.

3. Now, from the view of app developers, who are very likely learned C/C++/Java in classes, and learn Python/JS/PHP/Nodejs after class. And very probably have experiences coding with QT, HTML5, Android. They can't be more familiar with OOP and C++. But when they turn to GTK, they have to expand one line in C++ into three or more lines in C. This will threaten many developers. Although there are gtkmm available, but gtkmm didn't gain enough official support and recommend as GTK, and much fewer reference, help, support available. The official recommand is gtk in c rather than gtkmm in c++, so many devlopers read some tutorials and feel threatened and leave. What's worse, gtkmm didn't wrapper all of the gtk featurese. In some complex cases, developers have to use the low level gobj pointer to get things done.


Now is in 2014, It can't be more normal to develop GUI application with OOP style. I think it's time to change.

GTK could be rewritten in C++, and what's more important, GTK should officially recommend to develop apps in C++, which can't be more familiar to GUI developers.


Sent from MEIZU MX

-------- Original Message --------
From:Florian Pelz <pelzflorian googlemail com>
Time:Fri 8/8 05:23
To:gtk-list gnome org
Subject:Re: Would it be possible that gtk implementation in C++

>Hi,
>
>Someone asked this question on Stackoverflow:
>http://stackoverflow.com/questions/9747468/why-was-the-gobject-system-created
>I think they answer it pretty well. Also, C is much closer to the
>hardware and GCC's error messages for C++ are not that great.
>
>On 08/07/2014 10:49 PM, Dub wrote:
>> tbh, the only reason I use GTK is because it is C.
>>
>> While C++ is probably a better choice. C allows you to easier
>> integrate it with pretty much any language of your choosing easily
>> (Vala, Ruby, PHP (lol), Python, Rust, Go, Perl, Lua, _javascript_, etc)
>> that in itself is a really good reason.
>>
>>
>> On Thu, Aug 7, 2014 at 12:22 PM, 黄羽众 <ihyzi 163 com
>> <mailto:ihyzi 163 com>> wrote:
>>
>>     For the past few time, I am using gtkmm to development GUI
>>     application, and I am really enjoy it.
>>
>>     I know that choose C as its implementation language makes gtk gain
>>     a wonderful performance,
>>     but recently GCC turn to C++.
>>     https://gcc.gnu.org/gcc-4.8/changes.html
>>
>>     I think that as a complier which have to think a lot about
>>     performance, it turn to C++ for code elegance and development speed,
>>     a GUI application have no reason to continue using C stuff.
>>
>>     Actually gtk implement a object system as its essential part, that
>>     did prove that GUI application need a object-oriented design.
>>     And C++ could provide this as a language level feaure, needless to
>>     implement it in application code.
>>
>>     So I suggest that it is possible to develop gtk in c++ as
>>     main-line support?
>>
>>     Unlike gtkmm, which is just a wrapper from c++ to c, turn to c++
>>     in main-line means a lot.
>>
>>     GCC choose this and get good result, I think gtk could have a try.
>>
>>
>>
>>     _______________________________________________
>>     gtk-list mailing list
>>     gtk-list gnome org <mailto:gtk-list gnome org>
>>     https://mail.gnome.org/mailman/listinfo/gtk-list
>>
>>
>>
>>
>> _______________________________________________
>> gtk-list mailing list
>> gtk-list gnome org
>> https://mail.gnome.org/mailman/listinfo/gtk-list
>
>
>_______________________________________________
>gtk-list mailing list
>gtk-list gnome org
>https://mail.gnome.org/mailman/listinfo/gtk-list

_______________________________________________
gtk-list mailing list
gtk-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-list




--
  Jasper

_______________________________________________
gtk-list mailing list
gtk-list gnome org
https://mail.gnome.org/mailman/listinfo/gtk-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]