Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I think that this argument is, frankly, over. Electron is the way to build cross-platform apps that don't merit separate UI code for each platform.

Electron wins because Electron apps are able to deliver consistently decent UX, something that never happened with Swing or GTK+ or WxWidgets or whatever.

Sure, it eats RAM. It turns out that I care about that so much less than I thought I would. I'm rarely using 100% of my system's RAM these days, so I'm willing to burn a couple hundred MB on widgets continuing to be sensibly drawn and laid out when I resize the window.



>Sure, it eats RAM. It turns out that I care about that so much less than I thought I would.

It sure is nice having a powerful developer machine with 16 or 32 gb of RAM. Just remember there are a lot of people out there running on 4gb laptops or even less. These days, the OS, web browser, and Slack alone are already enough to max it out and start swapping.


If you want to keep your RAM usage light, go ahead and use vim. Other people choosing to use different apps is consuming their computer's memory, not yours.

I'm also not sure you can just assume that an Electron app will be a giant memory hog compared to the alternatives. I just decided to go and give it a quick look-see. Right now I've got both vscode and IntelliJ IDEA open at the same time. (For my purposes, they're at feature parity, except that I don't like vscode's Java plugin). IntelliJ, a non-Electron cross-platform app, is consuming 3 GB of RAM. vscode, an Electron app, is using 50MB. That's 1/60 as much. Meld, a GTK+ app that doesn't do nearly as much, consumes 100MB just sitting idle, which is twice as much as the Electron app does.

I'll come out and say it: I suspect that, deep down, this argument is not really about memory or anything like that. It's really a proxy war about JavaScript. Which, I get it, I hate JavaScript too. I resolutely avoid working on things with UIs at work, probably to the detriment of my career, just to avoid programming in JavaScript. But I've also got to concede that Electron has accomplished something that everyone else has consistently failed at: Delivering decent cross-platform GUI applications. And it's pointless to complain about people using X technology when it has no truly viable alternatives.


> Delivering decent cross-platform GUI applications.

Qt, Gtk+, WxWidgets... There are lots of ways to skin this cat.


Then write an alternative using different technologies. Those writing electron apps now are not obliged to do this for you.


An 8 gig stick of ram costs about thirty dollars. It doesn't make sense to run 4 these days.


> An 8 gig stick of ram costs about thirty dollars. It doesn't make sense to run 4 these days.

It does not make sense if 4 Gb mean that you can only run a browser and Notepad.

If, however, you are a bit older and you remember the time that you had the choice between 4 MB and 8 MB and people were still able to do all their computer stuff, including internet, in a graphical environment, then you thoughts are more in the line of: what the fuck are these lazy and incompetent programmers doing these days? And this is coming from someone who earns a living as a developer.


There were a lot of hours spent and features unimplemented those days in want of RAM. Now we don't have to do that- we can do more, and we can do stuff way faster as developers.

If you spend a half hour over the entire life of your machine even considering RAM, you might as well double it for $30.

Using RAM is good. It's fast, it's cheap, and anybody with 8 gigs has it in abundance


May I ask what unimplemented features you're referring to? I think one of the biggest issues the older crowd has with Electron apps is not only that they eat up 500MBs of RAM, but also that they only have a tiny subset of the features contained in apps that ran fine with 500KBs.


"Hello World" in Electron is 100MB. That's the bare minimum. It's quite insane.


Many (most?) consumer level machines have soldered RAM these days. They may or may not have an available expansion slot.


Not everyone can or will upgrade their computer’s RAM.


Older Intel chipsets don't support more than 4 Gb. New chipsets and motherboards also have a limitation, typically about 16 or 32 Gb. Doesn't it look artificial? What is the reason for it? Of course, to make sure that the consumer won't be able to use them for too long without paying for a new one.


Most current entry level AMD and Intel motherboards support 32 or 64 GB RAM (in fact, I couldn't find one that supported less). These are rarely over $100. Boards supporting 128GB of RAM start around $120-150.

Seems reasonable for 2019.


What about the people using prebuilt machines, or ones with 4GB of soldered-in RAM?


Thats not really what I was responding to - they were saying current chipsets and motherboards are artificially limited to 16/32GB, which isnt true. Of course there are are specific systems like laptops that are limited to less than that.


Should not "entry-level" motherboard cost around $20-40 and not $100? Not reasonable at all.

Also, in laptops you cannot upgrade the motherboard.


> Should not "entry-level" motherboard cost around $20-40 and not $100? Not reasonable at all.

No? ~$100 is remarkably cheap for a new motherboard, especially if you are complaining about needing 32+GB of RAM, which costs substantially more than $40. If you want something like a $35 Raspberry pi, buy one and accept its limitations.


I haven't seen anyone use a desktop for development in years...

The Windows tablet/notebook (hybrid) being sold as their latest product by a company I'm doing business with at the moment has 4GB. It's a shame, because Electron would totally fit what their business runs on those tablets, which is a Javascript-based graphical environment...


Text editors don’t need all the widgets and controls. They basically need a context menu (and Electron’s menus are horrible as they provide none of the native OS accelerators and integrations), a open/save dialog (pretty please don’t use a custom UI here!), and maybe a menu/toolbar. The editor itself is custom code (whether html/css/js or native), and that’s where the performance benefits of native code shine best anyway.


> and that’s where the performance benefits of native code shine best anyway

That's right, now you just have to deal with open source OpenGL libraries or of course write it yourself.

Handle unicode, sub/superscripts, RTL text, typography nuances, LaTeX etc. by yourself.

(See more at https://gankra.github.io/blah/text-hates-you/)

Also do it in your free time because probably you won't make a living out of it.

So I totally understand why anyone would pick a browser engine where all of this is super easy to solve.


Of course, there's no middle ground between "using a whole browser engine" and "coding your UI in raw OpenGL".

Have you heard of, say, Qt?


I think you're thinking of a different argument. I never said it doesn't provide consistent UX.

It's just that when I hear a "simple markdown editor", I don't envision an app with a bundled web browser. I'm sure it looks great and all that.


When they say "simple markdown editor", they're pretty obviously not talking about implementation details. They're talking about it being easy to use.

As far as the argument goes, I'm not sure they're really separable. If you have an Electron app that markets itself as being simple (as in "easy to use"), and someone says, "No it isn't, because the stack it's built on is complex", their unstated major premise is that implementation details are more important than UI. Leaving it unstated doesn't mean it shouldn't be addressed head-on. One of a syllogism's legs can easily be both tacit and the crux of the argument at the same time.


Not everyone has a system with over 8 or 16 gigabytes of RAM to run such apps.


So, let's talk with real numbers here.

I happen to have a Markdown file open in MacDown, a native application, right now. According to Activity Monitor, it's using 67.1 MB of RAM. I also downloaded Mark Text to take a look at it. So now I've got the same Markdown file open in that app, too. It's using 73.9 MB of RAM.

I will admit, that difference in memory consumption is equivalent to seven instances of vim, and I'll keep that in mind the next time I'm trying to get things done on a Raspberry Pi Zero. (As one does.)

But, on this 6-year-old computer, which does not have "over 8 or 16 GB of RAM", I'm still not sweating that 6.8 megabytes.


That is difficult to believe. I unpacked Linux version of the app, Electron binary is 120 Mb, resources.pak is 8 Mb, ICU library is 10 Mb. How can a whole Electron app take just 74 Mb? The numbers don't add up.

To test it myself, I started the program (with --no-sandbox because it requires root privileges otherwise) and measured memory usage using smem:

    $ sudo smem --userfilter=nobody -k --totals

    PID User     Command                         Swap      USS      PSS      RSS 
    23365 nobody   /tmp/.mount_markteqQvqZF/ma        0     6.3M    14.2M    37.7M 
    23388 nobody   /tmp/.mount_markteqQvqZF/ma        0    46.6M    59.4M    90.9M 
    23363 nobody   ./marktext --no-sandbox            0    53.3M    76.3M   118.4M 
    23392 nobody   /tmp/.mount_markteqQvqZF/ma        0   121.1M   142.3M   183.0M 
PSS (Potential Set Size) [1] numbers are additive unlike RSS, so we can sum them and get around 291 Mb of RAM. This counts pages, that are shared between several processes, only once.

Either MacOS uses RAM several times more effective than Linux, or Activity Monitor is showing incorrect numbers to make impression that Mac apps take less memory than apps on competing operating systems.

[1] https://en.wikipedia.org/wiki/Proportional_set_size


"Electron apps"

Wrapped web engine and the site does not an app make.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: