Follow

Electron is not crossplatform 

any more than software that runs in a VMWare virtual appliance is crossplatform. It's not even significantly lighter weight than doing that.

Taking your platform with you doesn't make your software crossplatform.

Electron is not crossplatform 

@freakazoid tbh if the appliance were a stripped-down WinXP or Windows Server Core or something, it probably would be lower CPU utilization, if not lower RAM and disk space usage

so basically I think we're to the point where it'd literally be better if everything were native Win32 than web-first

Electron is not crossplatform 

@bhtooefr @freakazoid

I know some of the apps have since improved, but TBH I'm kind of here for the idea of straight-up shipping apps with an entire Windows container.

Just enough Windows to run in Hyper-V with a single full-screened app probably literally is less resources than Electron.

Electron is not crossplatform 

@coryw @bhtooefr Careful; Windows actually has containers. What you describe is a VM image.

Electron is not crossplatform 

@bhtooefr @coryw It's not that hard for me to imagine a future in which Windows becomes precisely that, though: a development platform that produces binaries that can run on any OS. Once people are trained to tolerate downloads that are tens to hundreds of megabytes, why not just shove a whole OS in there?

Electron is not crossplatform 

@freakazoid @bhtooefr

I mean, that's literally what electron is already doing, just as a binary on your existing OS rather than as a container or a VM image.

josephg.com/blog/electron-is-f - I presume you've seen this before, there's an xbox 360 controller driver in atom and slack for, you know, Reasons(TM).

Electron is not crossplatform 

@coryw @bhtooefr I've been avoiding reading anything about how much Electron sucks, because I don't need to be even more angry than I already am every time I discover some supposed "desktop application" is really a web app bundled with a browser and Node.

Electron is not crossplatform 

@bhtooefr @coryw It's even worse than when people don't bother to tell you that some program only runs on Windows, because at least in that case I can usually tell by the file extension on the download.

Electron is not crossplatform 

@coryw @freakazoid Tying it to Hyper-V misses the point somewhat IMO, because that means tying things to Windows as the bottom of your stack.

What I'm suggesting is, instead of using Electron to deliver "cross-platform" applications, use a barebones Windows Runtime (an actual product Microsoft once sold) and the application in an OVF prepackaged VM.

Electron is not crossplatform 

@coryw @freakazoid (My suspicion is that the initial acceptance of Electron was that it would mean that stuff would run on Linux... but at this point, WINE or a Windows VM running Windows binaries is better than the shitshow that is Electron.)

Electron is not crossplatform 

@bhtooefr @freakazoid

well, and it was @calvin who found a couple Mac-specific, non-cross-platform electron apps, so something being Electron appears not to be a gaurantee that it'll actually be crossplatform.

But ultimately yeah, itdoesn't really matter what the host OS is if you're just going to ship a generic virtualization disk image or template file.

Electron is not crossplatform 

@coryw @calvin @bhtooefr Of course, all the issues with Docker images or anything else with a large dependency tree also apply to VM images: congrats, application developer, you are now an OS distro curator, too! Hope you didn't want any free time, or indeed any time to actually develop your application!

Electron is not crossplatform 

@freakazoid would you say the same for Java? Python? Not being rhetorical or snarky, just genuinely curious because you got me thinking. 🤔

Electron is not crossplatform 

@darth_mall @freakazoid think about how much stuff that Electron carries versus things like Java and Python though. Electron could be considered a micro-desktop environment + OS whereas Java and Python do some level of leveraging the native bits of the environment over to the application developer with WAY less resources.

It's also a over-use of what a Web browser would able to do (but now it's being sold as a desktop env on top of your env)

Electron is not crossplatform 

@jalcine @darth_mall @freakazoid also Electron is bundled with the application, the Java VM is shared on the system

Electron is not crossplatform 

@uint8_t @jalcine @freakazoid touché. Although I’d argue that that’s more of a mixed blessing, having had to both help people get a JVM running on their Macs to run a Java app and also distribute Electron bundles, I’d say the latter is significantly easier to deal with.

Electron is not crossplatform 

@darth_mall @jalcine @freakazoid but it's a one-time overhead (regarding disk space and memory footprint) compared to gigabytes for each Electron application

Electron is not crossplatform 

@uint8_t @jalcine @freakazoid yeah, I’m with you there regarding it being more efficient if you’re running multiple apps in that runtime. That’s why I was saying it’s a mixed bag in my mind.

Although I don’t remember dealing with the JRE being a one time thing; it was always nagging me to update it and sometimes those updates would break my software. 😁

Electron is not crossplatform 

@jalcine @freakazoid point, especially for Python; though when I think back 15 or so years ago to when the JVM wasn’t as optimized and people were writing cross platform GUI apps in Java with Swing, it doesn’t seem that different to me.

Electron is not crossplatform 

@jalcine @freakazoid I’m not entirely sold on it being an over-use of the web, though. I kinda feel like if you’re on board with web apps, I don’t really understand the criticism of building a UI in Electron. Why is it cool to use the web to build a PWA that works offline but Electron is an over-use?

Electron is not crossplatform 

@darth_mall @freakazoid the PWA still remains within the realm of the Web and doesn't attempt to mimic/stand outside of the Web browser YOU chose to install. Versus the one that comes "shipped" with the app. Now with these "apps" with each their own runtime.

Electron is not crossplatform 

@jalcine @freakazoid ok, I think I see what you’re saying. It’s not so much that electron apps shouldn’t be built with web technology, it’s that each one essentially ships its own web browser along with it, whereas all PWAs share the browser you have installed, so you’re not duplicating runtime environments with each app you install?

Electron is not crossplatform 

@darth_mall @freakazoid That's a big part of it - yeah. It's like packaging on steroids. The only upside I can see is that archiving applications can work out a lot easier.

Electron is not crossplatform 

@jalcine @darth_mall I think part of the reason Electron exists, aside from trying to pretend to be desktop apps, is that Electron contains machinery to break out of the browser sandbox. Obviously any native app can do the same, but native apps typically do not bundle an outdated web browser and Node, each of which carries its own copy of V8. This makes Electron even more of an attack vector than Java, Acrobat, or even Flash.

Electron is not crossplatform 

@freakazoid @darth_mall @jalcine double that. You need Electron basically :
1. To run native code or
2. To access file system or
3. To run in the background or
4. To talk to other apps

There's no more to that I guess. Also people *want* special apps. No idea why, less clicks or something.

The thing is that while Web build buggy and inefficient it's one of the most sane frameworks and fast VMs which runs *everywhere*. Try to beat that.

Electron is not crossplatform 

@freakazoid @darth_mall @jalcine check out how legacy Firefox OS powers up shitton of tech these days and be scared:
medium.com/@bfrancis/the-legac

Electron is not crossplatform 

@charlag @jalcine @darth_mall Qt beats Electron hands down. No VM necessary.

Electron is not crossplatform 

@freakazoid @darth_mall @jalcine and then I need to write an iOS app. And web app. Okay, Android app is kinda there. And finding libraries is not exactly easy.
I mean, sure, Qt is great but there are "but"s in every case

Electron is not crossplatform 

@charlag @freakazoid @jalcine Don't you have to write separate iOS and Android apps anyway? I didn't think Electron ran on mobile devices. I thought it was just portable across desktop operating systems. Is that not true?

Electron is not crossplatform 

@darth_mall @freakazoid @jalcine it's true but if your main code is web you can package it as an app. That's what we do at work, mostly due to low resources and high velocity at this stage.

Electron is not crossplatform 

@charlag @darth_mall @freakazoid At that point, it's not for the user but for developer "convenience" and to make deadlines, no?

Electron is not crossplatform 

@darth_mall @charlag @freakazoid It doesn't but people exploit the concept of WebViews and wrap Electron-like applications on there (Cordova, etc).

Also, Dropbox had an solid approach to mobile development with a core shared library done in C++ and binded it to Java and Objective C++

Electron is not crossplatform 

@jalcine @charlag @darth_mall The problem with web views (and web apps generally) is that because of the web rendering model they're nearly impossible to make performant. People talk about V8 being "fast", but that's only compared to other (mostly past) JS implementations and between headless code on various VMs. As soon as you start actually rendering stuff, everything slows to a crawl and takes up huge amounts of RAM.

Electron is not crossplatform 

@darth_mall @charlag @jalcine This is what ultimately caused Facebook to mostly abandon its use of web views.

Electron is not crossplatform 

@freakazoid @darth_mall @jalcine 16-20 Mb for email client is not too bad, idk. There are some really challenging cases for HTML/CSS but they're not so commonplace, most CSS transformations are GPU accelerated after all.
Facebook is Facebook and tries to display shitton of stuff and let it scroll. "Native" wasn't enough for them either, so they created off-thread layout process for iOS.

Electron is not crossplatform 

@charlag @jalcine @darth_mall They're GPU accelerated because that's the only way to make web apps tolerable to use at all, especially on mobile. But there's only so much you can do to accelerate a generic API like that, especially when you consider that JS gets no direct access to any of the underlying primitives, so all you can do is manipulate the DOM and then wait for it to decide to update.

Electron is not crossplatform 

@freakazoid @darth_mall @jalcine what I want to say is that it's basically the same everywhere. If you try to animate something complex without GPU (css or not) you're not going to make even 50 FPS. You have to keep your animations sane always.
I just want to say that there are similar problems. Most native widgets don't draw to canvas directly either. Document models wasn't designed as GUI toolkit, will not argue with that. But native is not magic dust either.

Electron is not crossplatform 

@charlag @jalcine @darth_mall Web applications aren't "animating complex stuff". They're mostly doing stuff that was being done easily in software 30 years ago.

But you're also making my point for me: the web rendering model is extremely difficult to make performant. Suddenly just putting text on the screen is "animating complex stuff."

Electron is not crossplatform 

@freakazoid @darth_mall @jalcine hey, I thought we were talking about GUI applications, and not displaying text. Displaying text with 60 FPS is not hard anywhere. Building rich, interactive, fast apps is hard everywhere and sometimes harder with web.

Show newer

Electron is not crossplatform 

@freakazoid @darth_mall @jalcine @charlag Reading WebKit though, most of the rendering is still on the CPU. The GPU's mostly used when computing CPU-based optimizations is more expensive then rerendering the frame.

This does change though in full rewrites like Servo (I don't what else), which leads to simpler optimizations.

Mostly an interesting tidbit.

Electron is not crossplatform 

@freakazoid @darth_mall @charlag @jalcine Tell me about it!

I've studied these differences, and now I'm implementing them.

Basically it comes down to the fact that The Web was designed for documents, which have significantly different performance profiles than (interactive) apps do. Honestly I don't see a problem with that, we just need to use these tools where they make sense.

Electron is not crossplatform 

@freakazoid @darth_mall @jalcine @charlag No, QT does not beat Electron hands down. For some - perhaps even most - things, probably. But there are a number of cases where Electron is one's best bet, no matter how sad this situation might be.

Case in point, I'm writing a keyboard configurator. I need to display custom/weird keyboards. With Electron, I use an interactive SVG. No native toolkit can do that without incredibly ugly and unreliable hacks.

Electron is not crossplatform 

@algernon @charlag @jalcine @darth_mall I don't see how Electron's better support of your choice to use a web technology for this desktop application makes it a better choice in "perhaps even most" cases? That's like saying "BASIC is better than C++ because I use DATA and READ in my code and C++ doesn't have those."

Electron is not crossplatform 

@darth_mall @jalcine @charlag @algernon I am, of course, assuming you looked into other options for doing interactive SVG and found Qt lacking. But maybe that's not a valid assumption. Did you already check out QtSvg?

Electron is not crossplatform 

@freakazoid @algernon @charlag @jalcine @darth_mall I've discussed with Algernon before and am convinced s/he looked at the available options and made the right choice for this case.

Electron is not crossplatform 

@freakazoid @darth_mall @jalcine @charlag I meant that QT > Electron for most cases, but there are some where Electron will beat anything hands down. Sorry for the confusing wording.

And yes, I looked at QtSvg. It can display the SVG, but making it interactive - nope, can't do. I looked at pretty much every native toolkit, cross-platform or not, because I hate JS with a passion. Still ended up with Electron.

Electron is not crossplatform 

@algernon @charlag @jalcine @darth_mall Ah, ok. Sorry, I misunderstood what you were saying. It does make sense that animating SVG is easier to do with a browser. I had initially had high hopes for SVG to be usable for other purposes, but it seems to have only gotten picked up for the web, and there just barely based on my experience building Claspin, so every time I want to view a complex SVG, I end up turning to a browser.

Electron is not crossplatform 

@darth_mall @jalcine @charlag @algernon Now I'm tempted to, in my copious spare time, build a "D3 native" that bundles SVG animation and a D3-compatible API into a library, maybe with a Duktape binding to ease porting D3 applications.

Speaking of D3, I apparently didn't mention it in that blog post. I feel bad about that. I might have tried and been asked not to get too deep into implementation details?

Electron is not crossplatform 

@algernon @freakazoid @darth_mall @charlag Couldn't this be done on a graphics view/layer?

Electron is not crossplatform 

@jalcine @freakazoid @darth_mall @charlag It could be, but my keycaps are custom shaped, so I'd have to figure out and implement a way to allow the overlay to allow clicking the same shapes. Tried doing that, ran away screaming and a decade older.

FWIW, this is how it looks. It's *trivial* to support this with web tech & Electron. A huge pain at best with native toolkits.

Electron is not crossplatform 

@darth_mall @freakazoid not op, but personally, i would for java, and python.... it depends, but in many cases yes

Electron is not crossplatform 

@darth_mall @freakazoid either of those is better than electron, though.

Electron is not crossplatform 

@darth_mall I would say the same for Java, though it's never really tried to pretend otherwise. Python doesn't try very hard to insulate you from the underlying platform. You can use it to build a wide range of platforms using PyQt or whatever.

Electron is not crossplatform 

@freakazoid @uint8_t @jalcine Just want to say thanks all for the thoughtful responses. 🙏 ❤️

Electron is not crossplatform 

@freakazoid Oh dear... :blobcatsurprised: By that definition, Godot Engine games are also not crossplatform...

Hmm.. 😟

Electron is not crossplatform 

@catgirl Indeed, Godot is itself a platform. But it's at least being used for what it was designed for, and AIUI its runtime is much smaller than Electron's.

Electron is not crossplatform 

@freakazoid i have this same problem with containers, and any package format that includes all dependencies of the application

Electron is not crossplatform 

@freakazoid What do you think about Java? 🤔

Electron is not crossplatform 

@freakazoid I agree with you but I have to say #joplin is a very good electron app.

Sign in to participate in the conversation
R E T R O  S O C I A L

A social network for the 19A0s.