GitHub calls this electron app "the new native" on https://desktop.github.com. But the app does not look or feel native. It has an active appearance even when it's in the background, content lags the window frame during resize, menu items are enabled even when they don't apply or work, some buttons with the default appearance don't respond to return, you can't drag and drop text, many context menus are broken, rubber band scrolling doesn't work, the title bar text is absent, selection modifier keys don't work properly...
If native is to mean anything, it can't mean this. Calling it "the new native" is an affront, because its UI regresses in so many places relative to real native apps.
It's not just UI but performance as well. For native apps, UI (hover state, clicks, etc) react in 0-1 frames. For Electron apps, these range from 3-10 frames.
The problem with Electron apps is that they're all running their own little Chromium-like instance, hogging up hundreds of MB of RAM, clogging up the process table with all its helper processes, using up CPU when idling. I get the easy cross-platform solution part, but this is just horrible UX.
I'm reminded of this article [0], about just how bad Electron is compared to native apps.
The editor that became known for consuming nontrivial amounts of CPU for blinking the cursor, something computers could do since they replaced paper tapes with screens.
I like VS Code and I don't want to crap on it, but I frequently experience massive UI lag on Windows - i.e., I start typing and the letters show up five seconds later. I think maybe it's related to source control? The same laptop runs Visual Studio fine.
Do you have any kind of anti-virus tool running? I experienced several slowdowns for autocompletion in VSCode, which turned away once Avira was deactivated. I think VsCode (and especially some plugins like the language services) are working with lots of files in the background, which got slowed down due to the filtering of these tools.
Out of curiosity, do you get this regardless of file type? I've noticed something similar but only in Python files, and I had assumed I had misconfigured my setup somehow. Just curious if your experience was similar.
oh heck, I get that in Visual Studio, IntelliJ, and XCode. Not saying I'm in love with electron apps, but they have their place. (I once wrote a trivial app using Adobe Air, also consumed hundreds of megs of ran, all the same issues as Electron...it just seems like the nature of the beast)
Usefulness amd usability trumps efficiency every time in any user facing application.
Electron enables a very large population of programmers and designers to produce useful applications using very evolved UI tech which can be multiplatform with nothing more than zipping with the right runtime - much easier than "native" or arcane cross platform UI libraries.
So of course people will develop useful stuff on it amd people will use it.
Nice. I came here to ask, "What exactly is Chrome doing while using CPU when the app is idle?" Answering this would leave the memory usage and installer size issues but make the architecture tenable for more applications.
In an artificial benchmark they are pretty similar, but in real world idiomatic code they are very different to c++. Nearly everything is on the heap so you've got pointers everywhere, dynamic data structures are used everywhere, virtual functions (particularly with java) and interfaces. There's is a reason java was so much slower than native code 20 years ago and that gap has been bridged by CPU progress more then compiler progress.
Like I said, the major exception is SIMD instructions. AV and heavy math are a tiny fraction of applications. For these you can use JNI.
There is precedent for this in Netty where they use a native poll mode driver and everything else Java, and it performs about as fast as pure C code on Techempower benchmarks
note: the article mentions that the app is written in TypeScript which _is_ statically typed and therefore many of these optimizations are at least possible if not in place
I'm disappointed by the article. Thought it was going to detail how Electron is actually a good choice, not how they had two separate teams for the different platforms and wanted to get rid of doubly-implementing features (not wanting double work is the obvious requirement and leading reason for going Electron).
I mean, git itself is cross-platform and not Electron. How more obvious does it need to get? It even has a GUI. Telegram Desktop is a modern example that did it. And Libreoffice. And Firefox and Thunderbird. And Audacity. And FileZilla. And everything else traditionally written in the open source community.
Java applications aren't great either. Due to their platform-independentness things like selecting and context menus seem to be re-implemented by every platform ifnot every project, leading to a lot of inconsistency and ugliness. But at least they aren't as sluggish as the web crap dubbed into being native that Electron is.
There are lots of good options but all the engineering blog is able to give for a reason is that it was the easiest.
Git itself isn't quite cross-platform - it's very backwards-compatible on *nix, yes, but it would be a stretch to call it native Windows software. There's a reason the Git for Windows project bundles MSYS2 ;)
> To maintain parity across the codebases, we had to implement and design the same features twice. If we ever wanted to add Linux support, we’d have to do it all a third time....Now we can share our logic and UI across all platforms, which is fantastic
I wonder whether they considered Java with SWT. For the past 10 years I've been developing an accounting application for Windows and Mac using SWT, and it's been a blessing to have such a simple, stable, cross-platform UI library.
It's also possible to implement plaform-specific behaviour. For example, standard SWT doesn't allow a native toolbar on Mac, but with a few 'if (mac)' statements I made my application look exactly like all other Mac apps:
http://imgur.com/a/l83yI
I'd say about 95% of my UI code is platform independent.
I haven't touched Java UIs since university - back then we were taught about AWT and Swing. I remember being unhappy with AWT because it never worked right and was inflexible - and I was equally unhappy with Swing because it never looked or felt native - and for some reason window resize redrawing was done slowly. I first heard about SWT more recently and it brought back my faith in the native desktop, but I've never used it.
In your experience, how well does SWT handle the differences between platforms (fundamental things like macOS vs Windows' menu-bars, to smaller things such as the arrangement of buttons in a dialog)?
Yes AWT/Swing was bloated, buggy and slow - Sun's poor UI implementation really doomed Java on the desktop.
But then IBM came along and did it right: SWT is super fast and lightweight because it simply calls underlying native API like Cocoa or Win32. It's always been super fast even when I started 10 years ago.
Layout of components on screen is straightforward and much easier than Swing. (Just use GridLayout 90% of the time). I have to specify different margins and fonts for Mac and Windows and you will need to change the order of the OK/Save and Cancel buttons, but that's not a big problem. (In fact there is a library called JFace which can do alot of this stuff for you, but it comes with a lot of baggage so you may just be better off with pure SWT).
The difference in menu bars is perfectly handled by SWT, and it includes Mac-specific menu options like having the Preferences and Quit menu item in the application menu.
You may notice a loss of fidelity here and there - for example, on Mac my error messages don't look exactly like a standard Mac error dialog: http://imgur.com/a/znehj I'm sure I could fix this with 'if(mac)' and breaking out to the native OS, but in 10 years it's never been a high priority for me.
"At IBM we hated Swing from day one. Big, buggy, and looks crap"
"All of the IBM developers are the same crowd who used to work with Smalltalk, and we reluctantly under management orders built our WebSphere Studio tools using Swing. It was a terrible, buggy, monster. In our initial previews when it was demo'd against Microsoft Visual Studio products all our users hated it just because of how it looked, never mind what it let you do"
"Swing was so badly broken deep down in the way it reads windows events...they read their event queue in a way that can leave memory holes so we had to have our own loop polling the windows event queue to do this correctly.....We tried over and over to get Sun to fix this but Amy just didn't understand this"
"Swing is like Java deciding not to do native IO using the operating system, but instead to use the disk motor arm API and read and write the disk data segments themselves."
As one who has experience with multiple UI frameworks, and 2 years of SWT i can only say that it is on par with Gtk+/C Gui development experience. It is terrible, with those int constants all around the API, not groupped in any intuitive way, to communicate what should be Or-able with what. The widgets are stupid, as to be native everywhere they usually provide only the common features.
Swing is way better choice, if you are on Java and want nice, feature rich, and somewhat (screen size) responsive UI.
I don't know JavaFx, but it may be worth a try also.
Yes I bundle the JRE with the download. In the old days I created a custom JRE with all the cruft stripped out but these days it's not too much to ask uses to download 50Mb. Hopefully with Jigsaw I can easily produce much smaller JREs in future.
> I wonder how Jetbrains manage to handle all the anti-JVM/Java crowd
Im definitely anti-jvm. I'm also a daily user of IDEA. Nothing else comes close to the same level of functionality with the breadth of language support available, on macos.
Electron apps are made for developers, but it's users who they're built for and who have to use it.
What I mean is, Electron apps make their life easier for a handful of programmers, to the detriment of thousands or in many cases million of users.
As a freelance developer, I think Electron is great for the little apps I build for clients for internal use. Companies like GitHub, Spotify, etc. have the resources to do much better than that. I have no idea why they settle for lousy performance just to use web technologies.
Short-term thinking: they save money of dev effort and assume their users will just tolerate their worse apps.
It's easy to sell yourself on the idea of cutting costs and growth potential to maximize returns now when you're an entrenched market player in a dominant position (as I would argue both GitHub and Spotify are).
Sure, I know they're saving money, but unless you _have_ to use something (Spotify, Skype), many people will choose a competitor instead of your app.
One such case is Atom—which from what I know is what Electron was created for: many people use Sublime Text instead. Not because of functionality, but just because Atom is super-slow in comparison, and it won't open or let you work productively with files bigger than 2-5MB.
I would argue that the money they save by not going native, they lose from people using better software.
> If you’re making a native app, your tech stack choices are pretty limited. On the macOS side, you’ll use Xcode, Swift, and AppKit. On Windows, you’ll use Visual Studio, C#, and WPF or UWP.
Or you could use C++ and Qt and suddenly have Windows,Mac and Linux support in one codebase. And the Qt mobile story is looking better with every release.
When I was developing the Linux version of a piece of software I make (https://www.chinesetextanalyser.com/) I started out with Gtk but it was a massive PITA to work with.
I switched to Qt and was pleasantly surprised at how nice it was to use.
I don't know what's worst these days, WannaCry ransomware or Electron apps, both makes me cry. Yet, WannaCry is native so I don't hate that as much as Electron apps.
Is C# good for writing GUI apps on Windows? I saw someone in a recent HN thread about Kotlin mention C#, and say that it works on many platforms (including for GUI's, maybe). But my question is limited to Windows.
C# with XAML is your best bet for writing GUI apps on Windows. UWP is the present of Windows GUI app development and just glancing at documentation you can quickly see that C# and XAML are front and center. You can do C++ and XAML if you wish/must, but C# is generally a better idea. (UWP supports .NET Native which AOT compiles C# UWP applications.)
C# and XAML can be used in WPF on versions of Windows prior to 10, if you need to support that. The C# is mostly compatible in both GUI systems, the XAML is very close, but subtly different, between the two.
(At Build last week, Microsoft announced the XAML Standard initiative to better standardize XAML across platforms. They also announced desktop support for Xamarin Forms, the XAML renderer for common subset of native controls across non-Windows platforms, to support macOS, Linux Gtk, and even WPF.)
I didn't mention it because HTML is great and all (and in fact right now more of my projects are HTML/JS), but XAML is a superior "native" GUI experience in Windows. Especially with things like Fluent Design's recently announced Acrylic material which doesn't have an easy-to-use HTML equivalent (yet?).
It would be great if there was an easier transition point from HTML/JS to XAML/JS or at least XAML/C#, for better more "native UI toolkit", but right now it feels like there is too much of a wall separating the rendering engines. HTML/JS can still feel quite native UI, but the gap is widening, especially once Fluent Design starts to become more common.
I agree completely, C# and XAML are definitely the way to go. I only wanted to mention JS as I've built a few UWP apps with it and it was a relatively painless experience. That was back when WinJS was a thing though, so at the time JS apps were very much "native" in design too.
Like you said though, it looks like JS apps are about to be left behind with Fluent/Acrylic in the Fall update. It seems like Microsoft is pushing the "Hosted Web App" for UWP instead of plain JS apps, even if they're still supported.
Yeah, JS is still the easiest way to build a native app and get the most cross-platform bang for the buck with the most UI shared (HTML is HTML and browser inter-compatibility is strong these days).
The push at build was even past the Hosted Web App to Progressive Web Apps in the Fall update when Edge has broader Service Worker support, etc. PWAs build on the footprint of the Hosted Web App, but include some of the standards efforts that others such as Google have also been pushing to the Progressive Web App space, including things like Service Worker-based caching (rather than Hosted's Manifest-based caching).
Hosted Web Apps and PWAs still have access, when installed, to the UWP APIs and it would be great if there were some APIs to composite things like Acrylic or certain XAML elements into an HTML page, in a Progressive way (fallback to HTML elements when the XAML ones aren't available).
I think, however, the focus for doing JS with Native UI has shifted over to React Native, which should have full support for all of that.
How to solve the issues above:
Just listen to 'ondrop' event on body and store the path of the file and call event.preventDefault() to prevent the file loading.
Now I think all of your issues are solved:
>1: You can now filter the extensions as per your requirements
>2: Now you can load the file separately and verify the content as per your satisfaction using the fs module available in electron
>3: You can use: ondragover and ondragend events to facilitate ui feedback
>4: Not sure what you mean by file drag, but I cannot think of anything that cannot be implemented here.
>5: Not sure what do you want here.
>6: Not inbuilt but can be built easily.
Editors like atom and vscode have very good file-drop functionality and have image viewer apart from many other goodies.
Depending on your familiarity with js, these things are more or less trivial to implement. Github team must have a different feature-set in mind that unfortunately didn't had drag and drop functionality for their first release. If anyone really wants the feature, the better way is to leave a feedback in app or open a issue (not sure if either exists).
Java on the desktop died because it didn't provide a native enough look and feel and it performed too slowly. Now we just don't care about look and feel and pretend every user has 16GB of RAM like the developer machines do.
I was talking more historically. Java was slow and fell out of favor at a time when the average desktop had 16MB of RAM (and many had less). It never recovered from that perception and was pretty much confined to server side tasks.
Now developers are working on electron apps and the average machine with 2GB makes an electron app today feel like a java one from 20 years ago.
Example of a properly done Swing app? Not trolling, genuinely curious to see what that looks like (code + result). I also assumed it was because they perform terribly and look non-native.
The JVM isn't actually slow to start [1] (albeit it does start about 3x-4x slower than python, ruby, or node) [2]. Most of the slow startup in a JVM-based application is in classloading [3] or waiting for your chosen framework to initialize [4] before the control is handed to your custom code.
For clients, JS runtimes offer a more polished experience on average than Java. That's not because of anything really intrinsic to the languages or platforms - it's just worked out that there is a lot of Java server code and a lot of JS client code, and consequently more catering to either of those extremes.
> JS runtimes offer a more polished experience on average than Java
[Citation needed]
They're both non-ideal solutions, but there is one caveat:
java tends to be the language of choice for companies like JetBrains, that want to deliver an awesome experience on all platforms, and go as far as shipping a custom JVM to make that happen.
javascript (read Electron) tends to be the language of choice for web developers who want to see their fancy icon in the Dock/Menubar.
You are pushing the maintenance and testing from your teams onto your users. Sure, you can easily have a multiplatform app this way, but your users suffer for that. It _should_ be the other way around, instead of transferring the cost of software engineering onto users.
Okay so, as much as we all want to complain about how awful Electron is for battery life and just general efficiency, the facts are that it most likely is going to stay - at least for a little while, considering how much is being invested in it.
Instead of complaining about what it does, perhaps we could be trying to make it more efficient, or make an alternative that solves the same problems (perceived or otherwise) in a better way?
This app has really have bad ui performance. Just check sourcetree. Atlassian has done wonder full job at creating and making it. No offense but, They now even have a chance to compete with it.
> If you’re making a native app, your tech stack choices are pretty limited. On the macOS side, you’ll use Xcode, Swift, and AppKit. On Windows, you’ll use Visual Studio, C#, and WPF or UWP.
I'm not sure they know what native means because c# is not native code and WPF is not a native UI.
> To maintain parity across the codebases, we had to implement and design the same features twice. If we ever wanted to add Linux support, we’d have to do it all a third time. All this meant we had twice the work, twice the bugs, and far less time to build new features.
Nothing forced them not to share logic from the start, they could have done that and still had a native UI on each platform. It only doubles the work if 100% of the work is in the UI.
> c# is not native code and WPF is not a native UI
"Native" confusingly has two different commonly used meanings. The one you seem to think is the only meaning distinguishes VM from non-VM runtime code (where C# is non-native). This meaning is the N in Android NDK.
The other common usage is "the preferred local platform specific language and dev stack", eg "A native Android app" which usually means "written in Java compiled to dalvik/art" distinguishing from a webapp or an app that is just a packaged webview.
I always interpret "native" to mean "without the use of an intermediary virtual machine." I assume my definition is overly simplistic, but am I incorrect?
The terminology for "native" used in the blog post is inexact (actually, incorrect), but consistent with how the casual usage of the term has drifted due to the competition from the 'web technologies' stack. In this usage, "native" means non-webview; and/or non-HTML5/JS/CSS-bundled-with-the-entire-browser-runtime.
Often it's also a byword for the platform-preferred first-party stack, making the argument somewhat tautological: of course there's a limited selection of first-party preferred stacks on every platform.
I'm guessing this usage is a contraction of the term "platform-native".
Yeah, I'm genuinely surprised that "four native developers" didn't realize that there is one native language which works great on all three platforms, and has direct bindings to all of the platform UI toolkits...
There isn't one that I know of. A language like c++ though would compile to a native library on each platform and allow them to share logic between 3 front ends in the same or a very similar language.
That's mostly what I meant. I don't particularly think it's a good idea to share UI code between platforms as different as macOS and Windows. I'm sure there will be serious integration regressions with the new version.
A native UI is one that uses that platforms (or desktop environment) native toolkit, that's win32 on windows, qt on KDE, gtk on gnome and cocoa (or whatever it is today) on Mac.
WPF is it's own toolkit built in directx, it's as native as swing. WPF sits at the same abstraction level as most games, would you consider the main menu in GTA to be a native one?
would you consider the main menu in GTA to be a native one?
Does a WPF menu (and WPF-based apps in general) integrate with the systemwide conventions and settings for things like keyboard shortcuts, default font, etc? Is it a first-class UI toolkit for the system? My impression was it is supposed to be, in a way GTA's UI (or Swing) is not.
> Does a WPF menu (and WPF-based apps in general) integrate with the systemwide conventions and settings for things like keyboard shortcuts, default font, etc?
About as well as swing ever did, no where near as good as Qt does, I think we'd all agree qt is not the native UI of windows.
Then again, it is hard to judge. Not a lot of win32 apps seem to follow system wide settings either, even the MS ones.
Really? It's just not the impression I get, granted it's been a while since I've used Windows for anything other than to, well, play a bit of GTA. I remember paint.net being a thing (seems it's still around) and it looked and behaved like a Windows app. Qt apps look instantly recognizable and fugly to me on any platform. It's hard to believe that WPF apps had or still have, say, the font-rendering problems Swing apps had or were missing access to affordances like control over the tray icon, etc.
The reason I'm skeptical is that WPF was very much intended to be a first-class Windows-specific ui toolkit. You're telling me it's worse than cross-platform toolkits with all of their necessary design and implementation compromises.
Edit: Oh! I figured out where I was confused. WPF and Winforms. Not the same thing.
Win32 is essentially deprecated and the native toolkit from Windows 8 on is the WinRT components/engines in "Windows.UI.*" which natively speak XAML (and natively here means these are C++ components baked into the OS). WPF has much more in common with the modern Windows.UI toolkit than Win32 does.
DirectX is at the same level of abstraction as Win32's Graphic Device Interface (GDI) and Hardware Abstraction Layer (HAL) that the rest of Win32's "native toolkit" was built on top of; Windows.UI is just as "native" as Win32 ever was. It should not be a surprise that the hardware abstraction toolkit beat into performance submission by performance demanding games is the new native layer for Windows. The surprise should be how long it has taken to make the transition across. (Avalon promised it back in Vista and WPF was the closest to delivering it. Windows 8 finally delivered on the Avalon promise.)
I think to some extent they felt WPF was a strong enough backward compatibility story. Windows 7 supports WPF well. There is a cross-over between WPF XAML and UWP XAML and it is possible to support both with a lot of code shared and even some XAML shared.
Of course, there have been bumps in the road in the compatibility story between the two XAML environments. .NET Standard 2.0 will help a ton (in the very near future), deeply increasing the amount of .NET code that can be shared between the environments. XAML Standard 1.0 (in the slightly further future) will help a lot, in particular the fact that Xamarin.Forms is planning to implement a WPF renderer for sharing a much larger portion of XAML across every platform.
Not just .net (I think it's all c underneath), I'd consider winforms with c# to be a native UI (but not native code) because it's just a .net wrapper around win32.
Yes, although the windows desktop situation is such a clusterfuck that I could make a case that it's not ;) It all depends on if you consider the full desktop or the metro interface to be the native one.
> Now if you mixing the notions of VM and runtime, even C has a runtime called crt0 on most UNIX systems.
I was mixing them up. The line seems be kind of blurry though once you start embedding garbage collectors though, then again the GC could just as easily be in an external library.
This is how you run different browsers in chrome-less mode:
iexplore -k %URL%, firefox -chrome %URL%, chrome --app="%URL%"
Launch nodejs, then launch the browser, and for the features not supported in the browser, have it talk to nodejs. You now have both a desktop app and a cloud app if you like. You could basically have the exact same code running on for example Github.com and on the desktop.
There are advantages with Electron/nw.js though, like only having to support one "browser" that makes it possible to use bleeding edge features.
I think this is great, especially for the electron ecosystem as github engineers are directly involved in making production apps on the stack(other than atom)
The cross platform advantage(time & maintenance effort) that electron gives is immense. The overhead is very minimal and we can build some great apps like vscode and the likes have shown.
Compared to what exactly? Because compared to an app built using the platform SDK's, Electron is never "minimal" in anything, except perhaps "integration" or "accessibility".
Minimal regard for the users' system resources? Minimal chance of being used because the user notices their laptop grinds to a halt and then runs out of power when the app is opened?
Don't want to create a flame war, but let's look at real world stats, at least for me, the overhead is very minimal. Look at the screenshot of my macbook pro 2013. I am running vscode for 100% of my development time. In the graph, I have sorted the processes by CPU Time (Not just CPU). That is the average amount of CPU used by each process over time. I have also included memory usage. While the total memory comes to around 400mb, it's still lesser than some Java based IDEs. For an app that I use as my main IDE, the resource usage (CPU) is very minimal.
Once you have Java based IDE's like the IntellJ/IDEA family etc in the mix, you can't really call editors like VSCode/Atom/etc an IDE. The functionality is nowhere near the same.
I don't like relying on a Java tool. IDEA Ultimate uses a lot of memory. But it has a lot of functionality too, which is why I accept the JVM overhead. If someone produced a fully featured IDE (or even plugins e.g. for Xcode) for macOS that was a true native app, I'd use that. But that doesn't exist.
The options for me are: true native editors (Coda, TextMate, CotEdit, etc), web-page-as-an-app, slightly more featured editors (VS Code, Atom), fully featured IDEs (IntelliJ IDEA, maybe ActiveState KomodoIDE, possibly a NetBeans/etc setup).
> But it has a lot of functionality too, which is why I accept the JVM overhead
This is something that can be replicated with additional plugins. To be honest, I have used Eclipse and Netbeans extensively. They do have additional features, but not a lot.
If I am not wrong, VSCode ships with a debugger and syntax highlighter built-in. There are tons of other plugins to add the extra functionality like GIT integration, built-in terminal, more syntax highlighting etc (Nowadays, you name it you have it). Even if you add 10 such plugins you are noway near a JVM based IDE on memory consumption. Also Netbeaans is very very slow, atleast in perception. Eclipse feels snappy, due to the use of SWT, but its a memory hog.
Most of the above features dont need constant monitoring, so adding a plugin for that purpose won't add any large overhead. And many plugins do similar tasks in Atom/VSCode with minimal overhead. Even for continuous monitoring of filesystem, node.js is very fast(there are many native plugins).
Disclaimer: I am developing an IDE using electron for a visual programming language. I have worked on JRE based IDE toolkits before (SWT/Swing). Both the runtime performance and developer experience appear better to me. You can of course get better performance if you directly write in the platforms native stack, but my point is that JRE is only as good as a properly architected Electron stack.
> Most of the above features don't need constant monitoring
The above features flat out aren't available in the Electron based editors people like to call IDE's now.
Im not talking about how possible it is to implement them - I'm explaining why I accept the overhead of a JVM based IDE, but won't accept an Electron one: the JVM one (JetBrains IDEA) has those features, none of the other options on macOS have them.
VS Code has less features then the main Visual Studio and Intellij IDEs, also I don't think the problem is the language but Electron. About memory uisage, garbage collected languages will show a larger memory usage because they will not start cleanup when an object is freed, it waits until it needs free memory and then it starts the GC and in Java I think you can specify options to control this,CPU usage is more important since that uses battery/enrgy
JVM has the same problem, isn't it?. In fact VSCode even after extending it with lots of plugin to make it a full-fledged IDE, feels more responsive and relatively lean on memory usage compared to full-fledged (JVM based) IDEs.
If you think VS Code with all plugins is an IDE at the level of Intellij or the main Vs then why VS still exists? Maybe you did not used this large IDEs so you don't know what the features or speed is, maybe your projects work good enough with VS Code or a plain text editor(not all projects need a big IDE).
My opinion is that Electron needs more optimizations, and the developers that use it need better tools and need to also care more about the CPU usage. Even if you would use c and compile to web assembly to run n electron the problems would still be there so not the Language is at fault but the implementation.
I find node.js pretty fast. The V8 engine does compile it to native during the run time using a JIT compiler. While it is not quite up to the level of java, it is comparable. The major lacking is no thread support, but it is a boon in many cases as tracking down runtime bugs in multi threaded environments is sometimes very tough. Threads can be simulated using child processes to some extend, but its the only major drawback as far as i have encountered.
While nodejs is fast enough, Electron and apps built on it aren't fast. Electron is a mix of Chromium and nodejs. Chromium's rendering isn't meant to be used as desktop app. Especially for laptops. I have a MacBook pro mid 2010 with two GPUs. Integrated GPU uses less battery energy than discrete one. And every Chromium app switches GPU to discrete one and causes battery drain.
> Chromium's rendering isn't meant to be used as desktop app.
Yes, it is. That was pretty much the entire point of Google making Chrome (to make web apps have acceptable parity with desktop apps), and the entire premise of them building on Chrome with ChromeOS.
Now, it may not satisfy you in that role, but it absolutely is meant for it.
Good point. People are bashing Electron and chromium in general. But they do forget JVM based IDEs had the same problem. Rather than bashing Electron, if we can figure out to make it more leaner and faster, it would be much better.
"We"? You mean people that know C++ and low level native APIs, right? Which is decidedly not you. You are building a "hackable" "node.js" "npm" "app". The problem is, people who are indeed capable of making some improvements, including people on the V8 and WebKit teams themselves, do not believe in what these tools attempt to accomplish. (Listen to Don Melton's interviews on the subject, for example.)
I say "some improvements, as the problem cannot be solved completely; you'd understand why if you understood the underlying technology.
If native is to mean anything, it can't mean this. Calling it "the new native" is an affront, because its UI regresses in so many places relative to real native apps.