I agree. Modern Qt is great - you get the performance of C++ and the ease of use (simpler than React!) of creating UIs in QML. I've built my note-taking app with a from scratch block editor[1] (like Notions's) with it. Now working on a mobile version[2]. Also working on a LLM client[3]. And working on a library that will simplify and help others build such apps easily - which is my solution to the original article author's problem.
Yes! I'm not using Qt's built-in components like StackView, but reimplementing them from scratch to better support swipe gestures, etc so they feel native-like.
> Instead, I imagine a future where we have new “high-level” tools, built from lower in the stack.
This is exactly what I'm trying to build. I'm writing a library on top of Qt that would make it easy to write native code as easy as it is writing React code! I would say it's even easier since we are throwing all the constraints of browsers and web apis out of the way.
Depends in which sense you want it to "catch" the bugs. As this readme notes/quotes,
> All memory safety errors are caught as Fil-C panics.
If your problem is a memory-based bug causing a crash, I think this would just... catch the memory-based bug and crash. Like, it'd crash more reliably. On the other hand, if you want to find and debug the problem, that might be a good thing.
Sure, if the memory error is an immediately crashing one like a null per deref, but if is (for example) a memory corruption (e.g. an out of bounds write or a write-after-free) then this would be super helpful in exposing where those are happening at the source.
As a FOSS maintainer myself, I recommend you to charge (a small amount of) money for the app. People could always compile and run the app themselves still, so paying for the app is a clear way to support the project. I see that you have donation on your page, but it rarely happens that people donate. Just my 2 cents.
Thanks for the suggestion. I do plan to publish the app on Google Play as well. While much of the audience is FOSS-oriented, there are also users who aren’t familiar with open source or compiling apps themselves, like here: https://github.com/CompassMB/MBCompass/issues/48.
For them, donations are a simple way to support the project, and they’re definitely appreciated.
Thanks! MBCompass will stay fully FOSS and free. Donations are extremely rare (tbh, I've not received a single one), especially from the Foss Android community, but they’re still very helpful for long-term sustainability (given Google's non-sense Play monthly policies) and greatly appreciated, especially for users new to open source.
Not true anymore! \o/ I don't use Android anymore, but I agree a lot with the principles you've shared here, so it's a thank you for sharing that. And I know how difficult it is to get the first donations, and after you get the first, it's much easier to get the later ones. So best of luck, and I hope you'll remain steadfast with your principles when it'll matter! :)
Thank you, that really means a lot. Consistency has been important to me, whether it’s shipping regular releases with real improvements (https://github.com/CompassMB/MBCompass/releases) or writing about Android development and FOSS alongside the project. I really appreciate the encouragement and support.
You might add Bitcoin, Lighting or Monero to your donations page. Would've gladly dropped you a few bucks but I don't use any of the services you're offering.
Thanks for the suggestion, that’s a fair point. I currently rely on a couple of mainstream platforms mainly to keep things simple, but I do see the value in more open and permissionless options like Bitcoin/Lightning or Monero.
I’ll definitely consider adding at least one of them going forward. Really appreciate the willingness to support.
Right, for small scripting, not for the majority of the app. All the backend interaction is in C++.
Like, electron is fine, but it's orders of magnitude slower than it needs to be for the functionality it brings. Which is just not ideal for many desktop applications or, especially, the shell itself.
Ultimately people use electron because they know HTML, CSS, and JS/TS. And, I guess, companies think engineers are too stupid to learn anything else, even though thats not the case. There is a strong argument for electron. But not for Linux userland dev, where many developers already know Qt like the back of their hand.
TypeScript transpile to Javascript - do you really want your operating system's shell written in slow ass Javascript? Modern C++ with hardening rules for the compiler[1] is pretty safe.
There's no soul in major OSes these days - Windows is a big bloatware and macOS's aesthetics is the result of design for the sake of the design instead of any practical use. No wonder we're seeing this sentiment for an alternative growing.
> I'm curious about the use cases people you know used Qt to develop for mobile.
They were developing non-trivial mobile apps. The kind where you use your fingers on a touch screen, but that are more complex than just showing a text and an image. Say Google Maps, or WhatsApp.
The problem was not the lack of components: the problem was that it was C++. C++ is more complex to write correctly than Swift or Kotlin and harder to debug. Which made those teams measurably a lot slower. It's just the wrong technology for the use-case, IMO.
I also write complex UIs with QML and C++. I do not consider myself an expert in C++ but there is clearly a subset of it that I feel comfortable in. I think the combo of QML & C++ is great since QML lets you focus on the UI - and does a great job at it, and in C++ you can write performant code. C++ isn't that complicated these days - if you stick to a subset you're familiar with.
How much experience do you have writing mobile apps in Kotlin or Swift, as a comparison? I have worked in C++ for years, and in Swift for years. I have seen the exact same app being written both in Java and in C++.
> in C++ you can write performant code
This almost certainly does not matter for a mobile app, and definitely not for the UI part. In case your app has to do something that may need C++ (e.g. computer vision), then you can just call a C++ library over FFI.
> C++ isn't that complicated these days
I didn't mean that it is complicated. I can totally write C++. What I meant is that it is more complicated to get it right than modern languages. If users complain about a segmentation fault, it's often pretty tricky to debug. In Java/Kotlin, you will get an exception that tells you exactly which line crashed.
On top of that, C++ is slower to write. Again I have been able to compare teams working on the same app both in C++ and in Java/Kotlin/Swift (Java is not exactly a modern language, but still it's a lot faster to develop with).
And after all those disadvantages of using C++ for a mobile app, you end up with a UI that doesn't feel native to the platform.
Again: I still write C++ when it makes sense (usually that's for legacy reasons or libraries availability, otherwise Rust is a better choice IMO). But for writing a mobile UI? Doesn't make any sense to me.
Even for writing a Desktop app, I don't understand why people use Qt instead of e.g. Java. Kotlin/Compose seem to be coming on Desktop too, which makes a lot of sense to me. And maybe even Flutter.
Finally, I don't understand writing a cross-platform UI for Desktop and mobile. On mobile, I have a big finger and a small touch screen. On Desktop, I have a big screen, a mouse and a keyboard. Those require different UIs. Sharing the logic is fine, but the UI needs to be written for the platform.
> How much experience do you have writing mobile apps in Kotlin or Swift, as a comparison?
No, in the mobile space I've only used React Native and QML with C++.
> This almost certainly does not matter for a mobile app, and definitely not for the UI part.
I disagree. For example, I expect block editors to handle large texts efficiency - both in terms of power draw and performance. Writing in a non-compiled language already puts you in a disadvantage in both aspects. But this is just the standard I set to myself - the entire industry clearly has different priorities.
> I didn't mean that it is complicated. I can totally write C++. What I meant is that it is more complicated to get it right than modern languages. If users complain about a segmentation fault, it's often pretty tricky to debug. In Java/Kotlin, you will get an exception that tells you exactly which line crashed.
Yep, I generally agree, tho with good debugging tools and LLMs I have found this to not be a problem anymore.
> On top of that, C++ is slower to write. Again I have been able to compare teams working on the same app both in C++ and in Java/Kotlin/Swift (Java is not exactly a modern language, but still it's a lot faster to develop with).
I write in TypeScript at my day job and C++ for my side projects and I don't feel like I'm slower in C++. Again, I'm using the subset I'm conformable with.
> And after all those disadvantages of using C++ for a mobile app, you end up with a UI that doesn't feel native to the platform.
That has certainly been the case, and what I'm trying to fix - because I've proven that it is fixable by caring about UI/UX. QML is great for UI, it's just that Qt developers (both the developers of Qt and those using it) don't care much about those things. But it's definitely posiible to get good results. For example, I'm working on SwipeStackView like other iOS apps have in QML, and I'm liking what I've made so far: https://rubymamistvalove.com/notes-mobile-swipe-stack-view.M...
> Even for writing a Desktop app, I don't understand why people use Qt instead of e.g. Java. Kotlin/Compose seem to be coming on Desktop too, which makes a lot of sense to me. And maybe even Flutter.
Again, I can't stretch how FUN, easy, and overall a great experience to develop with QML and C++ together, it's just HOW GUI should always been. I'm thinking of creating some Youtube tutorials that will try to present this feeling.
> Finally, I don't understand writing a cross-platform UI for Desktop and mobile. On mobile, I have a big finger and a small touch screen. On Desktop, I have a big screen, a mouse and a keyboard. Those require different UIs. Sharing the logic is fine, but the UI needs to be written for the platform.
100%. Completely in agreement. The fact that you can develop both Desktop and mobile apps in QML doesn't mean you must make them share the same code (at least, not fully). I think Kirigami have gone the wrong way with their 'adaptable' UI (I've also thought about doing that until I realized it's the wrong approach). One should always start with the UX that the end result should be - never start from tech considerations.
> Writing in a non-compiled language already puts you in a disadvantage
Both Kotlin and Swift are compiled.
> But this is just the standard I set to myself - the entire industry clearly has different priorities.
I think you just underestimate the performance of Java/Kotlin/Swift, languages that you admitted you don't have any experience with.
> tho with good debugging tools and LLMs I have found this to not be a problem anymore
Again: try modern languages with good debugging tools and LLMs :-). I think your bias is that this is all you know.
> because I've proven that it is fixable by caring about UI/UX
It requires care, which means more effort. All that for being at best similar to the native tools, but probably never exactly the same. And it cannot be better, because the native ones are the ones defining how it should be.
> I can't stretch how FUN, easy, and overall a great experience to develop with QML and C++ together, it's just HOW GUI should always been
But you said you don't have experience with the native Android/iOS way. I personally have used QML/C++, Flutter, Android (Java/Kotlin, the old XML way and the new Compose way) and SwiftUI. QML/C++ is by very far the worst.
I would advise that you try either Kotlin/Compose or Swift/SwiftUI to get an idea. You can still use C++ to share some code (say you write a complex library in C++, no need to rewrite it in Kotlin and Swift), but starting a new mobile UI with QML these days is just madness IMHO :-).
I only said that because you said performant code "does not matter for a mobile app". I think writing apps in native frameworks is awesome! I'm all for it. BTW, I've heard some reports that SwiftUI/Swift are slow[1][2][3]. Again, I haven't explored SwiftUI and Kotlin, but I'd like some day. What do you love about them so much?
> All that for being at best similar to the native tools, but probably never exactly the same. And it cannot be better, because the native ones are the ones defining how it should be.
I agree, the best apps would almost always be those written in the framework the OS provides - kinda make sense - cross platform GUIs will always fall under the lowest common denominator issue - I've written about it in my blog post[4]. You also forget tho, that Linux does exist with a growing popularity - I think it's important to target it as well (I've started GUI development because I was on Linux and most apps had horrible UI/UX).
> but starting a new mobile UI with QML these days is just madness IMHO :-)
Memory safety, for one. A whole lot of better defaults (e.g. immutability by default). Then the influence of functional programming. Nice async primitives like coroutines.
It's not just Kotlin and Swift. Rust is nice as well. Even Java has actually improved a lot over the years.
Only C++ seems to get worse over the years. It's the only mainstream language where people say "if you limit yourself to a subset of the language, it's actually decent". And every year, C++ brings new stuff that people probably shouldn't include into their "decent" subset.
> You also forget tho, that Linux does exist with a growing popularity
I have been a Linux user for 20 years, I don't forget it. My favourite UI is a CLI, and there, languages like Go or Rust now often make more sense than C++. I am hoping that good desktop GUIs will come eventually, because I absolutely hate the web-based stuff like Electron. Maybe with Compose multiplatform? I hear Flutter is decent there, too.
> I've started GUI development because I was on Linux and most apps had horrible UI/UX
Except for IDEs (I like the JetBrains ones) and browser, I don't use GUIs :-).
> Except for IDEs (I like the JetBrains ones) and browser, I don't use GUIs :-).
You said you "hope good desktop GUIs will come eventually, because I absolutely hate the web-based stuff like Electron.", so I guess you still might need to use those. I'm with you, and I'm trying to be part of the change. To be honest, I'm not very much tied to a specific programming language. If the end result is good - stable, performant, with good DX than I'm with it. For me, the current combo works. I'm willing to adapt tho. Slint has nice QML syntax for UI and logic (and the underlying framework) is written in Rust. Its author was once The Qt Company/Nokia developer if I'm not mistaken.
> stuff like Electron.", so I guess you still might need to use those
Yeah, stuff like Slack for work. But there it's a bit different: they chose Electron because it makes them more productive even though it ends up in a worse product. It's sad, but it is rational to produce crap that makes more money.
That would be a reason to use React for a mobile app, maybe. But writing a mobile app in Qt is not more productive :-). I am very convinced it costs more money and results in a worse product.
> QML is absolutely not JavaScript. It's a markup language to describe user interfaces, spiced with JS for certain interactions. All heavy lifting behind the scenes is done in C++ - the QML runtime as well as the application logic and data models.
How's QML useless? It's incredible language for UI. I described how I developed my Block Editor (like Notion) in Qt QML and C++: https://rubymamistvalove.com/block-editor
[1] https://get-notes.com/
[2] https://rubymamistvalove.com/notes-mobile-swipe-stack-view.M...
[3] https://www.get-vox.com/
reply