Live data from Hacker News

NeutralinoJS: Lightweight Electron alternative using native browser controls

neutralino.js.org

41–50 of 200 posts

Re: NeutralinoJS: Lightweight Electron alternative using native browser controls

#41
post #31

Stupid question: instead of embedding an entire browser in each-and-every app and trying to keep that secure, why not package the native desktop framework as a shared, versioned component and the app as a tiny thing that depends on it?

That's sane. Sanity is prohibited in the realm of UI programming. There's apparently a law somewhere that states that all GUI libraries and APIs must be one of: platform-specific, bloated/slow, or incomplete/ugly.

Lazarus and LispWorks CAPI are exceptions to this rule, but they both use languages people don’t want to learn and CAPI is proprietary

Re: NeutralinoJS: Lightweight Electron alternative using native browser controls

#42

using the word "lightweight" to describe anything involving js and an html renderer should be prohibited

Indeed. Webshits alone are responsible for 1 or 2% of global energy usage.

I feel like this calibre of comment is a perfect example of the "reddification" of HackerNews recently

Re: NeutralinoJS: Lightweight Electron alternative using native browser controls

#43
post #32

Stupid question: instead of embedding an entire browser in each-and-every app and trying to keep that secure, why not package the native desktop framework as a shared, versioned component and the app as a tiny thing that depends on it?

I'm generally pretty old school when it comes to development practices but I can totally understand how appealing it is to effectively ship your entire environment as part of your application instead of relying on shared dependencies. Dealing with dependency incompatibility is a huge maintenance burden in my experience, and it's super tricky to debug if you don't have access to the problematic environment (which is m…

I think the grandparent comment is envisioning something more like Docker than like e.g. the JRE.

This is actually already how the Microsoft Visual Studio C Runtime (aka MSVCRT) is distributed: each application embeds or streaming-downloads the exact [ABI] version of the runtime it needs, but only one of each exact [ABI] version of the runtime needs to exist per system, and each of those runtimes can be upgraded by the OS to resolve security problems (while never altering the ABI guarantees that version distribution makes.)

As such, a runtime built this way is a lot like a base layer in a Docker image: it’s a static dependency of the app, installed during the app’s installation, and held in a pseudo content-addressable store that deduplicates it from other apps’ demands for the same dependency.

Re: NeutralinoJS: Lightweight Electron alternative using native browser controls

#44

Looks kind of like WebView [1] which I earnestly tried but eventually abandoned. Using the system-provided web engine is great for space savings, but terrible for cross-compatibility and feature availability owing to having to use IE on Windows. [1] https://github.com/zserge/webview

Isn't the "system provided web engine" now Edge on Windows 10, and has been fore a while?

AFAIK, there's a difference between MSHTML (internet explorer) and EdgeHTML (edge / trident). But even then, Edge can be somewhat lacking depending on your use case [1]. For simple apps that just need a simple UI without spending time developing cross-platform, this solution is great! Unfortunately the projects I've had to develop require newer features and/or performance lent by using the Chromium Embedded Framework that simply aren't possible, even if Edge was available.

[1] https://caniuse.com/#compare=ie+11,edge+12,chrome+80

Re: NeutralinoJS: Lightweight Electron alternative using native browser controls

#45

using the word "lightweight" to describe anything involving js and an html renderer should be prohibited

Indeed. Webshits alone are responsible for 1 or 2% of global energy usage.

_sigh_

Source?

Even disregarding the poor term you've used, I'm pretty skeptical of what you just stated. Especially with a margin error of 1%.

Re: NeutralinoJS: Lightweight Electron alternative using native browser controls

#46

Earlier quoted context omitted.

Indeed. Webshits alone are responsible for 1 or 2% of global energy usage.

I feel like this calibre of comment is a perfect example of the "reddification" of HackerNews recently

> Please don't submit comments saying that HN is turning into Reddit.

https://news.ycombinator.com/newsguidelines.html

Re: NeutralinoJS: Lightweight Electron alternative using native browser controls

#48
I feel like nobody cares too much if they’re running one Electron app; people do have the headroom for an extra 1-2GB of RAM usage. The problem comes when they run several Electron apps at once, and each comes with its own “base” overhead (i.e. the runtime memory consumption of the browser-runtime as a whole, independent of how many render contexts are open.)

Chromium is built to share a lot of things between tabs efficiently, but this economy-of-scale doesn’t translate over into having multiple instances of Chromium running. Each instance gets its own GPU renderer process + font-glyph tile cache, its own network-request cache (i.e. its own in-memory key-value store with its own LRU limit), etc. Running multiple Chromium instances at once is a bit like running multiple copies of an RDBMS on the same machine and expecting them to not fight over memory.

Does anyone know what exactly this “base” overhead in Chromium consists of; and, more importantly, how often it changes relative to Chromium releases? Because I’m wondering whether it’d be possible to factor most of it out into a separate layer from the highly-iterated-on “browser engine” DLL stuff (the renderer + DOM + JS layer) into its own sort of “Chromium Core Services” DLL, which could be relatively-more ABI-stable.

If you had that factoring-out, you could achieve a pretty good memory + CPU savings just by having Chromium + application frameworks like Electron all share one copy of the Chromium Core Services between them, while keeping their own higher-level “renderer+VM” DLL on top (which would hopefully be pretty stateless in terms of shared state, only adding the ~50MB mmap(2) overhead of the DLL-image itself, and then whatever memory the individual render-contexts consume.)

Alternately, of course, you could build Electron as a pseudo-browser where Electron “apps” are just separate windows running in its memory space, and the native Node processes are all just distinct V8 Execution Contexts in the same process. But 1. this would lose you the ability to develop for a particular version of the renderer, which is what Electron gains you over projects like Neutralino in the first place; and 2. this wouldn’t give you the benefit of Electron sharing service-memory with Chrome itself.

Post reply on HN