News for hackers. Stuff that matters.
Re:Tauri: An Electron alternative written in Rust by swagonomixxx on Friday February 19, 2021 @01:01PM (#26195886)
This kind of makes me think... is there room for a much more stripped down version of Chromium that is suitable for lower memory footprint? Or is this impossible?

It looks like Tauri uses system webviews, which use a lot less memory, but the burden is then on the developer to make sure that they build essentially 3 (maybe more) UI's on platforms that might change under their feet. That's why the Electron approach is simpler - it trades of performance for uniformity of experience across the major platforms.

But I'm wondering if it really has to be this way. Do modern browsers really need 2G of RAM in order to send and receive messages in a chat box (looking at you, Slack).

Re:Tauri: An Electron alternative written in Rust by c-smile on Friday February 19, 2021 @06:16PM (#26199349)
"is this impossible?"

Possible, see Sciter.JS : https://github.com/c-smile/sciter-js-sdk

10 times more compact than Tauri, 20 times less than Electron.JS

Yet it has Rust API ( https://github.com/sciter-sdk/rust-sciter ), that if someone need "Made with Rust" label :)

And it works even on Windows 2000, do you remember that thing? See: https://sciter.com/necromancing-sciter-on-windows-2000/

Re:Tauri: An Electron alternative written in Rust by croes on Saturday February 20, 2021 @12:54AM (#26201977)
Too bad it's kickstarter campaign to make it open source failed.
Re:Tauri: An Electron alternative written in Rust by gigel82 on Friday February 19, 2021 @06:44PM (#26199591)
I like Sciter for the possibilities, but it needs better compatibility with web standards. Being able to port an existing application that uses React -for example- and have it just run would be the cat's meow.

Needing to rewrite with other UI/JS frameworks to account for quirks gives me pause.

Re:Tauri: An Electron alternative written in Rust by c-smile on Friday February 19, 2021 @07:00PM (#26199712)
It depends on what application you have in mind.

React needs web browser compatibility layer to work in Sciter.JS as React was designed strictly for browsers.

For that matter: PReact ( https://preactjs.com/ ) works out of the box already, see : https://github.com/c-smile/sciter-js-sdk/tree/main/samples/p... ;

MithrilJS ( https://mithril.js.org/ ) works as it is also.

SvelteJS works as it is with Sciter.JS too.

Also Sciter.JS has its own native implementation of JSX ( it's built in JS core of Sciter.JS) and also DOM extended by native element.patch(vdom) that makes "reactivity" to work in Sciter.JS with native speed.

Yet quite a lot of UI components are natively built-in. For example:

https://sciter.com/behaviorvirtual-list-for-sciter-and-scite... and https://sciter.com/sciter-js-themes/

Re:Tauri: An Electron alternative written in Rust by gigel82 on Friday February 19, 2021 @07:15PM (#26199851)
I think the project is great and I admire your work, but I'm confused about how you position it.

Being "almost" web compatible is not a recipe for success, as it's bound to cause confusion and frustration among folks that want it to be an Electron alternative.

Either embrace Web APIs entirely (perhaps a smaller compatible subset), or just position it as something else entirely, like Flutter.

Re:Tauri: An Electron alternative written in Rust by c-smile on Friday February 19, 2021 @07:27PM (#26199982)
"how you position it"

Hmm... and how do I do that? What's your impression?

Sciter.JS is "an embeddable HTML/CSS/JS UI engine" and that's it.

Yes, it is possible to use it without touching native side like ElectronJS, see: https://quark.sciter.com/ , but that's not the primary use case. So far it has around 400 mln installations in embedded form as part of other products, see: https://sciter.com/#customers

If you want you can treat it as Flutter that uses time proven and familiar HTML/CSS/JS resource definitions instead of Dart. Dart is close to JS but not JS, Flutter has some DOM but not HTML DOM, it has some style system but quite rudimental one.

Re:Tauri: An Electron alternative written in Rust by gigel82 on Friday February 19, 2021 @08:58PM (#26200730)
I think your description is technically correct, it is an UI engine that uses the HTML, CSS and JS languages.

But to most folks, that sounds like a "web browser/view engine", which it is not. Does it pass the Acid2 / Acid3 test?

The power of ElectronJS is not its use of HTML, CSS and JS, but the fact that it is a web browser engine and one can share the millions of frameworks, libraries and muscle memory built for the web in their desktop applications.

Re:Tauri: An Electron alternative written in Rust by c-smile on Friday February 19, 2021 @09:52PM (#26201058)
Modern browsers do fail on ACID tests anyway. display:flex broke old box model.

> one can share the millions of frameworks ...

For your *desktop* application you need just one, not millions of them.

> libraries and muscle memory

Not a problem, here I am using Remarkable [1] as it is: https://github.com/c-smile/sciter-js-sdk/tree/main/samples/m..., in other places I may use LeafletJS for showing maps, etc. Essentially all libraries for JS/NodeJS should work out of box.

Problem is that desktop UI has different UI model from a web page. Web page / Web app is usually "endless paper tape" opened full screen - has defined width but no height - no need for vertical alignment for example.

And desktop UI is usually different - small or vertically and horizontally space limited windows, etc.

In Sciter you can show element as popup one - in separate window that can be rendered outside of your [small] app window, consider this popup: https://sciter.com/wp-content/uploads/2021/02/select-table.p... , good luck with recreating this in browser. By the way that <select> element is defined as:

   <select>
        <tr role=option value="1">
            <td>Option 1</td>
            <td>*Short*</td>
            <td>123456</td>
        </tr>
        <tr role=option value="2">
            <td>Option 2</td>
            <td>******* LOONG ********</td>
            <td>123456</td>
        </tr>
        <tr role=option value="3">
            <td>Option 3</td>
            <td>*Short*</td>
            <td>123456</td>
        </tr>
   </select>
Sciter supports arbitrary markup in selects, popups, etc. No one of "millions of frameworks" will help you with that.

Also this

   <frameset cols="200px,*">
     <section>A</section>
     <section>B</section>
   </frameset>
will give you split-view out-of-the-box. But web dev's will start looking for frameworks in order to achieve this simple component that browser have internally.

TL;DR: Web and desktop UIs use inherently different models. You can share parts between these two different platforms but only parts, really.

[1] Remarkable JS: https://github.com/jonschlinkert/remarkable

Re:Tauri: An Electron alternative written in Rust by _jordan on Friday February 19, 2021 @09:13PM (#26200823)
sciter is a really wonderful piece of software. it's performance has been really impressive when I was benching it against qt
Re:Tauri: An Electron alternative written in Rust by LockAndLol on Friday February 19, 2021 @06:43PM (#26199583)
From what I understand the internals (aka the engine). That is a problem IMO. I understand it's to create a dependency on the maintainer in order to make money, but yeah... it's the reason I've stayed away thus far.
Re:Tauri: An Electron alternative written in Rust by tambourine_man on Friday February 19, 2021 @09:04PM (#26200772)
That’s awesome, I’m gonna play with it over the weekend. Thanks!
Re:Tauri: An Electron alternative written in Rust by jokoon on Saturday February 20, 2021 @02:11AM (#26202266)
Can it play videos?
Re:Tauri: An Electron alternative written in Rust by c-smile on Saturday February 20, 2021 @11:45AM (#26205510)
Yes. Check https://github.com/c-smile/sciter-sdk/tree/master/samples/vi...

But Sciter do not have codecs embedded. Instead

a. it [re-]uses streaming services of underlying OS;

b. has interface for the hosting application to supply its own video streams.

This way some applications use WebRTC as video sources, some use ffmpeg library to provide video streams. Video playback architecture is app dependent usually. Sciter provides to them "video rendering site".

That's idea of Sciter - to reuse underlying OS services as much as possible.

For example Sciter has spellchecking but only if OS provides spellchecking API (and usually they do).

Re:Tauri: An Electron alternative written in Rust by vulcan01 on Friday February 19, 2021 @01:19PM (#26196107)
> the burden is then on the developer to make sure that they build essentially 3 (maybe more) UI's on platforms that might change under their feet

Is this really different from the current state of web development? Front-end developers have to test against Chrome, Firefox, and Safari, at a minimum. For apps that are basically installable websites (like Slack, which has a perfectly functional webapp) this doesn't seem like that far of a stretch.

Re:Tauri: An Electron alternative written in Rust by MattGaiser on Friday February 19, 2021 @01:54PM (#26196538)
> Front-end developers have to test against Chrome, Firefox, and Safari, at a minimum.

Do many companies actually do this though? I've only ever been with companies that test against Chrome. The one time at FF bug was found, that company told that client to switch to Chrome.

I know there was a kerfuffle about Airbnb and Groupon only doing Chrome as well.

https://www.reddit.com/r/AirBnB/comments/dv7v6n/customer_sup...

https://thenextweb.com/dd/2017/11/28/please-build-websites-w...

Maybe in theory all platforms are considered, but in practice many companies just do one and the others mostly just work.

Re:Tauri: An Electron alternative written in Rust by joshuacc on Friday February 19, 2021 @02:37PM (#26197088)
Yes, absolutely. Every company that I've ever worked at had a list of officially supported browsers that included Chrome, FireFox, Safari and Edge/IE. QA engineers would make sure to rotate through various browsers while testing, and for crucial features would run through every scenario in every supported browser's oldest and newest supported versions.
Re:Tauri: An Electron alternative written in Rust by hinkley on Friday February 19, 2021 @03:17PM (#26197531)
Pretty much the only reason to use Saucelabs is browser compatibility testing.

We don't run everything through it, but we run karma to make sure the code runs and the right events fire. It is still possible to write code that runs everywhere but IE.

Re:Tauri: An Electron alternative written in Rust by calibas on Friday February 19, 2021 @04:42PM (#26198398)
Most companies today use frameworks that have good cross-compatibility so it tends to just work. In my opinion though, a responsible web developer is going to test on multiple browsers at the very least.
Re:Tauri: An Electron alternative written in Rust by tambourine_man on Friday February 19, 2021 @09:08PM (#26200797)
Safari is huge. Doing Chrome only is suicide. Thankfully, cross browser compatibility is much easier these days, specially if you don’t use flex or grid.
Re:Tauri: An Electron alternative written in Rust by swagonomixxx on Friday February 19, 2021 @04:18PM (#26198151)
In a previous company we had to do FF and Chrome. Not IE though, which was a big time saver. QA ran all their test cases on the latest stable of both FF and Chrome, and features would not be deployed to prod if they didn't work on both browsers.
Re:Tauri: An Electron alternative written in Rust by dmix on Friday February 19, 2021 @01:27PM (#26196217)
And in recent years this has gotten much easier. Cross browser support used to be a pain in the ass.

Now most of the time changes aren’t even needed. Besides maybe the odd Firefox or Safari thing.

Re:Tauri: An Electron alternative written in Rust by Kaze404 on Friday February 19, 2021 @01:30PM (#26196252)
Funnily enough in my experience it's usually Chrome and Safari that do weird things, which as a Firefox user always gets me dinged on PR reviews :p
Re:Tauri: An Electron alternative written in Rust by livre on Friday February 19, 2021 @01:41PM (#26196384)
Not much different but enough to be dangerous. Older Windows use Trident, 10 still uses EdgeHTML, many people are stuck with old Androids that don't have up to date engines (not sure if Android is a target, wasn't easy to find in their website), and webviews have access to the system in ways a website doesn't (like reading files or using the camera without having to ask for permission or being allowed to issue requests to arbitrary domains).
Re:Tauri: An Electron alternative written in Rust by moron4hire on Friday February 19, 2021 @01:49PM (#26196465)
But we know from web statistics that these are very few people and shrinking every year.
Re:Tauri: An Electron alternative written in Rust by Klonoar on Friday February 19, 2021 @02:04PM (#26196667)
That is not how it works on Windows, as you have to ship either the Webview2 runtime or installer with your app - otherwise you’re stuck with the old rendering engines.

At which point, it’s just easier to ship Electron.

Re:Tauri: An Electron alternative written in Rust by moron4hire on Friday February 19, 2021 @02:50PM (#26197250)
Shipping Electron and bundling the WebView2 runtime are practically the same level of difficulty.

Making an installer is not that hard, and you should have enough respect for your users' compute resources to go through the modicum of effort it takes.

Re:Tauri: An Electron alternative written in Rust by Klonoar on Friday February 19, 2021 @03:20PM (#26197565)
>Making an installer is not that hard, and you should have enough respect for your users' compute resources to go through the modicum of effort it takes.

No. As shown by the slew of other comments in this thread, it's not just about getting the runtime to load. You still have other issues involved.

You should have enough respect for your own time and money to ship the product and not open yourself up to a litany of cross-platform issues. Your job is not to fix OS vendors failing to get a common UI framework in place.

Signed, someone who has literally dealt with cross-platform-webviews in a shipping product in the past six months, and who builds native Mac apps.

Re:Tauri: An Electron alternative written in Rust by nklayman on Friday February 19, 2021 @05:14PM (#26198719)
Tauri's Bundler will automatically take care of shipping the Webview2 runtime, so there won't be any extra work required of you.
Re:Tauri: An Electron alternative written in Rust by munificent on Friday February 19, 2021 @01:08PM (#26195987)
> is there room for a much more stripped down version of Chromium that is suitable for lower memory footprint?

That's basically the history of Flutter. The initial goal was something like "Web: The Good Parts" and the results of that experiment led them to where they are now.

Re:Tauri: An Electron alternative written in Rust by ducktective on Friday February 19, 2021 @01:58PM (#26196590)
I mean, where are they now? Promising or DoA? I fear touching it because of it being a Google project (killedbygoogle.com)
Re:Tauri: An Electron alternative written in Rust by jonathanaird on Friday February 19, 2021 @02:49PM (#26197244)
They’re putting a lot of resources behind and it actually is thriving. They have a real financial interest as there’s pretty thorough firebase support. It’s also reviving their Dart language.

As someone that’s using it, it is improving very quickly. Web support is getting quite good.

Re:Tauri: An Electron alternative written in Rust by chgibb on Friday February 19, 2021 @02:45PM (#26197187)
We're pretty bought into Flutter. No cross platform toolkit is perfect but Flutter is miles ahead of everything else. For a not very scientific analysis: https://trends.google.com/trends/explore?date=today%205-y&q=...
Re:Tauri: An Electron alternative written in Rust by nwienert on Friday February 19, 2021 @04:20PM (#26198182)
It’s definitely not miles ahead of just about anything.

It has significant tradeoffs and fits some projects better than others.

React Native has quite a few benefits over Flutter. Especially if building for the web, I’d actually say Flutter is only usable now if you don’t build your web app with it. Which in my cost benefit analysis makes it miles behind RN, but of course, that’s why it depends.

Re:Tauri: An Electron alternative written in Rust by kybernetikos on Friday February 19, 2021 @05:10PM (#26198678)
Have you seen how Sciter.JS has been developing https://github.com/c-smile/sciter-js-sdk

There are a few working examples, and they have dramatically lower memory footprint and are quicker to start than full fat browsers.

Re:Tauri: An Electron alternative written in Rust by GirkovArpa on Friday February 19, 2021 @08:15PM (#26200385)
I've performed a couple experiments remaking Electron apps using Sciter.

My first target was https://github.com/AkashRajpurohit/clipper, a neat little clipboard manager. The owner was gratious enough to officially list my project under the "Clones" section of his readme =D The result was a 6mb file, compared to the original 165mb Electron app.

The second attempt was https://github.com/girkovarpa/temps-lite, an aesthetically-pleasing weather app which was motivated largely by the fact that the original was broken and abandoned yet still had people who wanted to use it. According to the open issues and forks trying to resurrect it, anyway. The file size savings were similar to the former, and they start virtually instantly. Unlike the Electron apps which have a bit of delay and then a blank window before they finish starting up.

Re:Tauri: An Electron alternative written in Rust by glen-ellen on Friday February 19, 2021 @03:57PM (#26197937)
This is similar to what Plotly did with their Kaleido project[1] that generates static images of plotly.js visualizations. Instead of using Electron or Selenium, they recompiled Chromium, stripping away a bunch of the parts they didn't need. This resulted in a cross-platform build that is much lighter weight.

> The goal of the Kaleido project is to make static image export of web-based visualization libraries as universally available and reliable as it is in matplotlib and ggplot2.

> To accomplish this goal, Kaleido introduces a new approach. The core of Kaleido is a standalone C++ application that embeds the open-source Chromium browser as a library. This architecture allows Kaleido to communicate with the Chromium browser engine using the C++ API rather than requiring a local network connection. A thin Python wrapper runs the Kaleido C++ application as a subprocess and communicates with it by writing image export requests to standard-in and retrieving results by reading from standard-out.

> By compiling Chromium as a library, we have a degree of control over what is included in the Chromium build. In particular, on Linux we can build Chromium in headless mode which eliminates a large number of runtime dependencies, including the audio, video, GUI toolkit, screensaver, and X11 dependencies mentioned above. The remaining dependencies can then be bundled with the library, making it possible to run Kaleido in minimal Linux environments with no additional dependencies required. In this way, Kaleido can be distributed as a self-contained library that plays a similar role to a matplotlib backend.

1. https://medium.com/plotly/introducing-kaleido-b03c4b7b1d81

Re:Tauri: An Electron alternative written in Rust by oscargrouch on Friday February 19, 2021 @02:28PM (#26196978)
Not just that, it allows to ship with much more api's available to the user.

That's why is not always the best approach to appeal to whats people are saying.

Here on HN this was the #1 thing that people used to ask or complain for when the topic was electron.

"They should just integrate with the system browser" was the common saying. But the the burden would be on the developer,who would not only be back to the hellish scenario of multiple browsers implementations but also having to deal with a very skinny SDK to work with.

In the end of the day, the applications deployed on Electron will win, because they will allow developers to do much more and without the application breaking here and there because of the gimmicks of each platform.

When hearing what people say, you must have in mind the kind of the crowd you are listening to. Here on HN for instance is mostly Apple users, mostly developer types, and that's the reason why they ask for the platform browser, after asking for the platform UI, because that's how apple platform users will tend to think.. and the memory thing is the fact that most here are developers.

But that's far from being representative of the whole world of users. So, you might appeal to the particular crowd here on HN, but once you are out there "in the world" you will have a hard time facing contenders that are more resourceful than you, and the worse of all, is that it is by design. You cornered yourself into it because you forgot you are in a bubble..

Re:Tauri: An Electron alternative written in Rust by slater on Friday February 19, 2021 @02:10PM (#26196740)
Electrino, but looks abandoned:

https://github.com/pojala/electrino

Re:Tauri: An Electron alternative written in Rust by swagonomixxx on Friday February 19, 2021 @04:22PM (#26198200)
Wow, at least from the screenshot in the README, the binary size is much smaller. However I think that's just from the fact that they don't bundle the JavaScript engine and the rendering engine into their binary. You're right though, seems abandoned.
Re:Tauri: An Electron alternative written in Rust by crazypython on Friday February 19, 2021 @01:22PM (#26196150)
> 3 (maybe more) UI's on platforms

Not really. Targeting the web platform and not aiming for perfect compatibility or looking the same isn't that hard.

Re:Tauri: An Electron alternative written in Rust by unnouinceput on Friday February 19, 2021 @01:11PM (#26196017)
I wish Mozilla would do the same move as well. I remember in 2000's I had a Mozilla ActiveX that I could bundle in my applications and instant web browser without IE crap (back then was Mozilla vs IE only, Chrome was still in its infancy).

Nowadays Mozilla it seems they don't even export the old ActiveX, let alone to have their own webview equivalent.

Re:Tauri: An Electron alternative written in Rust by hobofan on Friday February 19, 2021 @01:21PM (#26196144)
It seems like Electron is decently optimizable for a lowish memory footprint. Both the Element and Discord desktop client run with consistently ~50MB RAM each.
Re:Tauri: An Electron alternative written in Rust by scaladev on Friday February 19, 2021 @01:57PM (#26196579)
>~50MB RAM each

You _are_ measuring the total RAM usage, right? Something like `free -m` right before starting the application, and then after it warms up?

Every time I see these "electron is not heavy, it only uses X MBs of RAM", it turns out that the author looked at a single electron process (out of typically 5-10), and then only measured RSS, completely ignoring shared memory.

Re:Tauri: An Electron alternative written in Rust by kaslai on Friday February 19, 2021 @02:20PM (#26196868)
Doesn't RSS include shared mappings? That's why metrics like PSS and USS were introduced.

But that aside, yeah Discord is pretty heavy. My current instance which is only connected to a single server is eating 555 MB PSS, or 846MB RSS. Definitely not a lightweight at all.

Re:Tauri: An Electron alternative written in Rust by scambier on Friday February 19, 2021 @01:54PM (#26196537)
Are you sure about that? Most of the time, Electron apps are split into multiple processes, and the task manager (by default) only shows the main one. Order your processes by name and I'd be surprised to see the total under 150MB.