Ideal Programming Language for Librem 5 development

Hello all. I have been considering learning a programming language in my spare time to enhance my IT skills. I am wondering if this community would have any recommendations on a suitable programming language for an absolute novice with no computer science background that would allow me to develop for GNOME and the Librem 5 platform. Any info would be greatly appreciated, and I want to thank you all for your time :slight_smile:

6 Likes

I’ve been pondering this same question for myself. As coming from a java background I am curious. Java works on the emulator just fine, but I’d like to be more serious about gtk and gnome development. I’ve been exploring Vala a lot lately and that looks like a decent place to start. But I’m also seeing that C and C++ seem to be the most popular in this ecosystem.

A good thing about Linux is diversity, and bad thing about Linux is diversity. There are two main camp for developing GUI in Linux. Either use GTK or QT for developing an app in Linux. GTK uses C and QT uses C++ as native language. There are language binding for both GUI toolkit, pyqt should be the most popular choices. On GTK side, I am not pretty sure. The easiest path should be go for pyqt. Though I am not sure how much C++ will you be exposed or could you use python entirely for development.

If GNU/Linux becomes mobile OS, I think it is important for Purism to support some easier dynamic language like kotlin and swift to attract developer to develop a quick app.

3 Likes

I also tried to understand more. considering that gtk is for gnome and Qt for kde I think python-GTK and python Qt is the best thing. So we study python as a language and then the QT and GTK libraries. I think :slightly_smiling_face:

3 Likes

Instead of python I’d prefer to go the vala route.

1 Like

Hi, I’m a graduated computer science student. I know java, python and c and a little c++ and have locked into some other languages but only on the surface. I have never relay done any GUI programming. With this experience i would recommend python.
In my experience it is the most accessible of the named ones in this thread. It is widely used and therefore you will easily find help and good tutorials. The biggest downside would be that python can often bee slower than the other named languages. It doesn’t have to be and one can trim python allot if wanted but in general i would say is is slower. So if you don’t want to create performance intensive apps, like complex games or a VR app, python should be the easiest.
I haven’t used Vala but my understanding is that it is derived by c, so very performant, plus the convenience of object oriented languages like c++ and java. But as it is intended to be used with GTK i don’t know if it would be wise to use it with QT.

So for ease of learning i would roughly say:
python > java >= vala > c++ > c
While the performance level you can squeeze out is more like the opposite.

For a GUI program integration with the toolkit, GTK or QT herhe, is the other important factor. But as i think there is good integration for python for both i would recommend it. Thought vala/c++ get you more performance and perfect integration with GTK/QT.

I personally really like c as it is/can be quite low level to the hardware and represents what is really happening in your computer. i think it taught me quit allot, but it was also much harder than learning java or python.

Another plus for python is that you have a quite versatile language. Many things are written in python. I would consider it much more useful then Vala, which i think is mostly used by Gnomes GTK apps i think. Not sure on this.

2 Likes

Thanks everyone for your recommendations. I will look into Python, it does appear to be something a layman like myself might be able to wrap their head around with LOTS of practice!

2 Likes

You don’t write complex games or VR apps with GTK, so that’s unrelated to this question IMO.

Agreed, except for java which seem to have pretty bad GTK bindings so I wouldn’t rank that as high in case you stumble upon bugs in the java-gtk language bindings. Vala and python seems like the only good options for unexperienced programmers.

1 Like

I totally agree. But if the final goal would be to do such things i would recommend c++ and Qt to start with, as c++ is much more useful for game programming than python or vala i think.

The official stack is GTK-based, and we’re working on the documentation to make sure anyone who wants can start the development here.

Libhandy docs are described in C terms, but GTK and compatible libraries (including libhandy) can be used from many languages: C, Python, Vala, Rust, etc.

That being said, we’re also going to provide some code examples with our libraries, and so far it looks like it’s either Python, C or Vala.

Personally, I would recommend anyone new to programming to start with Python. Vala might also be a choice, because it integrates with GTK more seamlessly, but, on the other hand, it’s pretty specific to GTK.

14 Likes

Sounds like there needs to be some support for the java bindings :thinking: if only I was a better programmer…

Guess I’ll jump on the vala/rust wagon in the meantime :smiley:

@torbuntu: Good decision :smile: - Rust and Vala are both great programming languages. I had started learning Vala about ten years ago (for those who remember: during the Openmoko project). Meanwhile the development of this programming language was nearly abandoned and I didn’t have further application scenarios, I had been interested in. But recently there has been some momentum in Vala development and it caught my interest again when I read about the Librem 5 project.
IMHO Vala is really easy to learn, similar to Python in this regard. If somebody is interested in some literature about Vala: There’s a good book by Michael Lauer: “Introduction to Vala Programming”. I’m using this book currently to refresh my rusty programming skills… :sweat_smile:

1 Like

Coming from a java (personal) and C# dotnet core (work) background it is pretty easy to follow so far! (Vala). I’ve been curious about rust but my interest in vala is superior. I really do wish java could be more popular for this space xD

If your programming skills are rusty, then it should be easier to use Rust instead! :wink:

5 Likes

… I saw this coming… :stuck_out_tongue_winking_eye:
Well, Rust is another language I’d really like to take a closer look at. So it could be, that I’ll take your advice… :grinning:

1 Like

If you can’t decide between vala and python, then maybe Genie is worth a look.

I have no experience of either vala or Genie, so you will need to make your own assessment :smile:

2 Likes

I’m currently working on Python examples as well as general documentation, though they should be translatable to Vala or C. It’s probably easier to go that way than the other way round. :wink:
If you already know Vala, chances are you already know how to write apps for GNOME, so basic examples aren’t going to be what you’re looking for. Hopefully, in time, any Python examples can be ported to these other languages.

5 Likes

I’ve looked at it a little. I actually prefer the syntax of vala as it is closer to java which is what I normally use.

Kotlin has a lot of momentum and it could attract android developers like myself to build apps for librem. Kotlin/Native also has a gtk library https://github.com/msink/kotlin-libui

I prefer java to kotlin, but if it brings more developers that’s great :smiley: