New programming language needed for KDE?

No the paper is legitimate. It does say that the fastest program isn’t always the most energy efficient (but they then state later that they also measured the kilowatts it uses.) According to their data, Python is magnitudes more energy inefficient than something like C++… even if performance wasn’t correlated, it would still be a significant difference.

You are right that it’s all benchmarks though, but I think it would be cool to see a paper done to the same program written in all of those languages but that would be a monumental effort :slight_smile:

2 Likes

Perhaps more eco-friendly than if the developer didn’t write that app, and the user has to do it manually. The choice is not necessarily Python or C++. Could be Python or None.

1 Like

For those readers who’re wondering about the phrases “KDE eco” and “eco-friendly”, they’re pointing to this: <https://eco.kde.org/> and, the associated “Blue angel” awards … :smiling_face_with_three_hearts:

2 Likes

The new PyQt5 + Kirigami tutorial is up: Python with Kirigami | Developer

It was tested to make sure that everything Just Works and that the tutorial is easily upgradable to PyQt6 with no code changes.

For now PyQt apps only integrate with Kirigami, not other KDE Frameworks.

11 Likes

Great! IMHO, doing UI in QML solves two major problems with PyQt:

  1. Documents are lacking. One has to learn the translation from C++ to Python, and refer to the C++ documents instead.
  2. QObjects follow C++ lifetime. Confusing to a GC-based Python mindset.
1 Like

Hi Herzenschein, I wanted to tinker with the PyQT QML but unfortunately I am stuck at the very first step of the tutorial you kindly provided.

When trying to run this command:

sudo apt install python-pyqt5 python3-venv kirigami2-dev flatpak-builder qqc2-desktop-style appstream-compose

I get the following error:

pstream-compose
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package python-pyqt5
E: Unable to locate package qqc2-desktop-style

Any idea on how to resolve this and proceed?

My system is Kubuntu 22.04 as I like to have a stable base.

Cheers!

The first has a package change in the naming, second no clue which one you need of them.

zeus@9600k:~$ apt-cache search python3 pyqt5
python3-pyqt5 - Python 3 bindings for Qt5
.....

zeus@9600k:~$ apt-cache search  qqc2 desktop style
libkf5qqc2desktopstyle-dev - Qt Quick Controls 2: Desktop Style
libqqc2breezestyle-dev - development files for Breeze inspired QQC2 Style
qml-module-org-kde-qqc2breezestyle - Breeze inspired QQC2 Style
qml-module-org-kde-qqc2desktopstyle - Qt Quick Controls 2: Desktop Style
libkf5qqc2breezestyle-dev - Breeze inspired QQC2 Style library - transitional
qml-module-org-kde-breeze - Breeze inspired QQC2 Style - transitional
qml-module-org-kde-qqc2desktopstyle-dbgsym - debug symbols for qml-module-org-kde-qqc2desktopstyle

zeus@9600k:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=24.04
DISTRIB_CODENAME=noble
DISTRIB_DESCRIPTION="Ubuntu Noble Numbat (development branch)"

Though it says ubuntu in the release file the about this system tells me Kubuntu 24.04.

1 Like

Thanks for that redgreen925.

I am not sure if I have accomplished the same results as that tutorial command but this command over here worked for me:

sudo apt install python3-pyqt5 python3-venv kirigami2-dev flatpak-builder libkf5qqc2desktopstyle-dev appstream-compose

I will try to follow the rest of the tutorial.

You are welcome, another handy one to have is the apt-file package after an apt-file update as root a apt-file search file/missing.so.? will tell which package(s) contain that file. Comes in real handy to find what you need to install on an error showing up. The search can be done as normal user just like apt-cache search.

2 Likes

On execution the script fails to import QQmlApplicationEngine, qmlRegisterType from PyQt5.QtQml

Traceback (most recent call last):
File “/home/funky/simplemdviewer/src/simplemdviewer_app.py”, line 8, in
from PyQt5.QtQml import QQmlApplicationEngine, qmlRegisterType
ModuleNotFoundError: No module named ‘PyQt5.QtQml’

I’ve already installed all the packages listed by:
apt-cache search qqc2 desktop style

So I’ll probably revisit this tutorial at a later date if there are extra info available on how to troubleshoot this. :sweat_smile:

Ah. Apparently Debian has both python-pyqt5 and python3-pyqt5 (both link to the same thing) but Ubuntu only has python3-pyqt5.

The qqc2-desktop-style one is my bad. Debian/Ubuntu named this package differently and they package the QML part separately. I’ll update the tutorial with the relevant packages (it must be both libkf5qqc2desktopstyle-dev and qml-module-org-kde-qqc2desktopstyle).

EDIT: it’s missing python3-pyqt5.qtquick too.

zeus@9600k:~$ apt-file search python3-pyqt5.qtq
python3-pyqt5.qtquick: /usr/share/doc/python3-pyqt5.qtquick/NEWS.gz
python3-pyqt5.qtquick: /usr/share/doc/python3-pyqt5.qtquick/changelog.Debian.gz
python3-pyqt5.qtquick: /usr/share/doc/python3-pyqt5.qtquick/copyright

Though I fail to see how documents are going to be of any use to compile something. Though it appears there is probably more in the .deb installed. I am not able to list it as it is not installed.

zeus@9600k:~$ apt-cache search python3-pyqt5.qtq
python3-pyqt5.qtquick - Python 3 bindings for QtQuick module
python3-pyqt5.qtquick-dbgsym - debug symbols for python3-pyqt5.qtquick
zeus@9600k:~$ dpkg -L python3-pyqt5.qtquick
dpkg-query: package 'python3-pyqt5.qtquick' is not installed
Use dpkg --contents (= dpkg-deb --contents) to list archive files contents.

The tutorial is up-to-date and should work now. I tested it in an Ubuntu distrobox container, so I have yet to test on Ubuntu proper. If you reach the step of the first page where you run python3 simplemdviewer_app.py on Ubuntu and it works, then it’s definitely fixed. :slight_smile:

1 Like

If you’re implying is that all KDE apps must be written in code that can be compiled to machine instructions to satisfy “eco-friendly approaches in other areas”, then you will be shocked when you see all the Bash scripting that goes on underneath the hood of a GNU/Linux operating system. Shocked! If that’s the line you’re drawing in the sand, then you’d be best served with going to Windows or Mac operating systems, which are more compiled than scripted.

1 Like

Right, I’ll add a note for Ubuntu users.

Change the imports from import org.kde.kirigami 2.20 as Kirigami to import org.kde.kirigami 2.15 as Kirigami and it should work. Ubuntu LTS doesn’t have a very up-to-date Kirigami in the repositories since it is 2 years old, not much I can do about it other than lower the requirements…

2 Likes

This did the trick, thanks!

2 Likes

the whole thing (plasma) is a ‘web page’.
there’s nothing ‘real’ or hard coded.
if i change, lets say, the properties of a file in ‘file manager’, the properties do not reflect the change. nothing reflects change until, like a web page, i refresh the view. it sucks.
everything is a ‘widget’, a script or a definition file eg xml, css.
nothing seems to be ‘real’.

Personal data point on the original topic. I’ve been taking some time off since mid last year, also with an explicit goal of helping KDE a tiny bit toward world domination. At some point I’ll have to make a choice about where I want to go professionally, and KDE tech isn’t making it super easy to pad my resumé with relevant technologies.

Qt/QML is pretty niche in the job market overall, the few companies hiring for that skill set are mostly located in Europe where I’m not. There was once a time where companies competed fiercely over toolkit dominance and Qt was one of the main contenders. That time has passed. Desktop app development is dead from a commercial point of view, every company nowadays is using web tech either in the browser or via Electron if they even have the need for a desktop app. My C++ expertise is slowly becoming less relevant as Rust grows fast and especially for software started from scratch. KDE is far enough up in stack to avoid most direct exposure to Linux kernel things or embedded device issues, which results in me not gaining experience on that level either.

It’s no surprise that most of the paid development work on KDE is going into its lower-level foundations, KWin in particular with Mercedes and Valve having taken an interest in it, while more of the higher-level UI work depends strongly on volunteers to push things forward.

While being a pretty dedicated KDE person, I’ve been considering contributing to System 76’s Cosmic desktop for a little while, for the sole reason that it’s written in Rust and would get me some experience in that area. (And maybe find one or the other neat idea to bring back to Plasma afterwards.)

I agree that there’s nothing inherently wrong with C++ especially with all the work that’s going into newer standards and compilers. But it’s also clear to me that if we go down the current route, we’ll miss out on people who are in it for trending technologies and resumé-driven development. Maybe that’s okay. It would be nice though if I didn’t have to make a choice between doing good and pimping my saleable skills.

3 Likes

Thanks for sharing your insights. I think you are right, knowing C++, Qt, and CMake is only relevant in a niche. It might help to demonstrate general technical and social skills. I doubt it will help to get competitive programming jobs.

On the other hand, I am glad Qt is the only relevant C++ UI framework. Rust and Python are still struggling with different frameworks and approaches.

Why different frameworks and approaches would be a struggle ?

Not only Rust or Python but even in Go, there are multiples frameworks and approaches and you are even encouraged to not use any framework and use a combination of libraries.

It can lead to Frankenstein software but at least you have the freedom to choose whatever you want.