Live data from Hacker News

Tauri: Rust-based Electron alternative releases beta

tauri.studio

101–110 of 177 posts

Re: Tauri: Rust-based Electron alternative releases beta

#101
post #60

Earlier quoted context omitted.

Electron has two "sides" to it — a renderer process, and a NodeJS process, that communicate over IPC (where as far as the renderer is concerned, the NodeJS process is kind of like a very intrusive browser extension.) AFAIK, if you're writing a greenfield Electron app, it's best to do as little as possible in the renderer side, and as much as possible in the Node.js side, because the Node.js side has things like nativ…

This is actually untrue, you want to do as much as possible in the renderer process. The main NodeJS process is responsible for all user interaction, including mouse clicks and keyboard input. If you block the main process, the entire app will become unresponsive

But the main NodeJS process can spawn (regular POSIX) worker threads, just like any other GUI app’s main (event loop) process; and those worker threads can both 1. load native libraries and call into them, and 2. communicate just as directly with the renderer as the main thread can. The renderer, meanwhile, only gives you ServiceWorkers; and those can’t do anything natively. (Plus, they have all the same IPC overhead to the main renderer context that calling the renderer from Node does.)

Think of it like this: let’s say you’re creating an Electron equivalent to Mathematica. You have a big native blob of maths evaluation code. Where are you going to run it — in the renderer (as Emscripten WASM) or in a worker thread of the native app (as a native static library or DLL)?

Or let’s say you’re doing an Electron BitTorrent client. Where are you going to handle the network connections and do the file management and... basically everything the app does? Well, in this case, you have no real option: the renderer can’t open raw TCP sockets. You’ve got to do it native. (But it would have been the better choice anyway, for IOPS reasons—localStorage + virtualized attachment downloads don’t buy you very much disk concurrency.)

A less clear-cut case is a game engine. The answer there depends on whether you can get a handle to the renderer’s Canvas from your native code. If so, then the choice is obvious: native game engine, draw to renderer’s canvas. If not, it might still be more CPU efficient to go native: you might be able to approximate that over RPC if your game has a bandwidth-efficient wire protocol representation of its render command stream (as e.g. most 2D tile based games do.) Only if neither of these work would putting the game engine into the renderer be optimal.

Re: Tauri: Rust-based Electron alternative releases beta

#103

Earlier quoted context omitted.

? Are you asking for them to make an entirely different product?

It's off-topic, but it would be nice for someone to make a really good GUI toolkit for Rust. Something that integrates with system APIs for copy-paste and stuff like that.

There's a few decent ones but like a lot of Rust stuff, they're young.

I hear you though. It's, IMO, a core tool missing from my Rust toolbelt.

Re: Tauri: Rust-based Electron alternative releases beta

#104
post #94
post #54

Earlier quoted context omitted.

Like I wrote in another response, we are due for a landing page revamp, and we'll be sure to make a "nothing but the facts" hero for people like yourself who are concerned that their time is being wasted.

TBH it was pretty frustrating and also for me it was a waste of time. Even though the project itself sounds very promising, because "Rust" and "Electron alternative". But how can I know if it really is an Electron replacement if I'm not even sure if I can create native context menus or integrate it into the SysTray?

If you scroll down to the roadmap, you can see that system trays are supported. We don't yet support native context menus, but that would be a relatively simple addition. Our GitHub readme has a table comparing Electron's and Tauri's features, do you think it would be useful to include that on the website landing page?

Re: Tauri: Rust-based Electron alternative releases beta

#105
post #94

Earlier quoted context omitted.

TBH it was pretty frustrating and also for me it was a waste of time. Even though the project itself sounds very promising, because "Rust" and "Electron alternative". But how can I know if it really is an Electron replacement if I'm not even sure if I can create native context menus or integrate it into the SysTray?

If you scroll down to the roadmap, you can see that system trays are supported. We don't yet support native context menus, but that would be a relatively simple addition. Our GitHub readme has a table comparing Electron's and Tauri's features, do you think it would be useful to include that on the website landing page?

So it would make sense to split the roadmap into what already exists, and call that the feature list, and the rest can remain as the roadmap.

Then provide screenshots/code samples for each item in the feature list.

That sounds like a solution. Or just add some screenshots/code samples to what is already implemented in the roadmap.

Re: Tauri: Rust-based Electron alternative releases beta

#106
post #88

Earlier quoted context omitted.

Apple's brand new iMacs with the M1 CPU only have 8 GB of RAM. If every little desktop widget loads its own browser engine, most of that RAM will be spent on redundant copies of Chromium. If your Electron app is something that you expect users to run almost exclusively, then no problem. If it's just another little client app for some service, please consider a solution that would reduce its memory footprint.

That's a fair point, but just ship a website then, much easier and pretty much same result. It makes sense to use frameworks like Electron if they enable new capabilities for your app, and Electron is very good at that, bundling Node.js with it, which allows you to share code between frontend and backend and tap into the same ecosystem of packages, plus chances are you already know Node.js, Tauri is enabling 0 of thi…

> much easier and pretty much same result.

Actually better results even, because under macOS for example the webview is provided by Safari, but if you are using Chrome/Firefox as your browser of choice and you are using a Tauri app now you are using 2 browsers effectively, while if you ship a website you can use that website with whatever browser you prefer.

Re: Tauri: Rust-based Electron alternative releases beta

#107

Earlier quoted context omitted.

Order of magnitude memory reduction, not disk space, was the selling point last time I heard. And given how often I hear users complaining about memory consumption in Electron apps, I think that is something pretty attractive, if it pans out.

> Order of magnitude memory reduction That doesn't make sense to me, you are still using a browser at the end of the day. Sure you can save some memory by not bundling Node (at the cost of making even reading a file much more difficult), but that's not orders of magnitudes.

Now it's a browser that was probably already in memory for one reason or another, not necessarily a process per Tauri app.

Re: Tauri: Rust-based Electron alternative releases beta

#108
post #96

Earlier quoted context omitted.

I think Typescript won't check that two of your dependencies are compatible with each other; it will only check that your app is compatible with dependencies. Even then, the check isn't very strong, since TypeScript operates on a "as you want it" basis, which is nice in some ways but also means you could get overly permissive behavior, especially if you're using third party typings, which is fairly common. > the focu…

I'm not saying that go and C++ have better type systems. I'm saying like rust, their type systems are built to aid the compiler. High-level languages like ocaml or f# have type systems made for domain modeling

I'm not sure I understand your point. Rust has ADTs, like OCaml and F#, and Go doesn't. Rust can be written almost like OCaml and F#, Go can't.

Re: Tauri: Rust-based Electron alternative releases beta

#109

Earlier quoted context omitted.

Being an Electron alternative and using Node.js as an optional bundler are not mutually exclusive.

Well, I'm lost. You won

Like Electron, with Tauri you write your GUIs with HTML, CSS, and Javascript. Electron uses Node for the client-side non-GUI functionality, while Tauri instead uses Rust binaries to accomplish same. That's the alternative part. Node is not needed at all in the final build, although it may be used to create your app before bundling for release.

Re: Tauri: Rust-based Electron alternative releases beta

#110

Earlier quoted context omitted.

You're going to do great. Just steer the ship back in the direction of the elevator pitch experience. After that 20-30 second experience, if people are interested in more (provide Getting Started at the end of all of that, not the beginning,) they will click on it and want to learn more about what you have to offer. Avoid putting things in people's face before they've gotten to know you. You're not trying to be a foo…

Having the getting started button at the end is a good idea I think, we'll look into that. We say "web frontend" because that's as descriptive as we can be really. We support any web framework that runs in a browser. As for screenshots of big companies' apps, we don't have any major companies that have adopted Tauri yet, as we just came out of alpha, but we will add a section like that as soon as we can. It's difficu…

I understand the difficulties of competing with incumbents because size and usage are not your strong points yet, sort of. You all have over 16k stars on GitHub as a proxy for interest! My team still has under 1k.

It also doesn't help that we chose a language that isn't popular. But you all need to think about how decision making like that massively effects adoption.

You won't learn these lessons quickly, they take years, so ignore people who say you need to experiment and research what works. The biggest issues you'll face is that no one will tell you what's wrong unless you're faced with it in threads like this on HN or other places where you'll meet consumers.

The worst part of it is, these are the obnoxious glaring details. There might be massive decisions you make that consumers can't pinpoint for you. Thought-leaders don't often describe those details because of survivorship bias.

What I can see this team failing at, too, is that you need an anchor client. You're spending all this time on BS that doesn't mean anything at all.

Specifically, at GitHub, they already had users using Atom, which made for a great way to advertise Electron. It was Atom!

You need to essentially find whales (Read: engineering leaders at businesses) and make the product good enough for one of them to say, yeah I'll use this over Electron, and if they're an attractive user, pump them on your front page. Find a way to make a deal with them so that you can funnel developers to their hiring channels.

Post reply on HN