5 ms·
Your remarks here, esp. re "hardly use JS", make for a wildly misinformed comment. (You realize that every Electron app also has at the core a "very optimized[
by cxr 5y ago
Your remarks here, esp. re "hardly use JS", make for a wildly misinformed comment. (You realize that every Electron app also has at the core a "very optimized[...] C++ codebase"? Aside from that, Gecko makes very little use of C and by now makes extensive use of Rust.) XUL-based apps were doing the Electron application architecture before Electron (or NPM, for that matter) even existed—and on average they've done it better.
> I have never heard Firefox referred to as such.
... so?
The fact that you aren't aware how heavily reliant that Firefox (and Thunderbird, and Zotero[1]) is on JS for its UI and other application logic doesn't exactly change anything. In fact, that most people aren't aware of it is rather the point of the comment that you're responding to...
1. https://news.ycombinator.com/item?id=29774097 https://news.ycombinator.com/item?id=29774097
- bayindirh 5y agoWhile Firefox's JS usage is more ingrained and near to its core, GNOME's and KDE's JS usage is nowhere as deep. They both use JS (and QML in KDE's case) as strict scripting engines, which directly bind to C++ codebase underneath. GNOME's JS introspection libraries are even "autogenerated" from the source and header files. I played with both, and the weight the JS parts are lifting are pretty minimal. All the stuff is done by the C++ parts underneath. It's like using TensorFlow, SciPy or a similar C backed library and telling that you use Python for computation. Same thing. At the end of the day, any Electron app I use (I use TiddlyDesktop for example) is using more RAM and CPU, and bogging down both considerably more w.r.t. Firefox, KDE or Eclipse. When a simple application which has a very optimized C++ core is using more resources to show a simple web page and manipulate it is using comparable resources to my IDE or primary browser, there's something very wrong.
- cxr 5y agoI've done more than play with Firefox and Mozilla toolkit code. "All the stuff is done by the C++ parts underneath" is an overstatement. (Not least of all because a bunch of stuff is now done by Rust parts and not C++ parts.) Plenty of the behind the scenes stuff is JS. > At the end of the day, any Electron app I use (I use TiddlyDesktop for example) is using more RAM and CPU, and bogging down both considerably more w.r.t. Firefox, KDE or Eclipse. When a simple application which has a very optimized C++ core is using more resources to show a simple web page and manipulate it is using comparable resources to my IDE or primary browser, there's something very wrong. These remarks doesn't really make any sense here. I didn't show up to the party defending Electron apps and their authors. My comment was an explicit indictment of typical NPM and Electron development practices.
- bayindirh 5y ago> I've done more than play with Firefox and Mozilla toolkit code. "All the stuff is done by the C++ parts underneath" is an overstatement. By both, I meant KDE & GNOME. I didn't dive into Mozilla/Firefox stuff, but as far as I understand, since setting enterprise stuff and locking features, etc. (I forgot the name of the enterprise stuff, it's long time ago) is done in JS, JS is more than skin deep in Mozilla/Firefox codebases. This is understandable though. Firefox is just Netscape, and they just invented JS. Not much involved otherwise. > These remarks doesn't really make any sense here. They're not direct counter-arguments to you. Just I've wanted to say that, even though the Electron is built on a C++ core, it's extremely inefficient and wastes a lot resources for what it does, that's it.
- kaba0 5y agoStill, it’s like claiming that OpenJDK is written in java — yeah, the SDK has many parts in Java, but it is still a C++ executable that has bootstrapped another language. Is the CSS layouting engine, the network stack, the goddamn JS interpreter or the myriad other literal millions of lines of code of firefox is in JS? Of course electron apps bundle a.. browser, but you are just pedantic. An electron app’s core functionality is not the bundled browser.
- cxr 5y ago> Of course electron apps bundle a.. browser They don't. You are conflating Web browsers and the engines that power them. Web browsers are applications unto themselves. They require lots of application code separate from the underlying engine. You don't get a Web browser by compiling a browser engine and calling it a day. > Is the CSS layouting engine, the network stack, the goddamn JS interpreter or the myriad other literal millions of lines of code of firefox is in JS? VS Code, an Electron app written in TypeScript, requires all the same components. And you keep saying "Firefox" when it's not appropriate to do so. The millions of lines of code in _Gecko_, along with Spidermonkey, establishes a platform for building apps that's on par with the Electron platform. Gecko + Spidermonkey does not a Firefox make, however. The code that makes Firefox Firefox[1] is in a separate application bundle, which includes on the order of hundreds of thousands of lines of JS. 1. ... and not, say, Zotero, which is literally built by downloading a release build of Firefox, stripping out all the Firefox code while leaving Gecko et al intact, and dropping the Zotero code in its place.