Writing a blatant Telegram clone using Qt, QML and Rust. And C++
Posted by tempodox 16 hours ago
Comments
Comment by solarkraft 3 minutes ago
> There's currently no Matrix to speak of, but it's the thought that counts.
Welp! Of course I was going to ask about it. I’m curious how that goes because of course Matrix is what you want to support, but I’ve been quite critical of that actually being way too hard of a thing to do.
Comment by ekjhgkejhgk 11 hours ago
Absolutely true.
Telegram: Best UI. Signal: Best privacy. WhatsApp: Largest userbase.
It's interesting to think about these three dimensions. I could theoretically pinpoint everything that make Telegram's UI the best, and copy it. I could do the same with Signal's privacy. Both of these are technical problems. There's a process for becoming the best at UI, and there's a process for becoming the best at privacy. I don't know a process for becoming the one with the largest userbase.
Other than the 3 big ones, I recently found Jami [1]
Good UI, though not as good as Telegram. Arguably better privacy than Signal - you don't even need an account if you don't want. Zero userbase. Free software.
Comment by cosmic_cheese 8 hours ago
In comparison everything else puts reasonable effort into the mobile clients and phones in the rest with bloated, half-baked web apps or if you're lucky an iOS Catalyst port.
Along with UI/UX quality, this stuff matters and impacts adoption, even if most users can't put their reasoning into words.
Comment by johannes1234321 11 hours ago
Easy: Be at the right spot in the right time and be lucky to be noticed.
WhatsApp had one smart idea: tying accounts to phone number, which solved detectability, while SMS where expensive in many regions. When ICQ/AIM still missed the mobile market and before Apple made iMessage.
Easy to replicate, as we can see with Facebook messenger or Google's different attempts, who invested quite a few resources into that.
Comment by miki123211 59 minutes ago
Comment by aledue 36 minutes ago
Comment by toast0 11 hours ago
I was at WhatsApp from 2014 - 2019. Growing a large userbase from scratch doesn't happen by any one factor. You have to do a lot of things well. (and probably get lucky)
a) potential users need a compelling reason to join. Messaging at data rates was significant, but not in the US were many people had large messaging allowances. Works better than SMS/MMS was compelling for some.
b) existing users need to be satisfied enough to stay: service has to work consistently, client has to work, etc.
c) signup flow needs to work well. Doesn't matter if people want to use the app if they can't. You need to help users understand their phone number (or other identification). You need multiple methods of verification, because SMS doesn't always work. Giving someone a several digit code over the phone is a cognitive task for the user, and it's harder with disjointed speech generation, so you need to spend some time on that too. You need multiple providers because if you can't get verification codes to users, some of those people will give up and never come back. Since you have multiple providers, you need to figure out how to pick one based on current conditions which you also need to figure out how to track. Also --- you need some money, sending all these codes gets expensive. Phone numbers as ids is a blessing because "everyone has one" and you can use the system address book for contacts, but verification costs add up; usernames or email as id make contact discovery messy and a surprising amount of people in the developing world don't have an email address or don't know what it is.
d) users get new phones, a lot, you need to make it easy to move their account. Or they will likely drop your service when they get a new phone.
e) you need to be prepared for and handle large events. If some big news happens, people will want to talk about it. If some similar service has an outage, you will get more traffic --- if you also fall over, that's a lost opportunity.
f) things need to work well on the devices people actually have. Which might not be the ones you would prefer to use. Worldwide, most people don't have flagship phones. If you want a large number of users, having good experiences only on recent flagships is self limiting. Working well (or at least better than alternatives) on low end and older devices is a path towards addressing users that others miss.
There's probably more. Most of these require sustained consistent effort to deliver. It's not a one time thing. And it's not quick. Sustained consistent effort is easy enough as a one product start-up, but it's very hard as a big-corp.
Userbase can be a positive feedback loop: once you have enough users, that becomes its own reason to join ... and having no one to talk to is a reason to leave. There's not really a way to jump start it, unless you've already got a large user base somewhere else that you can use to seed your service.
Comment by igouy 10 hours ago
Until 2025, WhatsApp was even on KaiOS
Comment by ekjhgkejhgk 11 hours ago
Comment by QuantumNomad_ 10 hours ago
Comment by immibis 9 hours ago
Comment by 01HNNWZ0MV43FF 59 minutes ago
Comment by scotty79 8 hours ago
Comment by ekjhgkejhgk 10 hours ago
Comment by methuselah_in 6 hours ago
Comment by PunchyHamster 9 hours ago
Both look ass at desktop too, way too many wasted space, tho Telegram at least doesn't stretch the chat on the entire width of monitor when in fullscreen, having to go from far left to far right just to read the chat
Comment by mananaysiempre 8 hours ago
Telegram has GFM-style fenced code blocks including language indication for syntax highlighting (e.g. ```python), what else could one want for code? (I guess syntax-highlighted inline monospaced blocks, it does indeed not have them.)
I wouldn’t say Telegram is perfect. The polish and the actual experience of using it are great. Yet when you look closely, it’s as rickety as you’d expect given the insane rate of shipping features that they’ve sustained until quite recently. (For instance, there were a few weeks where porn spambots in public chats would post single—thus animated—emoji, seemingly because the UI didn’t allow you to open the context menu on those in order to report spam, because the usual single-tap handler for that was overriden by the handler that would play the emoji animation.)
And the discoverability is in the toilet. Did you know that you can preview a chat without marking its messages read by long-pressing on the image? That works on Android—except on a tablet where your screen is large enough that you get the two-pane view; I thought for weeks they had removed that feature until I realized the tablet was the problem. And the only thing that mentions its existence is AFAIK an item in release notes from 2018[1,2]. Did you know that you could pop out individual chats into their own AIM/ICQ-style windows on desktop? I don’t think it’s documented anywhere, but it’s in the context menu.
If it were the 2000s I wouldn’t have given Telegram any HCI design awards. But everything else is considerably worse, with the possible exception of (indeed) Discord. (I prefer Telegram’s abundant tools for scrubbing through history though, it’s one of the few things in that category that’s actually better a calendar of posts like blogs used to have.)
[1] https://telegram.org/blog/unread-replace-2x#and-three-more-o... (it didn’t even make the headline!)
[2] Just found out (via the comments in https://bugs.telegram.org/c/52) that this actually exists on desktop too: Alt-click the chat. Argh.
Comment by bluecalm 2 hours ago
Comment by tptacek 8 hours ago
Comment by scotty79 8 hours ago
Either you provide message interchange with any other message system operating in a specific country or you can't advertise or sell anything in this country (also app stores must country wide ban). Bootstrap by taking two largest chats and offering them provisional access to the market for few months. If they can provide interchange between them they can remain and others can follow. If not bigest one is out, let's say for two years and the third one (pre-ban) tries to establish interchange with the remaining of the two biggest.
Comment by bruce511 2 hours ago
The short version is that, no, you can't law yourself out of this (or pretty much anything. )
Firstly, laws have national jurisdiction. There are no "all the countries agreed to this" laws.
Secondly, the US can't actually pass any laws anyway. Congress is deadlocked. It can't even get around to killing daylight saving clock changes (which passed the senate with unanimous support.)
Plus any laws (or, more recently executive orders) just end up in court forever. And when passed may, or may not, be enforced (or enforceable. )
And that's before I point out that big tech buys (sorry, "lobbies") govt in the first place. Apple, Meta, Google would all pay to make this bill go away.
Lastly, everyone seems to forget that interoperability leads to spam. Email is open and completely flooded. SMS is open and basically unusable. Whatsapp grew their user base in part because the experience was spam free. So even if laws declaring openness were proposed they would be far from universally supported.
Comment by tcfhgj 11 hours ago
Comment by ekjhgkejhgk 11 hours ago
Comment by jatins 10 hours ago
Comment by ekjhgkejhgk 8 hours ago
- turn off your phone
- get that person to turn their phone on
- they receive the message.
Where was it stored, if not in WhatsApps servers?
Comment by tcfhgj 7 hours ago
Burn your phone, setup a new phone, log in, view your messages was what I meant.
Comment by fooker 8 hours ago
The government can just ask them to turn over those. (note that this is legally very different from forcing someone to unlock a device)
Comment by __jonas 7 hours ago
It has the option of doing that, it asks you if you want to enable the backups. It also allows you to encrypt the backups with a passkey or a password that you can manually set, client-side.
It didn’t always have the encryption option I think.
Comment by AdrenalinMd 10 hours ago
Hard no. Have you tried activating encryption in personal chats?
Comment by koakuma-chan 11 hours ago
Comment by ekjhgkejhgk 11 hours ago
Comment by koakuma-chan 11 hours ago
https://pub-aff931c6a6424ddbaff3eccef55f4ae1.r2.dev/IMG_7372...
Comment by ekjhgkejhgk 10 hours ago
Comment by mananaysiempre 10 hours ago
(Not that any of it is particularly relevant to the quality of Telegram’s UI, which is indeed unmatched.)
Comment by koakuma-chan 10 hours ago
In this meme, Durov, the Telegram founder, says "Colleagues, greetings. Who can make it, so that eggplant cums? Added a task to Notion." Then "employee" sends a cumming eggplant sticker, and Durov replies "This is what I wanted."
Comment by scrivanodev 10 hours ago
Comment by IshKebab 10 hours ago
1. Child components can magically refer to variables in their parents. This is basic encapsulation 101. The only other language I know of that allows that is SystemVerilog and that's from an era where people didn't know better (especially hardware guys).
2. You can create custom widgets... but they can't display text! There's a class called something like QmlSceneGraphTextNode that is the way that all the provided widgets display text but it's private. I guess they might have fixed this eventually but it stayed private for the ~5 years I tried to use it. They wanted me to just use Label widgets in QML land which sucks.
It also felt like there was a pretty huge impedance mismatch between QML and C++ due to its use of Javascript. E.g. stuff like using 64-bit integers. That reminds me:
3. It uses Javascript.
4. I never found a good way to use dialogs. They seem to push you towards having all possible dialogs exist all the time and just showing and hiding them, which is kind of crazy.
I don't think the idea of a GUI DSL is fundamentally bad, but QML is certainly a pretty miserable implementation. Hopefully the Slint guys have learned all of these lessons.
Comment by RustSupremacist 7 hours ago
Rust is simply not meant for GUI-based data design but I still want Qt in Rust. That's it. Not QML or Slint or egui or Tauri or gpui or Iced. No markup at all. None of the immediate mode things. No double and triple languages like this C++ mess. Definitely not GTK or the other non-imperative subpar things. There is one option. Until there is more than one, Qt is the best. No one else is worried about this missed opportunity.
Comment by throwaway1389z 7 hours ago
Comment by IAmLiterallyAB 5 hours ago
Comment by scuff3d 2 hours ago
Edit: Oh, my bad. I thought they open sourced it separate from Zed. Looks like they are still tied together.
Comment by eviks 53 minutes ago
How are they tied?
Comment by LorenDB 11 hours ago
This. I can't abide VSCode. I instead use Qt Creator for all my C++ development.
Comment by p0w3n3d 10 hours ago
Comment by spacechild1 5 hours ago
Comment by p0w3n3d 1 hour ago
However I guess that in the case of Jetbrains this means you get your code infiltrated and stolen to teach the AI on
Comment by irishcoffee 10 hours ago
It’s just a great ide. Using qt has nothing to do with making it a better or worse ide.
Comment by zerr 3 hours ago
Comment by fooker 8 hours ago
Until having language specific features really lost to AI auto complete, and now it's some vscode flavor.
Comment by spacechild1 5 hours ago
Comment by IshKebab 10 hours ago
However with the Clangd extension it is much much better. Even better than Qt Creator. 100% accurate C++ code intelligence, really really fast error squigglies. Honestly I was kind of surprised it's even possible to get it that good.
It's not quite on the level of Dart (which is basically instant and perfect), but I'd say it's on the same level as Rust at least in terms of responsiveness and reliability.
Comment by spacechild1 5 hours ago
Comment by irishcoffee 8 hours ago
Clangd is clangd. It integrates the same everywhere.
Comment by scuff3d 2 hours ago
Comment by p0w3n3d 10 hours ago
Comment by yokljo 5 hours ago
I think QML is very easy to get started with and you should just give it a go. It's not without its weirdness as other comments have already mentioned, and unfortunately there's still many controls that are less-than-ideal for desktop applications than their original QWidget equivalents. Using QWidgets+UIC is nice, but in my experience creates problems when you want to get fancy and custom with your design, with animations and shifting layouts and whatnot, well, especially after using QML.
Comment by QuantumNomad_ 10 hours ago
I have a similar problem with JetBrains RustRover. For example when I do cargo build and cargo clippy in the terminal after RustRover has done build it seems to start over rebuilding more things than when I edit something in vim and only use cargo from the terminal.
Comment by IshKebab 10 hours ago
Once you fix it so that Rust-analyzer sees the same env vars as your shell then the issue goes away. It's kind of annoyingly hard to debug though.
Comment by dev_l1x_be 11 hours ago
Comment by tracker1 11 hours ago
Torrents themselves work against this, because you have known hash values as part of seeding... with email and messaging, you wouldn't have one-off advanced knowledge, and if anyone can send anyone a message, you'd be open to a flood of messages from what seems to be randos. There's some of this from scammers on Telegram and other social media, but it would be much worse.
A federated system that's otherwise tethered to a domain/email or similar would at least allow for self-management and/or block listing techniques to work better in practice.
Comment by QuantumNomad_ 10 hours ago
I get about one scam message per week on Telegram. And the annoying thing with Telegram is that it’s a paid feature to be able to make it so that only your contacts can send you messages.
Additionally, in order to block and report the sender, I first have to open the message, which sends a read receipt to the sender. Which in turn, if the scammers are smart, is something that they make note of automatically.
So one can presume that every time I open a scam message to block and report the sender, as I do, I am also giving the scammers confirmation that this number is actively in use and my number will keep being included in lists of numbers that they and others send scam messages to.
Comment by WD-42 8 hours ago
Comment by pndy 10 hours ago
Comment by dev_l1x_be 7 hours ago
Comment by bfdddsss 10 hours ago