This doesn’t have to be forever. Maybe in the future, developers will start using React Native to build desktop applications. Or perhaps Flutter! Electron apps have a bad reputation for using too much RAM, have potential security issues, can’t (yet) match the speed of C++, and they often lack the polish and familiarity of a great native app.
But it seems clear to me that OS-specific SDKs are becoming a liability for desktop OS vendors. Developers want to use the technologies they know, and they want maximum reach for the products they build. And they’re smart enough to get what they want. A lack of cooperation on the part of Apple, Google, and Microsoft will only hurt users.
Say hello to your new Electron overlord.
At 33, I’m perhaps staring to show signs of becoming an old man, but I really don’t like Electron applications. I use Discord every day, and it just feels slow, cumbersome, and out of place on my virtually 100% Modern/Fluent Design Windows desktop, Surface, and my iPhone X. I greatly prefer proper, platform-specific native applications, but I feel that ship may have sailed with things like Electron and Progressive Web Apps.
I’m not looking forward to this future.
I feel the same way about electron apps; bloated, feature anemic, poorly integrated, cumbersome… But I feel like all those words also describe “modern” apps on windows. I try to give MS the benefit of the doubt, but every time I try one of the modern apps I’m disappointed.
Electron runs on a highly optimized JS runtime, one which matches the .NET framework on which all those so-called native “modern” apps are built on top of. The DOM is behind the modern API in some reguards (not every reguard), but they are working on that. Soon electron apps will feel faster than some native apps.
The real solution will be things like React Native, weex, Flutter and the like, but the various vendors need to solve the distribution problem. That’s what Apple is planning to do with their merger between iOS and macOS. Once getting iPad apps to run on macOS is a matter of adding a platform to finished work, rather than a full port, we’ll start to see more macOS apps. Apple is miles ahead of the competition on that front.
Electron runs on a highly optimized JS runtime, one which matches the .NET framework on which all those so-called native “modern” apps are built on top of.
Nope and nope. .NET (Core or proper) is better than any JS runtime. And it will always be so because of… JS, the language.
I mean obviously it’s more complex than which is faster – but it’s not true claim javascript isn’t fast. And it’s still getting faster. Believe what you want though – I’ll keep writing fast js apps.
Nope. https://www.smh.com.au/technology/users-don-t-want-ios-to-merge-with…
Users don’t know what they want until you show it to them. If you do what users say they want, you end up with Windows…
when you see what can get achieved in something like MenuetOS and some amazing coding skills – web apps make me sad.
another favorite site of mine is tinyapps.org which generally showcases some amazing little apps, generally standalone.
I feel like everything today is going over-engineered or over-simplified.
I came across a self checkout the other day that seems to have adopted a flattened design. It made me rather angry that I did not find it intuitive to use at all. Not a single word or label on any button. AM I too smart to use an interface they have designed for the lowest common denominator?
Or, like everything else lately, have they all abandoned user-centered design? Have designers been given divine intervention? Did Moses come down from the mountain with some UX tablets? did I miss that memo?
!!!!!!!!!!!!!!LA-LA!!!!!!!!!!!
(translation from tuby-speak)
Bow down before your Gnome3-using Teletuby OverLord Human Scum!!!
Edited 2018-05-17 05:58 UTC
We have much better and faster processors, however applications seem to feel sluggish compared to older times. I remember even Windows 95 feeling more responsive.
I understand that due to hi-dpi displays and multi-monitor setups it is now necessary to use desktop composition. Some other things like security, better unicode support, etc come with costs. I accept them.
However I still believe we can at least continue writing native desktop applications and not push HTML based clunky ones. I like my web sites inside my browser, but I don’t want them to take over my PC.
yes, exactly, this is why our ExactScanPro is some 20 MB, including OCR and nearly 500 scanner drivers: https://exactscan.com Also macOS and such start to make me so sick, that I dedicated some of my videos to showing and re-exploring vintage things: https://youtube.com/renerebe
Yet? How about never?
It’s a physical impossibility that a thing that runs in a VM would ever match something that runs without a VM.
JavaScript and other similar non-native languages are not intrinsically slower than C/C++. They are much harder to write good optimizers for and much easier to write slow code in, but it’s not an insurmountable problem. JavaScript compilers have gotten a lot better than they used to be and continue to improve. In practice, browser JavaScript implementations tend to avoid over-optimizing on run time because from the perspective of the user of a web browser, the compile time is part of the run time. This is less of an issue for an Electron app which could theoretically do compilation work at packaging and/or installation time.
As an example, https://stackoverflow.com/a/4528285 lists a few areas where Java (not JavaScript, but similar at a high level) out-performs C/C++ due to the advantages of JIT compilation and garbage collection. In practice, of course, these advantages are edge cases and/or are overwhelmed by other factors which make it slower.
To be clear, I’m not predicting JavaScript run time performance parity with C++ any time soon. But it’s a research and engineering challenge, not a physical impossibility.
It is a physical impossibility because doing something extra is always slower than not doing something extra. As for JIT, native code (I’m not just limiting it to C++) is not at odds with JIT. If Java (and other VM languages) can use JIT, then so can/does native code. But the stackoverflow link doesn’t really show anything, since it’s comparing Java to Java-like native code, and not sensibly native code.
The issue, though, is not just speed. It’s also memory usage and power consumption. No VM language can approach native code in all three areas of speed, memory usage and power consumption.
There’s no doubt you *can* write faster code in C than in an interpreted/bytecode language.
There’s also no doubt that it is *possible* to hand-write assembly that’s faster than the C compiler enables.
The caveat is of course that making said faster code requires a level of expertise and time investment.
If you need to spend a long time learning and conceptualising a solution that gives you even a 5% speed-up, you need to be able to justify that.
It’s writing for a heavily optimised platform that allows ideas to be expressed easily, or writing for a platform that requires heaps of domain knowledge and will come back to bite you with overflows, memory access issues, and security problems unless you’re an expert.
99% of desktop applications just don’t warrant that level of expertise.
A chat, to-do, or text-editor app aren’t a compiler or a browser, so they don’t need it.
Again, what expertise? Modern native languages are easy, and you have to increasingly go out of your way to write inefficient code.
Edited 2018-05-17 05:23 UTC
pypy comes damned close to native on all 3 fronts, so it’s not inherent to compiled vs. interpreted.
And Java runs on *ATM cards*. They are powered through induction and have memory measured in bytes.
Do you understand of concept of *comparing* with native languages on the same systems?
Do you also want to tell me what language the Java ATM card VM is written in?
First of all, could you please drop the condescending tone? It’s not helpful.
The point being that it *can* work under those constraints.
I don’t care that C is faster or more efficient or uses less RAM.
If the code is harder to grasp or the barriers to entry are higher, the use-case *needs* to warrant it.
The vast majority of use cases don’t need it.
How can I be NOT condescending when you’re trying to argue a completely separate point to what I argued?
The point being isn’t that it “can” work. I have been consistently talking about that it is faster, more efficent and uses less memory. You just basically agreed with what I have been arguing.
Just look at the first thing I said to you.
I know native is almost always faster, more energy efficient, and uses less memory.
My point is that it has a higher barrier to entry than more user-friendly languages and frameworks, and that it takes longer to express ideas when you also have to worry about things like pointers, memory allocation, etc.
Writing a GUI for Qt in Python is much simpler and faster than writing the same thing in C++.
Yeah, it will use more RAM, energy, and CPU time.
My entire point is that the majority of the time, that trade-off is worth it.
Mission-critical things, and software that needs every ounce of performance should obviously be written in native code or even assembly.
But you can’t pretend it isn’t quicker to write using interpreted languages. That’s why Electron is so popular.
tl;dr: Yes, obviously native is faster/more efficient. Most of the time that speed/efficiency isn’t worth it in terms of development costs.
This is such blatant arrogance. I get quite tired of C devs thinking their shit doesn’t stink. Some of the worse libs I’ve had to deal with is proprietary C libs. I ended up re-implenting my own versions in C# that actually worked.
You can write efficient code with a managed language such as C# or Java. Understanding what the CLR or the JVM is doing in the background is pretty key and almost every interview I’ve had for a contract in the last 10 years have given me about 45 minutes worth of questions about how memory etc is managed by the CLR or JVM.
Even with JS, if you wanna get a job at a decent place doing it. You will be asked about programming patterns, DOM manipulation and a bunch of other stuff relating to performance and security (XSS, XSRF etc).
And yet learning about the ins and outs of a native language is too hard? Funny how people complain about learning the all corners of native language, but they’ll have to learn just as much about the VM anyway. How can anyone say it’s easier then?
Sorry it isn’t really comparable, you must know this. Learning what the CLR or JVM do can be summed up into a few pages (at most) of general principles and best practices. Also Patterns are just good coding practices.
With C# it a lot harder for a novice to do something truly terrible. Also it is relatively simple where to point a novice to the right bit of documentation if they are doing something incorrectly. In Comparison to C, I wouldn’t even know where to start these days.
There are tonnes of other benefits to using a managed language with type safety. Performance and Memory isn’t always the most important thing.
Then you have things like hiring and clients. Most clients already have bespoke .NET software, it is easy to find a decent C# dev and getting rid of the idiots I can normally do within 15 minutes on the phone.
There are other considerations other than performance that if you are being pragmatic are much more pertinent.
Edited 2018-05-17 07:53 UTC
Good for you.
Do you remember what my original point was?
My original point was no matter how efficient VM languages get, they can never get as efficient as native languages.
You can keep bringing up diversions about arrogance if you want, but you’re completely arguing for something completely different to what my original point was about.
Can you point me to your github so I can check out your awesome code? Thanks
https://github.com/guan-jing-ren/native-2-web
It isn’t a diversion. It was me calling you out for blatant arrogance. As I said I am fed up of C programmers and their Ilk pretending that their shit doesn’t stink. If you don’t like it, don’t make smarmy arrogant remarks.
Also this is a discussion, in a discussion generally things deviate away from the original point, guess what we have a different view point yours (I actually provided some numbers), that it really depends what you are trying to achieve whether the performance difference would be worth it. This is something that you seem incapable of grasping.
Edited 2018-05-17 08:55 UTC
No, you are arguing a different point. I wasn’t arguing against that point. I simply refuse to take your bait of trying to create a diversion away from the main point I was making and that you were purporting to respond to.
No you are now claiming it is that to cover your arse. If it was different you would have clarified immediately.
You made it about the programmers as you specifically referred to unlearning bad habits. A programming language can’t have habits.
Don’t lie.
Programmers picking up habits doesn’t make them inferior either, dumbass.
You talk about false dichotomy, but you just proved you’ve been continually serving one up yourself the whole time.
Good programmers can pick up bad habits.
I demand a f–king apology.
Edited 2018-05-17 09:40 UTC
I haven’t done anything wrong. You will have better time trying to get blood from a stone.
Also I don’t apologise to people that “demand a f–king apology”.
Edited 2018-05-17 09:48 UTC
Yeah, I wasn’t really expecting someone like you to apologize, LIAR.
Edited 2018-05-17 10:07 UTC
Then maybe you should use language more accurately.
In anycase, I don’t believe you. Also you are a jumped up self entitled twit demanding a “f–king apology”. It is pathetic.
Edited 2018-05-17 10:35 UTC
You entered a discussion and quickly proceeded to complain about arrogance due to a mirage of your own making. That, to me, is truly pathetic. And also arrogant.
If there’s anyone who looks down on anyone else here, it’s you. Just look at your first comment complaining about arrogance.
I said “Good Day” before you edited your comment, so I guess I take it back.
Edited 2018-05-17 10:43 UTC
I quickly proceeded to call out this bullshit and unsubstantiated claim that by using a certain programming language you somehow developer “bad habits”. BTW I still haven’t heard a concrete definition of what a “Bad Habit” is. You decided for quite a few comments it was about the language, then it was developers getting bad habits (no idea what these habits are still) and then I am now arrogant.
I know what back-pedalling looks like.
I didn’t take back anything I said (apart from the “Good Day”).
Do you know what back-pedalling means, you fool?
Let me state this clearly: I hold by everything I have said till now, everything I have added to them, to the same strength and in their entirety that I held it when I first typed it out.
It is really not my problem that you are clearly illiterate.
You changed your story of what you said like 3 times. Then claimed I could not assume your intent. I suppose you are correct, I can’t assume your intent because I you kept on changing your story.
Nope. You keep making misrepresentations, and I tried to keep adding explanations and details to further explain myself. Now you throw it back in my face by claiming that amounts to changing my story?
Basically your tactic is toc misrepresent someone, and one someone tries to correct you, that’s changing their story. f–k off, you c*nt.
Edited 2018-05-17 11:57 UTC
Now I know why you quickly complained about arrogance.
Because you, individually, are probably an inferior programmer. You can’t read for shit, and you can’t reason for shit. And that triggered your inferiority complex to no end.
“Strongly implies” was all you got to back up your pathetic excuse for a whinge. f–k off, mate.
Edited 2018-05-17 11:40 UTC
I just looked at your JS code, the SRP principle isn’t something you really get is it. I particularly like the massively long anonymous functions inside of a 100 line function.
Once it gets past 30 lines you might wanna break it down a bit. Just saying
Edited 2018-05-17 11:51 UTC
Really? That’s all you’ve got? To pick on demonstration code? I guess you didn’t bother trying to read the C++ code, because you… can’t.
You also seem to know nothing about software development as things under go cleanup and refactoring, and none of that code is “finished” by any means.
Wow. Of all the things you could do to demonstrate you’re not an inferior programmer, and you come up with this piss-weak excuse for a code review.
Let’s see you write a native server code that automatically converts a native API into a websocket callable function, and display a HTML GUI that can represent arbitrary native structures.
I put up my code in response to someone’s request. I’d request to see yours, but you’re probably too chicken-shit scared.
Actually I did read the C++ code, I didn’t comment on it because …
I don’t do C++ professionally and I would be talking out of my backside if I critiqued it.
Of all the stereotypical bikeshedding inferior programmers like to do, this is it.
I mean, sure, take no notice of the fact that most functions in that file aren’t long. And if you bothered looking at the commit history, there has been refactoring work quite a few revisions.
And “30 lines” is arbitrary, like as though someone learnt that in uni and had trouble getting rid of the training wheels. Typical cargo-cult practices of inferior programmers.
Any more junior-programmer-code-review comments you want to say?
LOL you started calling me a shit programmer so I decided to nitpick your code that you posted to show how good you are.
You don’t like it so starts throwing more insults.
BTW ran it through JShint. I didn’t include where it couldn’t find d3.js as I expected it was referenced somewhere else.
Maybe you should add a JS linter to your commit process.
Edited 2018-05-17 12:17 UTC
No need. Most of the code will eventually be rewritten in C++ and compiled as WebAssembly.
Maybe you should be less reliant on tools, but then again, you continue to prove you are an inferior programmer.
Funny how you don’t put your code up for review.
You called me a shit programmer and then I nick picked to take the mickey. FFS you are dense.
I know you’re taking the mickey, dumbass.
But I’m still allowed to comment on it how I see fit.
For fuck’s sake you are a massive tosser. You can dish it out but you can’t take it. You are an inferior programmer.
I’ve been taking it mush and giving a lot back. You are the one that has been calling me a cunt and losing your temper. I think the opposite is true.
No, because I didn’t start off with the insults. You couldn’t read, so you started complaining and started misrepresenting me. The “dish out but can’t take it” applies only to people who dish out. I don’t dish out. I only respond, so I have no obligation to “take it”.
If you can’t take it, don’t start shit in the first place, coward.
Where’s your code, coward?
I am a sociopath now. This is hilarious. I got a free upgrade.
Maybe you should turn your imagination to writing some sort of shite law and order episode where someone goes around killing people based on the worthiness of their github submissions.
They could even have a `Leonard Trovalds` as a lead expert in the investigation as he is the creator of `CodeHub` and he dies after using virtual reality to chase the suspect through cyber spac.
https://pastebin.com/1VhfCahL
This is not exactly straight forward to read.
Edited 2018-05-17 12:30 UTC
No, it isn’t. Where’s your code?
Edited 2018-05-17 12:48 UTC
All my work is done under NDA. I couldn’t show you the code if I wanted to.
Not even a Github account for personal projects?
How convenient. How very convenient.
What a cowardly thing to do to (poorly) criticize someone’s code knowing full well you yourself would be safe from criticism.
LOL Apparently not showing your code is cowardice. We must update the Code of Chivalry (pun not intended, but it works quite nicely), that if one slags off another Knights JS, he must expose his Git Repo …. Dickhead.
I am not going to reveal too much. Especially in my line of work as I normally work for gambling, affiliates etc. In the current climate It would be madness to show you my repos as they all have my company name on them. All my code is namespaced with my company name.
Also you know I am taking the mickey yet still being super serious about it.
Edited 2018-05-17 13:27 UTC
Ah, so you’re a piece of shit in real life too. No wonder you have such an inferiority complex. And gambling – OF COURSE that is what someone like you would do. You only dare to screw with other people when the odds are stacked in your favour and they can’t fight back, and you probably tell yourself that it’s okay to get old people addicted to gambling and lose all their money. No wonder you’re a piece of shit.
No. This is showing your ignorance.
All of the bookies I work with I make sure they are following the guidelines from https://about.gambleaware.org/.
I do gamble myself once every 3 months down a casino with friends and I do spend a lot of money there. Like anything else, if it is done in moderation it is perfectly good fun.
Yes there are gambling addicts and every Bookie in the UK is required by law to stop someone that is obviously an addict.
I don’t know everything about the legality because I normally either an affiliate or I have built stuff for them in the past.
I am a libertarian (a strange thing in the UK) and I believe every adult is responsible for themselves. I think the Government restrictions are fair in the UK.
I like a punt on horse racing, cryto, elections (won a lot on Trump winning and Brexit) etc. Sometimes I win and sometimes I lose. Most of the time I win, because I got a good feeling for political results.
I want to make this very clear, I would never endorse any company that took advantage of addicts.
BTW most gambling companies treat their staff very well. Even contractors. Much better than other industries.
Here is a more sensible discussion on topic than what you presented:
https://www.youtube.com/watch?v=V-_V7LHiIGc
Edited 2018-05-17 13:49 UTC
Sensible because it speaks in your favour. Colour me surprised.
Edited 2018-05-17 13:55 UTC
They aren’t victims. Once you are an adult you have personal responsibility.
If they spent all their retirement on a expensive car would that be the dealers fault for selling them the car? Nope.
What a really shitty comparison. Crappy excuses seems to be your way of getting through life in general.
How is it? Cars depreciate quickly in value and the money is gone after a few years.
That is clearly the reasoning of a sociopath. I was right.
While until the gambling convo I was taking the mickey. I was speaking sincerely about my beliefs about personal responsibility and addiction.
It seems you don’t really have an argument and have gone down the name calling route.
It is a shame, because I continually dismantled your arguments (about gambling) and you are happy to ignore any argument that doesn’t support the victim-hood narrative.
Calling someone a sociopath is just a quick an easy way to label someone so you don’t have to engage in their arguments. The worst I ever called you was a Twit and a Liar (those aren’t labels, they are accusations and insults).
You did what a lot of people will do when they are losing an argument about a particular subject (in this case the gambling argument). They label the opponent something horrific so it makes it easy for them to dismiss any argument that is cogent.
Edited 2018-05-17 15:02 UTC
Whatever mate. Your behaviour is out for all to see. You’re a coward and a piece of shit. Sociopaths always downplay their actions – for you it’s “taking the mickey”. But when it turns back on you for your shitty role in society, now it’s “serious”.*
Piece of shit industries attract piece of shit people, and piece of shit people always downplay themselves and blame others.
* btw, that’s classic sociopathy. That’s not a label, that’s a description. Sociopaths always love to pick the moment to start accounting that favours them. I start at the beginning, with my comment that has lead to all this. You start at the moment when the tables were turned on you – everything else before that doesn’t count. You’re a piece of shit and you show it.
Edited 2018-05-17 15:16 UTC
It is a label to avoid taking what I said seriously about the gambling industry.
I answered every question about the gambling industry sincerely and to the best of my abilities.
You have now decided that you do not want to engage in anything close to civil discourse.
Before hand we were both having a go at one another which I don’t mind at all.
calling someone some sort of sociopath is 1) not something you really know anything about Mr Armchair psychologist 2) It is just a way to get out of the cogent points in the previous reply I made to you.
If you don’t want to learn anything, that is your lookout not mine.
You lost the argument on gambling and now trying to fling shit at me hoping it sticks.
Edited 2018-05-17 15:35 UTC
Eh, it kinda seems, at least somewhat more often than thrughout the general population, that libertarians are almost by definition / by their own insistance sociopaths… they usually think they’re the ones who will “make it” (if only the rules of “nanny state” weren’t there…), usually at the expense of others. Working in gambling industry fits…
And… holy silly flamewar, Batman!
(that said, you did seem, at the beginning, slightly arrogantly describing “unpure” programming languages and the enlightenment of the holy ones… …but I guess you can be / what do I know, I’m not even a code monkey)
You also won’t don’t care about the job the gambling industry creates.
Most of the gambling industry today sees itself as entertainment.
A lot of money isn’t made on gambling whales. My sister and her friends go to a bingo night at Gala. They all pay a few pounds to enter and there is a prize on bingo.
You are constantly evaluating it on the worst of the industry and not what is normative.
Nice change of context. You didn’t read what I said.
You made the claim that old programs on old hardware would be better. It is all conjecture. JVM, JS VMs are much faster than they used to be, processors are several times faster, faster ram, faster disk. Also again “Feeling” is completely subjective.
I want numbers. I gave you numbers saying that Java is decently fast, so is C#. They aren’t slow, they just aren’t as fast as C. Also btw, you failed to mention in some cases native languages were slower than C# and Java dependant on what you were doing. Which is clearly shown.
Nice way to try to misrepresent me. I really can’t be bothered with someone who simply wants to be right for the sake of being right.
Edited 2018-05-17 09:43 UTC
Apparently having a discussion about a topic is now bait. Get a grip.
I made one point. You brought up a complete red herring. You weren’t trying to have a discussion. Liar.
Someone is angry. In any case I didn’t.
Not everyone sees every single issue with blinders on.
You misinterpreting me, calling me a liar, yeah I am angry.
Trying to take the moral high ground by comparing anger levels is TRULY pathetic.
You remind me of when Deepak Chopra tried to win an argument against Richard Dawkins by calling him angry. When you peddle bullshit, making reference to another person’s state of mind, especially when you were involved in it, is typical bullshit peddler behaviour.
Edited 2018-05-17 10:47 UTC
I made an observation (which was correct). I didn’t say I had an moral authority.
Also mate you aren’t a Richard Dawkins.
You continually prove you have trouble reading plain english.
I was comparing you to Deepak Chopra.
You can’t read plain English as what I said was an insult. I said “you clearly aren’t dawkins”. It was an obvious backhanded statement.
Edited 2018-05-17 11:46 UTC
With C# it a lot harder for a novice to do something truly terrible. Also it is relatively simple where to point a novice to the right bit of documentation if they are doing something incorrectly. In Comparison to C, I wouldn’t even know where to start these days.
You mean other than creating an app using C# to begin with?
Just being interested, which nasty habits?
Depends on the language and what you are doing. With C you are correct it will win out in almost anything. Other compiled languages … not so much, in fact Java and C# beat quite a few languages that are compiled to a native binary when considering power consumption.
Also JavaScript is a lot more energy efficient than a lot of languages when dealing with string manipulation (regexs) according to the paper below.
http://greenlab.di.uminho.pt/wp-content/uploads/2017/09/paperSLE.pd…
I suspect that JavaScript will continue to be faster and more memory efficient as the years go by because there is a huge resources being put into making it faster. C and its compilers have had 40+ years of people making tooling for it. JavaScript has at best about 10 years (basically since Google released V8).
Edited 2018-05-17 05:52 UTC
It’s an oversimplification though – where do you draw the line between what’s vm and not vm. Userland vs. kernel code – I could say kernel code is the only native code, and then someone else would come along as say only code written in asm counts. It’s all arbitrary.
In practice a high level dynamic language like JS will probably never run as fast as highly optimized C++, but it’s already really really fast compared to VMs of the old days. Modern JS engines run circles around even not too old (comparatively lower level) Java and .NET environments.
And then there’s webassembly, which is also available, and is no slouch. It’s just not true that a JIT or a VM (which BTW aren’t the same things) is or has to be slow. It’s not even true that an interpreter has to be slow.
Languages that use garbage collection _will_ be slower pretty much always.
(ASM.js does not feature garbage collection however, but then you’re writing in a non-JS language that compiles to ASM.js.)
Yes, except in rare edge cases, garbage collection will be slower than explicitly freeing memory (and, of course, in those edge cases, you can use garbage collection in C/C++ if it’s right for your application). But the explicit calls to free (or simply allocating on the stack in the first place) can theoretically be added by a compiler, not just by a human. In practice, this is really hard and is currently only done in very simple cases (e.g. when an object is constructed and freed in the same method), but it’s not impossible to imagine a type system that could capture most common memory usage patterns in Javascript while being inferable without annotations in reasonable code. I’m not up-to-date on the details of how modern Javascript engines work, so it’s entirely possible some analyses along these lines actually are already being done.
There are improving algorithms for GC though – it used to be that most GC would “stop the world” and climb all the trees to figure out what to clear, but these days GC engines are getting smarter, and are able to clear smaller limbs in shorter bursts. It’s still a problem, but it’s getting better, and it’s not slow.
And then again, there are ways to manually manage the GC, or you can use those asm.js/webassembly manually allocated memory blocks if you really need faster memory access with no GC hiccups. There are options in the electron space. I’m actually kind of excited to write some RUST apps which could be delivered to web browsers as a PWA or electron app.
BTW, a better PWA system for desktops could go a long way to reducing the need for standalone electron apps. Chromes implementation of web apps was horribly broken on the desktop, but the mobile platforms (Android and iOS) both have a great solution. If you install a PWA shortcut to your homescreen on those platforms, and the PWA is written well, it’s hard to tell the difference from a native app.
Here’s one to try (the ads ruin the experience on iPad and desktop, but that’s a different problem):
https://www.makebeliefscomix.com/Comix/
All we really need is something similar on the desktop – then no more need for electron!
Java is not comparable to JavaScript in that regard. In JavaScript (and any dynamic language) property and global scope lookups are hashtable lookups! So many hashtable lookups for everything that is just dereferencing a pointer in native languages. There are hard limits on how you can optimize such a language.
I would concede that you have to be careful on things like the scope chain, loops, inline JS and DOM access can be a bit tricky.
The main trick with JS (especially with older interpreter) is to make sure you cache any variable that can pre calculated in loops.
Also a lot of programmers rely a lot of jQuery, which can be quite slow in certain operations and they don’t do stuff like
Which really slows stuff down on mobile devices. Also jQuery animations are really slow and will block the whole event loop, whereas CSS transitions are outside of the event loop.
I haven’t done a lot of stuff with Server side JS.
In practice, modern Javascript engines perform type inference and are able to compile code that semantically has those slow hashtable lookups to something similar to what you would expect for a Java field access. This usually involves some type tag checking when the analysis can’t guarantee it got the type right. Due to branch predication in modern processors, checking a type tag is nearly free if check passes. The main issue with that kind of optimization is that in dynamic languages, programmers sometimes actually take advantage of the fact that it’s dynamic and write code in a way that doesn’t really have an equivalent in static code, so the JIT is forced to fall back to slower code. In other words, some Javascript code is in fact intrinsically slow (e.g. as a worst case, eval can never be fast in general), but that doesn’t mean all of it is.
A huge number of applications are built in managed languages now. This is the same old complaint when Java and C# came out. I use lots of IntelliJ products and they are all built in Java, they work fine.
Anecdotally, I use VS Code, Discord, Slack all day. I have no idea what you are on about it “feeling slow”. I run VSCode on several low end machines now i.e. a E6410 laptop (old core i5) to a Core 2 Duo from 2008. However in all my systems I have fast SSD disks and as much ram as I can stuff in them.
I also use Discord on my iPhone 6S. Works fine, no faster or slower than any other application on my iPhone. I have no idea how Thom’s iPhone X would be slower with discord.
The only applications that are a lot faster than VSCode are Notepad++ (which only has about 20% of the features of VSCode).
Considering that both Discord and Slack are better than Skype which are native, really shows that it really doesn’t matter.
Anyway, all electron is really doing is fulfilling Atwood’s law:
https://blog.codinghorror.com/the-principle-of-least-power/
Edited 2018-05-17 03:28 UTC
I get random hangs all the time in slack. It’s just absolute garbage. Having said that GTK is no rose either. Unable to even auto connect signal handlers in C++. I think every desktop environment is stuffed at the moment. They are all flawed in one way or another. No big surprise to see there’s no relief coming any time soon.
That may also have to do with how they wrote Slack. That’s a LAMP app on the back end, with a bunch of jQuery on the front end. You are bound to run into performance hiccups with that kind of stack – although, Slack has actually done a wonderful job with it.
I like some Electron apps (Atom, vscode, slack) but this article is just clueless in the extreme.
But such is the way of this industry. Every X months something comes around that a bunch of morons thinks solves everyone’s problem and that should be used for every possible solution. (See Blockchain, NoSQL, RubyOnRails, XML etc etc)
It’s “use the right tool for the job”, not “shoehorn the tool I like into being a half-assed, at best, tool for the job”.
Edited 2018-05-17 04:46 UTC
NoSQL – ain’t that the truth! Something like MongoDB is not even really NoSQL anymore – it’s more like unsafe less articulate SQL.
Edited 2018-05-17 06:09 UTC
at 33 these signs are being wise.
“OS-specific SDKs are becoming a liability for desktop OS vendors”
Definitely, doing C++ or Python using Qt is a very good proof of that. Cross-platform, easy to use (yes, even in C++). Why reinvent yet another square wheel? Why spend an insane amount of time and energy in testing and re-testing things a compiler would catch right away?
Actually I would find it time Microsoft (and Apple) incorporate Python into their OS. If cross platform toolkits prevail in the end or rather wrappers around native widgets prove to be the lasting solution has yet to be seen. For performance critical parts you can always combine C (or objective C) with Python. Works perfect.
HTML was devised as a language to diplay text, with embedded pictures and links to jump to other text pages.
In the meantime all kinds of weird things have been bolted on to make it somehow useable to build database applications and now they even tell us it is the future for desktop programming. It is a nightmare.
There was a joke i saw on twitter once.
“What would you do with a beefy 18-core laptop?”
“I’d run two electron apps at the same time”
The more i experiment with this technology, the more i understand that joke.
Mac, Windows and Linux (supported platforms for Electron) is only a subset of “every OS”.
I’m also pretty sure it doesn’t “compile into a binary”..
Edited 2018-05-17 08:08 UTC
For phones there’s Cordova. In fact you can use the same (web-technology-based) code for mobile and desktop, all platforms, by using a combination of Electron and Cordova.
I suspect “packages into a binary” would be a more accurate description… bundling the runtime into an installer alongside the app.
That seems to be the future of Java – with the modularised runtime libraries that landed in 9, they support building a cut-down runtime environment that’s got just the bits you care about for running your microservices container, or whatever…
They are the most used. Honestly nobody cares much about the rest. Icaros / Amiga OS user here.
cvedetails started tracking Electron only this year, but there are already two pretty ugly security vulnerabilities recorded there.
https://www.cvedetails.com/product/44696/Electronjs-Electron.html?ve…
For me, visual studio code (built on Electron) will frequently freeze up and go into a vegetative state, or just crash silently. Despite using –verbose, I’ve yet to get any useful debug info. Is it possible to even get a decent stacktrace from an Electron app?
It seems like it would be much easier to use an advanced language like Scala that can target multiple platforms: JVM and C (Native) and JavaScript. It is a bit more legwork to make it cross platform, but you get all the benefits of each platform that way.
You mean what, it ~compiles to JVM, C and js?
Javascript was a shit language from the start. Any language that starts out with global variables and sticks you with workarounds to fix that is ill-conceived for any serious use. That’s unfit for any program larger than a script.
There’s a danger in allowing industries to grow up around sub-par standards, and it’s now apparent in the creep of bloated, insecure technologies where they least belong. I am going to refuse apps built on Electron whenever possible, because it’s encouraging waste and negligence.
Yes, there’s a learning curve to the discipline of programming languages like C++, Rust, or Ada, but we’d see far fewer security breaches and less unnecessary obsolescence of perfectly good hardware if we insisted on decent engineering. People’s privacy, rights, and sometimes even safety are on the line in our field. Software engineers should program like social responsibility is a part of our job, because it is.
Edited 2018-05-17 12:21 UTC
With Rust or Ada, perhaps, but I’m not so sure about C++…
I thought you were talking about this for a moment: https://en.wikipedia.org/wiki/Acorn_Electron
I’ve been predicting this since the late 90’s.
It reminds me of when CD-ROMS first arrived. There were all kinds of CD-ROM programs. John Dvorak even had a show where they went over the best CD-ROM programs. Well, eventually the idea passed and there were just Desktop Applications – some of whom used media stored on an external media and some which didn’t.
I’ve always felt this was true of the Web. At some point, there are just applications – pieces of code that receive input from a user, access resources to process the input, and then output information back to the user. It doesn’t matter which machine houses the running code, which machine houses the data, etc. The idea of “Web Apps” will gradually disappear, and it will just become another source of information. Some apps will primarily access local resources, and some will access remote resources. Some will run from local resources, some from remote. The difference won’t mean much to the end user, and developers shouldn’t have such impedance when switching from local to remote resources. There will just be apps.
Holy f*cking sh*tfilled pancake factory. Just because something can be done it doesn’t mean it should be. And that’s all I have to say about that.
Well, that, and two more things.
Exactly. Problem is, have you met some of these people who call themselves developers these days? I say, if they want to use the tech they know, OK with me, just let the rest of us be. You want Electron? Fine, take it, run with it, just forget about shoving it down the uncaring crowds’ throat.
The uncaring crowds, er, don’t care. If the app runs well (Slack, VS Code) they’ll happily use it, and most won’t even wonder about whether it’s native or not – the truth is, no one cares.
Subtract 20 years, and it was Java Swing applications.
Sorry, I’ve seen this bullshit before. I’m calling it.
What BS though? 10 years ago, everything cool on the net was built with Flash, and then AIR let Flash run on iOS. Some banks and other financial institutions still use Flash/AIR based apps (oye). Today Flash is all but dead on the net, but is used for quite a number of native apps.
You know what? No one cares – and they are right not to care. If the app does what was advertised, people will use it.
Something will doubtlessly come along and dethrone JS, because it always happens – but it won’t be something harder to use. It’ll be something even more abstract, and even easier to build with.