Re:Javascript RORO pattern
by heavyset_go on Monday November 01, 2021 @09:09PM
(#29075586)
> It reminds me I recently had a company ship me a laptop with Win on it. I turned it on and logged in and the CPU was just a madhouse with Edge and 2 tabs open. What is the CPU even _doing_??? Does the company mine crypto on company laptops for cash flow... or, what?
Even in a VM, Windows is constantly doing things in the background, whether it's touching the disk, burning CPU cycles, or making network connections. The background services are both numerous and opaque, so who knows what it's actually doing.
With corporations it's more like DLP, antivirus, firewall, and nonstop keylogging.
I've been running Arch Linux for about a decade to avoid exactly that. I mean, I put up with some crap... GPU drivers, Alsa to Pulse to Pipewire, terrible or non existent Slack, Teams, Zoom apps, bizarre overlapping partially redundant X configuration,
Xorg to Wayland, building emacs from SRC to get it to load faster... Endless crap really.
But man, it only loads services I know about and it's sooooo fast. And best of all it shuts up when I stop working :)
Re:Javascript RORO pattern
by heavyset_go on Tuesday November 02, 2021 @04:47PM
(#29087138)
Yeah, I'm coming from Linux where it's easier to know what's doing what.
If you use a sufficiently smart JS optimizer, it will optimize the object creation and destructuring away.
For example, Google Closure Compiler can take
function hello({name}) {
alert('Hello, ' + name);
}
hello({name: 'World'});
and compile it into alert("Hello, World");An alternate universe where Closure Compiler became the preferred way to build JS projects would be interesting.
Clojurescript made that choice, though in retrospect it kind of seems like they backed the wrong horse.
Re:Javascript RORO pattern
by solarkraft on Tuesday November 02, 2021 @05:57AM
(#29079074)
> It's fast enough
... for the developer with the latest, highest-specced machine and only an IDE their app open.
Still, I do wince sometimes at the Everest sized heaps created in JS to do even the most trivial of tasks. 10s of thousands or hundreds of thousands of objects being generated in a smallish React app.
It's fast enough, the VM is obscenely optimized, and it's readable. But what is all that stuff really _doing_?
It reminds me I recently had a company ship me a laptop with Win on it. I turned it on and logged in and the CPU was just a madhouse with Edge and 2 tabs open. What is the CPU even _doing_??? Does the company mine crypto on company laptops for cash flow... or, what?