by jFriedensreich · 2w ago · 0 comments
A well built web app will never be more performance than a well built native app. It's just inherent due to the JavaScript abstraction.
> the text renderer in Chrome is just wildly optimized and definitely can outperform an OS list view.
The question is not whether it can win against GTK/Cocoa/WinUI but whether it's faster than other retained-mode renderers such as the one Discord is using, GPUI.Also, even if just running on a browser tab, each tab has a lot of memory overhead compare to what an actual binary running on the OS has. That's memory that gets wasted from the outset, before the developer even writes a single line of JavaScript.
Though even with memory it's not as clear as you assume in the context (which is about browser-based apps). Singular C/Zig/Rust program will surely be more economical than a singular in-browser app due to browser itself having a huge footprint. But what if said user has that browser open all the time anyway as probably most users do? What if there are more than one GUI-rich app, and with browser they share most of the overhead? PLs which allow low-level optimizations offer great opportunities, no arguing. But never say "never" until you know what exact problem yiu have to deal with.
The native one reads the titles of open windows on your desktop, and God knows what else.
(Well, I don't use discord at all anymore, but I very intentionally never used the desktop app.)
Also difficult to manage fake websites duplicating the look and feel. Scamming people into giving access or passwords.
A native app which is installed once from a good source is more secure, i feel.
Culturally JS doesn't have a tradition of libraries with deep inheritance hierarchies so you aren't wasting a bunch of memory, and cpu, constructing layer upon layer of useless base classes. This is an improvement over both Java and some C++. This also means the GC doesn't have to work as hard.
No it doesn't, but instead it has normalized using a ton of third party packages even for as silly as left-pad [1] that might take your whole application down, put the security of your users in jeopardy or even take bulk of JS built websites down [1]. Even if the left pad incident is excluded, everyday, JS developers rely on unaudited third party libraries from the shitstorm that NPM is. So, you just offset the library problem, not really solved it.
JS solved the package reuse problem. Turns out the ideals of the 1980s had security problems in the 2020s.
Better than C++ where getting third party source building is such a PITA that I got used to seeing decade+ old sources of security critical packages laying around in repos because no one was going to bother trying to get a newer version building.
You're mistaking "JS is forced on people and they have no choice but to make it work" with "it's everywhere so it must be good".
And there is absolutely nothing stopping anyone from developing a browser that natively supports another scripting language. Your arms are untied to end the javascript tyranny once and for all.
Everything is not built on top of it.
> It's the language powering the whole web
It’s also not powering the whole web, just a significant part of the client frontend inside browsers.
Can you share something else they could've built everything else on top of, instead? Yeah, that's what I thought.
Do you really think a normal junior dev is going to be/should be writing web assembly code to build a basic portfolio website?
Im also curious what language do you think would be suitable instead? And whats your plan to move all the browsers and websites in the world to this new language?
I created my own declarative react-like UI library that is small, efficient, and does things just the way I want. I have absolutely no desire to go back to the days where for every platform I want to develop for, I need to learn whole new UI paradigm, with all its quirks and gaps and inefficiencies.
Past a certain age, having to do this every year or two get old fast. And, it is not necessary for good performance. The only holding back good performance and capabilities from web apps are the platform vendors.
I think that's also the main reason software like VS Code is electron based and not browser based.
Now some particularly powerful and dangerous stuff like global hotkeys are not available or heavily restricted on the web, which is probably a good thing for most users.
You can tell me until you're blue in the face that you also think these apps should be cross-browser but we all know that will never happen.
A well built anything is better than most software. I would argue that a well built rust app will probably a higher quality piece of software than typescript slop produced by Microsoft.
I mean, essentially you are? It just so happens that this web browser that your application very much runs on top of may link (to a more or less large extent) with the host OS "WebView"/built-in browser (assuming there's one to begin with). My point still stands: if you are lucky, you may save some on the binary size download, once, but the run time is a web app with all the quirks and inefficiencies of the web as a platform.
I think it'll be fixed soon but it drives me nuts.
Flutter is under appreciated for desktop.
https://github.com/DioxusLabs/dioxus#experimental-native-ren...
Blitz itself is a great experiment in debloating.
see also https://github.com/pathscale/izumo