Re: How about adopting Kotlin in GNOME?



On 18/11/17 23:11, Adam Tauno Williams wrote:
On Sat, 2017-11-18 at 14:11 +0000, Tony Houghton wrote:
I've been thinking about what language I should choose if and when I
start writing a significant program using G* libraries. I don't want
to write GObjects in C any more. All that boilerplate, casting
macros, manual set up of vtables and explicit reference counting. I
will make mistakes with it.

I thought I saw that Javascript was going to the language of choice for
GNOME - yet I haven't seem much else on that front.

That was mentioned in at least one of the articles I read about Vala, mainly this one I think:
<https://blogs.gnome.org/mcatanzaro/2017/02/19/on-problems-with-vala/>.
I don't think Javascript is that terrible, and it's getting better, but it's always going to be difficult to find bugs (probably considerably harder with gjs than in a browser), and you have to use some weird idioms to make its OOP work like other languages. The main problem for gjs is its bindings, so it's almost the opposite of Vala. Overall I really don't understand why they chose that over python.

Your question is an important one - I've been thinking the opposite -
that perhaps it is best to abandon the 'nicer' languages and just go
back to C.  More boilerplate perhaps - but less drama.

The trouble is the boilerplate has a lot of potential to add drama if you make a mistake. "Nicer" languages not only save you the work, but also make sure it's correct (well, that's the theory). Did you ever use GObjectBuilder (gob)? That was really nice, you would write object declarations in a Vala-like style and function bodies (which were declared inline; each gob file would generate both a .h and .c) in almost pure C. Nowadays the project is unmaintained. I think it was a one-person effort, so it should be possible for another individual to pick it up and do any necessary maintenance. But the big drawback for me is that since being spoilt by developing for Android, I would really miss auto-completion and edit-time error detection. I managed to write a usable vim syntax definition for it, based heavily on C's, but completion etc is a whole other level.

Vala is very attractive, but I'm afraid I have to side with the
doomsayers.

Ditto.  It looks like C# to me - mono on GNOME was great - but the
momentum is gone.  Not something I want to make a wager on.

I suspect Mono would be completely dead if it wasn't for Unity3D. Any project that hasn't converted from GTK2 to GTK3 by now shows that it's either desperately short of developer hours or the developers don't care about the future (or even the present) of their project. GTK2 is not OK any more, it's terrible with hidpi scaling enabled.

So there's Python.

The one contender with C, IMO.

supported. But... its runtime has a poor reputation for efficiency,
and  it can't truly multithread on multiple cores.

As someone who had many tens of thousands of lines of code in Python -
the multi-threaded issues are ***GROSSLY*** exagerated.  It is not a
real-world problem.

Yeah, that's not really a problem for desktop or server applications. But it would put me off using it for writing games (even though simple games don't need multiple cores), and I suspect it's holding it back a bit in scientific circles too.

--
TH


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