6 ms·
It's bloat caused by stuff like Electron, and people choosing to write desktop apps in HTML + JavaScript/TypeScript + some framework. If people even used a fra
by winter_blue 4y ago
It's bloat caused by stuff like Electron, and people choosing to write desktop apps in HTML + JavaScript/TypeScript + some framework.
If people even used a framework like Qt (a really mature and well-maintained desktop framework the favored framework of KDE Plasma, etc.), their memory usage would be so much lower. (I'm not counting the memory used by Qt's shared .so / dynamic library files.)
- Gigachad 4y agoIs virtually every single company and developer wrong? Or is Qt actually not that good, forcing people to use Electron despite it's resource usage? I find it far easier to believe that Qt and GTK have fallen behind rather than the whole world is under a grand delusion and didn't know Qt exists.
- bandrami 4y agoElectron lets you write a graphical application without knowing what you're doing. Whether this is "right" or "wrong" is a difficult question to answer.
- Gigachad 4y agoI have a hard time believing that companies like Discord are using Electron simply because they do not know what they are doing.
- ZephyrBlu 4y agoI completely agree with you. It would be extremely odd for a company like Discord, who has done things like using nightly Rust in production, to naively choose Electron because they "don't know what they're doing" with native apps. Many people on HN either don't understand or don't care for trading off runtime performance and other technical qualities for other things like e.g. development speed, DX, easier hiring, etc.
- emodendroket 4y agoOr to put it another way, HN users tend to strongly value things that aren't important to most people, and not much value other things that most people do care about.
- jamiek88 4y agoOr to condense it further, HN users are human. No matter how much we deny it! :D
- emodendroket 4y agoThat's true. But I think that many people here share such a similar perspective that they don't realize how fringe their priorities really are.
- JohnFen 4y agoMaybe, although I suspect most people here understand that we're a fairly small subculture. I do, at least. The thing is, it doesn't matter if my opinions/needs/pain points are fringe. They're still real, and I still care about them and advocate about them. Just like most people.
- vfclists 4y agoDiscord was developed as a messaging system for gamers who usually have the latest and greatest hardware. Electron would be okay for them and their users on account of that.
- account42 4y ago> Many people on HN either don't understand or don't care for trading off runtime performance and other technical qualities for other things like e.g. development speed, DX, easier hiring, etc. Most people on HN understand those tradeoff very well but also understand that those tradeoffs are being optimized for the company's profit and not for the good of society overall. Without meaningful competition (and for Discord that would mean interopable clients, not just alternate chat applicaitons with their own servers) the incentive for making more efficient software is ~0.
- Ygg2 4y agoQuestion is, if you want to do cross platform UI what choice do you have?
- MobiusHorizons 4y agoThere are a few options depending on your application type. Fltk is old and ugly, but may work for you. There are others that come from the world of game UIs. Things like sdl2, Nuklear, and dear imgui. I’ve also seen some vulkan based frameworks (mostly from the rust community)
- Ygg2 4y agoPoint isn't to make some hacky game ui, it's to make application UI on par with Web, feature and stability wise.
- MobiusHorizons 4y agoThe vulkan based gui that neovide seems to come close to what you want. But I don’t think it’s a library you can use easily.
- Gigachad 4y agoWhich one of these would allow you to build the discord UI as it is, looking exactly the same on every OS and run in web browsers?
- wk_end 4y agoQt is actually not that good. I used to work for a large, well-known software company that distributed an app using Qt; every day that I worked on the native client was a nightmare of framework bugs, quirks, and limitations. For all of CSS' quirks and limitations, it's still an order of magnitude less frustrating to develop with a TypeScript/React/HTML/CSS stack than it is to use Qt. TypeScript is also a vastly better language in most respects than C++ or Python, the only two blessed Qt languages.
- anthk 4y agoQt has QML. I think that "well-known software company" was not as productive as it was.
- wk_end 4y agoI don't know what "[it] was not as productive as it was" means (it's a logically nonsensical statement, so I assume you made a typo). It was not an especially great (though not terrible) or productive place to work, I'll give you that. For colour, I'll add: it was a fairly old application first developed before QML/Qt Quick. It was also a multiplatform desktop application; then and now it's unclear to me as to whether or not Qt Quick is especially suitable for desktop applications. We'd been in the process of moving chunks of it into an HTML/JS web view for several years - I think when that decision was first made it was well before QtQuick would've been sufficient for desktop usage. Other reasons we were doing it, besides the aforementioned bugs/quirks/limitations were that it's easier (and cheaper) to hire web devs than native devs, and that it allowed for code/infrastructure/design reuse with our web frontend. QML doesn't address either of those issues. Admittedly, I haven't tried QML in anger, but I also feel like...given the quality of the rest of the framework, which is comparatively mature, it'd be pretty shocking to me if it didn't have its own slew of bugs/quirks/limitations.
- JohnFen 4y agoQt used to be quite bad. It isn't anymore. Where I work, we use it and it's decent. We don't use Qt Quick, though.
- HWR_14 4y ago> Is virtually every single company and developer wrong? Virtually every company and developer opts for simpler development and worse runtimes. Is that "wrong"? I'm not sure how to answer that. You could probably make a case either way.
- couchand 4y agoYeah, if you're needlessly burning dinosaurs in a warming planet it's wrong.
- Gigachad 4y agoThe average consumer running electron apps on a MacBook is using far less power than the average HN user with a 1000w home lab made out of salvaged obsolete parts. Not to mention half the users here rally against EVs, public transport, and probably own an F150. The environment only matters when we are talking about a 1w savings with election vs qt.
- account42 4y ago> The average consumer running electron apps on a MacBook is using far less power than the average HN user with a 1000w home lab made out of salvaged obsolete parts. Both of these would be using less power with more efficient software. But no, lets excuse shitty practices that could save a lot (over the entire userbase) for relatively little effort because it doesn't solve everything.
- vt85 4y ago[dead]
- mypalmike 4y agoYet you are reading and posting here when you should be out hiking and planting trees.
- winter_blue 4y agoNot to disagree, but the bigger factor for environmental gains is likely backend languages. If people could stop writing servers in languages that are literally 40 times slower (Python with Django, Ruby on Rails, etc.) in terms of the number of requests it can handle / throughput, that directly translates to more server instances behind a load balancer, which translates to 10 times the electricity usage. That, imo, is totally unacceptable (also, financially not optimal). I've had people tell me that the "developer productivity gains" of using Python totally justifies the circa 10 X electricity usage + 10 X hosting/cloud costs. (Yes, developers cost a lot, but the hypothesis that Python/other slow languages result in so much higher developer productivity is a questionable assertion -- especially, in contrast to languages like Kotlin, Go, etc.)
- insanitybit 4y ago> Is virtually every single company and developer wrong? Would it be surprising to find that they were? It's not like developers have a lot of credibility.
- LeFantome 4y agoIt is web designers and JavaScript devs not wanting to acknowledge that desktop dev and C++ exist. I use an old 2008 iMac running Linux frequently and it runs remarkably well. Firefox and MS Edge are certainly the apps that bring it down from a memory perspective ( it only has 6 Gigs ). Electron apps like MS Teams are right up there though and make it chug even more than the browsers do. To be fair, I have dozens of tabs open including beasts like GMail but I certainly have to restart the browsers from time to time. Compiling huge C++ code bases is a memory nightmare as well.
- emodendroket 4y agoNot wanting to acknowledge they exist, or not wanting to do them because they find them less proeuctive? Different issues.
- 8n4vidtmkvmk 4y agoLess productive. I started with C++, did that for about 5 years, then got sucked into web where I've been for about 20 years. In a funny turn of events, my company has adopted C++ and now I'm writing C++ again. I don't hate it, but 15 minutes to compile/boot a server or 5 minutes to run some tests is kind of unpleasant. And the occasionally UB bug or dangling pointer. It's just really outdated. Enough so that I don't want to relearn how to build a GUI in C++. I'll wait a few more years for Zig or Carbon to mature.
- anthk 4y agoYou don't have to. You can write a UI in QML.
- vfclists 4y agoUse Lazarus IDE and Freepascal and report your findings.
- 8n4vidtmkvmk 4y agoThen I'm learning an IDE instead of a GUI lib. Same diff, not interested. I'm happy with CLion.
- mrtweetyhack 4y ago[dead]
- Santosh83 4y agoThey're not wrong, but that also doesn't mean Qt is not good. It just means they're optimising for ease & speed of shipping software over resource usage. Building on top of a modern web browser (Electron basically) gets you a ton of stuff for free that you'd otherwise have to wire together painstakingly with frameworks like Qt. Also the language limitation. Far easier to throw a ton of JS devs on to a project than a ton of C++ devs.
- Yuioup 4y agoPlus Qt isn't free, if I'm not mistaken.
- anthk 4y agoHave you been under a coma since 1997? How's everything?
- JohnFen 4y agoWe use Qt where I work. It's insanely expensive if you're using it commercially.
- account42 4y agoThat really depends which addional parts of Qt you use and what additional services you need. The core is LGPL, which is free even for commercial closed source use.
- JohnFen 4y agoI don't know the details, but you're likely right. We certainly use more than just the core -- the core isn't where the value of Qt really is. That said, the cost really is extreme. So much so that there is an ongoing effort to remove Qt from our products entirely. There is general agreement among the devs that the cost is not justified by the benefits, and nobody can remember why it was chosen in the first place. All that said, I like Qt. It's quite capable and you can produce decent, portable UIs with it. But I agree it's too expensive to justify.
- Yuioup 4y agoWhoa. Cool your heels Kimosabe. I said "If I'm not mistaken". Looking at the rest of the comments I see that Qt core is free, but the rest of it isn't.
- bharathyes 4y agoIt is more of the learning curve. Lot more people are familiar with the JS web stacks than
- chalst 4y agoElectron allows you to use the DOM model and npm so that there is less friction moving between web standards and native apps.
- specialist 4y agoYa, pretty much. Electron is a lot of monkey motion just to emulate SDL.
- userbinator 4y agoand people choosing to write desktop apps in HTML + JavaScript/TypeScript + some framework. While the "web everything" trend is definitely responsible for a lot of the bloat, it is upon closer inspection not the whole story. For example, I remember various "AJAX chat" clients were quite popular around the turn of the century, worked in a browser like IE5 on a system with probably 64-128MB of RAM and a single core Pentium II/III, and you could also do other things like listen to music, play flash games, or read other sites at the same time. Those clients loaded relatively quickly over connections with bandwidth measured in KBps, and I don't recall much in the way of complaints about their resource usage.
- seszett 4y agoThey still exist. A small corner of the French free software community uses "tribunes" to communicate, and that was developed a bit before 2000. It consists of a web interface (originally not Ajax) and a standardised protocol supported by a handful of clients (most of which can federate multiple tribunes). It was briefly popular outside this community when I wrote a Drupal module that provided a tribune for any Drupal site, but then the modern web and smartphones happened and today it's really confidential. I still use it though, and the graphical client running on my system (which is also an RSS reader) uses 23 MB of RAM at the moment, displaying 1375 messages.
- emodendroket 4y agoI suppose so but they'd bring in lots of different problems to solve a problem that most people don't care about that much.