Live data from Hacker News

Web apps are better than no apps

molodtsov.me

61–70 of 199 posts

Re: Web apps are better than no apps

#61
post #41

I hate to agree with this. Web is the best way to cram loads of features into a limited amount of dev time. But still, whenever I use Teams, something like this happens: I click a button, nothing happens. I wait 10 seconds, because teams sometimes just needs a little longer. Nothing happens. I click the button again, it finally starts doing something. 5 seconds later, the thing I wanted appears. And every time it hap…

> whenever I use Teams Terrible software can be coded in any language.

Sadly, Microsoft and Electron seem to be magnetic to that type of software though. I experience seconds of lag between pressing a key and a character appearing in vanilla VSCode writing plain-text files. Forget plugins, I can't even use it to write text files. This laptop seems to run Dwarf Fortress and Factorio just fine, so I have no clue why specifically Teams and VSCode conk out other than the fact that both are Microsoft products built for the web and shipped with a security-lax stripped web browser. Have no issues with full Visual Studio either, so it's just that VSCode runs much, much, much heavier than actual Visual Studio. Isn't it meant to be light-weight in comparison?

Re: Web apps are better than no apps

#62
post #39

Earlier quoted context omitted.

Those are microbenchmarks, and as such are misleading when it comes to evaluating JIT-ed languages. They also don’t involve ever touching the DOM, which is a major source of slowdowns in real-world JS apps.

Yes, but any UI stuff in C++ is also going to be a major source of slowdowns. And C++ compiled to WASM will have the same slowdowns if it needs to touch the DOM.

That actually makes me want to create a set of UI benchmarks comparing performance standard UI operations in C++ with Qt vs JS with DOM. I think I’ll look into it over the weekend.

Re: Web apps are better than no apps

#63
post #59

Earlier quoted context omitted.

> Around the speed of Java and Go in some cases, which are compiled. That is quite the claim, I wonder if you have any data to back that up. As it goes against everything I've seen.

Is it "quite the claim"? The Javascript JIT arms race was the most heavily funded dynamic language arms race since forever - involving three major players (Apple, Google, Mozilla), dedicated teams, tons of benchmarks, constant tracking of performance improvements, total rewrites of the engines and additional JIT stages added, and public boasts in the official company blogs and marketing material!

It is still quite the claim.

Given the disadvantage that it starts at, JavaScript is astonishingly fast, due to the extreme investment in it that you mention. However, in almost all real-world scenarios, it’s still generally pretty easily beaten by ahead-of-time-compiled languages, even if on some microbenchmarks and for a few specific sorts of tasks it can end up competitive with certain of these compiled languages.

Re: Web apps are better than no apps

#64

> There are just too many levels, and JavaScrip is an interpreted language, not a compiled one, so by default, it will be orders of magnitude slower than an app written in Swift, Rust, or C++. JavaScript isn't as fast as C++ or Rust, but it's pretty fast. Around the speed of Java and Go in some cases, which are compiled. For a web app the speed of the language is rarely the bottleneck anyway, other than some exceptio…

I once wrote an image generation program that used every color in a provided palette exactly once, then ported it to a few different languages. The main data structure was a kd-tree to store RGB points, with each point being marked as used after returning it.

Rust and C++ were both within about 10% of each other. Python was about 3 orders of magnitude slower. The surprising result was that JavaScript was only about 7-8x slower than the C++ version, which was much faster than I had expected.

Re: Web apps are better than no apps

#65

I hate to agree with this. Web is the best way to cram loads of features into a limited amount of dev time. But still, whenever I use Teams, something like this happens: I click a button, nothing happens. I wait 10 seconds, because teams sometimes just needs a little longer. Nothing happens. I click the button again, it finally starts doing something. 5 seconds later, the thing I wanted appears. And every time it hap…

This definitely happens. At the same time, Superhuman (which is a web app) is insanely fast, and Apple managed to make the desktop version of Apple Music (which is supposed to be mostly native) insanely slow.

Re: Web apps are better than no apps

#66
post #34

Earlier quoted context omitted.

> For a web app the speed of the language is rarely the bottleneck anyway I think there’s some selection bias in this; the apps that get built as web apps tend to be the ones that are not bottlenecked by JavaScript. For exceptions that are pushing the limits of performance, you’ll more often than not find Rust/C++ compiled to Wasm in the stack.

I've always wondered what kind of apps these are. The vast majority of web apps I use are all CRUD. I can't think of a single webapp or electron app I use which performs heavy computation. Maybe VSCode? But I don't know if any of the computation is happening on the frontend. People have been extolling the virtues of WASM to me for a while but I have yet to find a use for it where it improved the speed of development,…

I see it mostly with what I would call “industrial applications”: video editing, CAD, etc. Besides games, consumer software tends not to be computationally intensive, so there are few consumer examples (which I think leads to a sort of “JavaScript is fast enough for everything” fallacy among web devs)

I happen to write a newsletter where I interview this sort of company, here are some recent examples that use Wasm:

- Rayon (CAD): https://digest.browsertech.com/archive/browsertech-digest-ho...

- Modyfi (raster image editing): https://digest.browsertech.com/archive/browsertech-digest-ho...

Re: Web apps are better than no apps

#67
post #6

"and JavaScrip is an interpreted language, not a compiled one, so by default, it will be orders of magnitude slower than an app written in Swift, Rust, or C++." This statement is misleading and false. The distinction between "interpreted" and "compiled" isn't as clear-cut as it once was, especially in the context of modern languages and runtimes. However, when it comes to JavaScript, here's the general understanding:…

Seems like a technicality to me, although I'd be happy to update the statement in the post. It's still not compiled in advance and while the technologies you described (asm.js, WebAssemly) exists most web apps discussed don't use them at all.

Re: Web apps are better than no apps

#68

I can feel the frustration when people are forced to use a specific proprietary app that is bad (hey MS Teams). They clearly have the resources and experience to build better native apps. But I guess the one big advantage for electron is the Web stack. It is so ubiquitous and relevant that most developers have experience with it. In combination with open source, this is the reason VS Code (as an example) has so many…

> In combination with open source, this is the reason VS Code (as an example) has so many contributions, leading to many features for a variety of languages and so many plugins. As a result, I don't have to learn other editors or IDEs which makes me more productive.

I don't know, (neo)vim and emacs are kind of the counterexample, and they have way more extensions and plugins. Neovim especially is seeing tons of momentum at the moment.

Re: Web apps are better than no apps

#69
post #59

Earlier quoted context omitted.

Is it "quite the claim"? The Javascript JIT arms race was the most heavily funded dynamic language arms race since forever - involving three major players (Apple, Google, Mozilla), dedicated teams, tons of benchmarks, constant tracking of performance improvements, total rewrites of the engines and additional JIT stages added, and public boasts in the official company blogs and marketing material!

It is still quite the claim. Given the disadvantage that it starts at, JavaScript is astonishingly fast, due to the extreme investment in it that you mention. However, in almost all real-world scenarios, it’s still generally pretty easily beaten by ahead-of-time-compiled languages, even if on some microbenchmarks and for a few specific sorts of tasks it can end up competitive with certain of these compiled languages.

>However, in almost all real-world scenarios, it’s still generally pretty easily beaten by ahead-of-time-compiled languages

The claim to be refuted was not "Javascript is faster than AOT compiled languges" however.

Instead, the claim was: "[Javascript is] around the speed of Java and Go in some cases, which are compiled", which is not far off. Especially given that these two are not in general among the fastest kids like C, C++, and Rust.

Re: Web apps are better than no apps

#70

I hate to agree with this. Web is the best way to cram loads of features into a limited amount of dev time. But still, whenever I use Teams, something like this happens: I click a button, nothing happens. I wait 10 seconds, because teams sometimes just needs a little longer. Nothing happens. I click the button again, it finally starts doing something. 5 seconds later, the thing I wanted appears. And every time it hap…

You can program junk in any language. I've built a pretty neat real time web application using nothing but JavaScript and a little thinking. Could it be better? Yes, no doubt. I could have written it as a native application for all of the platforms that it currently supports (Desktop on Windows, Mac, Linux, mobile phones Android and iPhone). But I really don't have the time or the resources for that so this helped me to scratch my itch, helps a ton of other people as well and keeps the future options open. If you can do it as a web app you probably should do just that.

I've a bunch of ideas on how to improve it that would require much more speed for raw computation, so for now that's off the table. Maybe one day it'll catch up, maybe there are some performance tricks that I'm simply not aware of that could make it happen today. But it's plenty useful as it is.

Teams is typical bloatware. We had video-in-the-browser in 1995 and it worked, by 1998 we had audio as well plus a whole pile of people hanging off high volume events (Shuttle launches, F1 etc). Since then computers have become considerably faster. That there are alternatives to Teams that do not suffer from the same drawbacks makes me think that this is implementation dependent and that MS would really love you to download their native stuff. The web based Teams clients doesn't seem like it was ever priority #1. And because in any Teams meeting with more than five participants there always is at least one person using the web the impression is that the system as a whole just doesn't work.

Post reply on HN