Published
in the Prog C++ section,
on 23 December 2017
I’ve got a chance to share a part of my upcoming book here.
The book is in production, I’m expecting it to come out in February.
There will be a discount on December 24th and 25th: Half off everything at Manning. You can use codes dotd122417 and dotd122517 – just go to Manning webpage.
The biggest problem in software development is handling complexity. Software systems tend to grow significantly over time and they quickly outgrow the original designs. When it turns out that the features that need to be implemented collide with the design, we must either re-implement significant portions of the system or introduce horrible quick-and-dirty hacks to make things work.
After David’s post, I got a few mails asking whether this change has anything to do with the project I started last summer, so I decided to provide a small update.
My original plan was to ship a test version of Blade a few months after the project announcement, but that did not happen. The main reason was that there were some higher-priority things in Plasma I needed to work on, so I had to put this on hold a bit.
While the project is not yet made public, some important things have happened that moved it forward quite a bit.
First, a teaser
Before I start, a fancy screenshot is in order. The main UI is as dull as it was, but there is another UI:
If you are not sure what this is, this is not a fancy new Plasma theme. This is a screenshot from a phone (more precisely, a phone version of Sailfish OS in a virtual machine) connected and set to search applications on my main system.
The design
I have significantly simplified the design because the original one induced some communication overhead to allow any two nodes in the system to communicate with each other (regardless whether they are on the same system or not).
This was a cool feature, but I’ve realized that it is not needed here, and that it is not needed in most programs that I’d use a similar message-passing mechanism in.
The messages now have a strict flow and each node can send messages only to its designated listener(s).
The beast below
I’ve also replaced the serialization mechanism which used the Qt data stream proocol with the ProtoBuf library, and the Qt networking has been replaced by ZeroMQ (yes, I’ve changed my mind).
One great thing about these libraries (and one of the reasons I decided to replace the old stack with them) is that they have fully-functional bindings for any programming language imaginable – from Python and Java, to languages like Haskell, Erlang and Elixir.
This means that it will be possible to write any of the components in any language you want. If you want to use Python’s great numeric libraries to implement the calculator runner, or if you want to implement a Web UI in Haskell, you will be able to. No need to be limited only to languages that support Qt.
The future
I don’t have any plans to propose replacing KRunner’s current implementation with this anytime soon. As David mentioned in his post, this would be problematic because this is a reimplementation with a completely different API and everything.
The first milestone will be to create an alternative to KRunner that will have enough cool features for people to start using it instead of KRunner.
This is the same approach I took a long time ago with Lancelot. Be a conscious choice instead of being the default.
Once upon a time, for those who remember the old days of Plasma and Lancelot, there was an experimental applet called Shelf.
The idea behind the Shelf was that sometimes it is useful to have a small applet that just shows your recent files, favourite applications, devices, which you can place on your panel or desktop for quick access.
Now, this post is not about a revival of Lancelot and Shelf (sadly), but it is closely related to them.
Namely, I always disliked the “recent documents” section that is available in almost all launchers in Plasma. The reason is that only one in ten of those documents has a chance to ever be opened again.
The first code that had the aim to fix this landed in Lancelot a long time ago – Lancelot was tracking how you use it so that it could eventually start predicting your behaviour.
This idea was recognized as a good one, and we decided that Plasma as a whole could benefit from this.
This is how the activities manager (KAMD) was born. The aim was to allow the user to separate the workspace based on the project she was working on; and to have the activity manager track which applications, documents etc. the user uses in each of the activities.
The first part – having different widget sets for different activities was baked in Plasma 4 from the start. The second one (which I consider to be much more important) came much later in the form of KAMD.
KAMD, apart from being tasked to manage activities and switch from one to another, also tracks which files you access, which applications you use so that the menus like Kicker and Kickoff can show recent documents and recent applications. And have those recent documents and applications tied to the activity you are currently in.
For example, if you have two activities – one for KDE development, and another for working on your photo collection, Digikam will be shown in the recent applications section of Kicker only for the second activity, since you haven’t used Digikam for KDE development.
Now, this is still only showing the “recent documents”. It does show a list of documents and applications that are relevant to the task you are currently working on, but still, it can be improved.
Since we know how often you open a document or start an application, we do not need to focus only on the last time you did so. We can detect which applications and documents you use often and show them instead. Both Kicker and Kickoff allow you to replace the “recently used” with “often used” in the current version of Plasma.
Documents shelf
Now back to the topic of this post.
While working on the KAMD service, I often need to perform tests whether it keeps enough data for it to be able to deduce which are the important applications and documents, and whether the deduction logic performs well.
Most of these tests are small GUI applications that show me the data in a convenient way.
For one of these, I realized it is not only useful for testing and debugging, but that it might be useful for the day-to-day work.
In the screenshot above, you can see an applet, that looks quite similar to Shelf from Plasma 4 days which shows the files I use most often in the dummy “test” activity.
One thing that Shelf did not have, and neither Kicker nor Kickoff have it now is that this applet allows you to pin the documents that are really important to you so that they never disappear from the list because the service thinks some other file is more important.
You can think of it as a combination of “often used” and “favourite” documents. It shows your favourite documents – the documents you pinned, and then adds the items that it considers worthy enough to be alongside them.
This applet is not going to be released with the next Plasma, it needs to evolve a bit more before that happens. But all the backend stuff it uses is released and available now if you want to use it in your project.
The keywords are kde:kactivities, kde:kactivities-stats and kde:kactivitymanagerd.
I’m currently in my final preparations for this year’s Akademy.
For people unaware of this conference, it is the annual conference of KDE contributors.
We tend to have a few dozen of high quality talks on various topics ranging from art and community building, to hard-core Qt and C++ talks.
This year, I’m going to have two talks. One on (obviously :) ) functional programming in C++, and one on C++17 and 20. The later one will be a bit self-serving because I’d like us to raise the compiler requirements for our software so that we could enjoy working in KDE even more.
The only thing more important than talks is the period after where the different teams within KDE meet-up to discuss the future plans. While we do it all the time on IRC and on the mailing lists, having face-to-face meetings is irreplaceable.
If you are near Almeria, join us – the conference is free for attendance!
Published
in the Prog C++ section,
on 13 July 2017
I guess this is public now – Sergey invited me to give the keynote at C++ Siberia 2017 which will be held in Tomsk in August (25th and 26th).
@ivan_cukic will give a keynote at C++ Siberia 2017 https://t.co/B5oWqhjRuk #cpp #cppsiberia — C++ User Group, RF (@cpp_russia) July 11, 2017
This will require some serious mental and physical preparation. I’ve never had a talk two hours long. :)
If you are in area, and you speak Russian (My keynote will be in English since, despite having a Russian-sounding name, I don’t speak Russian), come and join us – the tickets are available at the conference website.