Deciding between Rust or Go for desktop applications
The apps I wish to make need to interact, listen and change things outside of the browser or terminal console. I'll start with making simple programs that automate on the desktop before I make fully-fledged GUIs. Some examples in mind involve monitoring network traffic and changing some system settings, listening to and manipulating clipboard data, or interact with common hardware peripherals. I hope these examples give you an idea of my intentions. In addition, I did learn a little C++ and C yonks ago.
I believe Go is more suitable for desktop applications that a user interacts with, whereas Rust is better suited for programming lower level hardware behaviour/capabilities or getting closer to the kernel? So in other words, perhaps Go is like a better replacement for C++ and Rust is a better replacement for C? I acknowledge I'm providing gross simplifications here.
And it almost goes without saying, * I'm not asking what is the best language *. Rather, based on what has been described, which language would be most strategic to learn given my goals and intentions?
In another way what are the strengths and weaknesses of Go and Rust? When should one use the other?
Thank you in advance!
7 comments
[ 3.6 ms ] story [ 28.0 ms ] threadWebAssembly also support WASI, a way to access OS system services. You can even access the GPU with WebGPU/wgpu at the same time.
For a GUI applications, Slint/egui/Rust offer cross platform GUI-toolkits that target embedded.
Cloudflare recently open-sourced workerd, a WASM/JS runtime that acts as a server/HTTP proxy. You can maybe use that monitor network requests, in combination with the above to manipulate OS/GPU/etc. at the same time.
Both Go and Rust compile to WebAssembly. They both support bindings for WebGPU and WASI. You can use whatever floats your boat and just compile to WebAssembly. The future is here my friend.
Taking that into account, Go would be preferable, as proven since the days of Xerox PARC, GC based languages (regardless of the actual GC algorithm) are much productive for GUI development.
With this in mind, https://fyne.io/
https://wails.io/ is the Go option
There are a lot for many languages actually: https://github.com/sudhakar3697/electron-alternatives
Don't see the point in going for desktop apps. If you want to broaden your skills, that's great, but it's not a progression in skills.
For both server side programming as well embedded development, UI is less of a concern, and you control often the whole platform/OS.
Desktop apps require skills in UI development and also you have to bother to learn multiple platforms. Libraries and languages only do so much in providing an abstraction.
Also it depends on what you understand with Embedded systems. They range from full fledged windows/Linux/... systems (quite close to desktop apps and more UI programming needed) to PICs.
In my view, the programming language is the least of the concerns and a small part of the skill set you'll need to acquire.
Choose the tools you feel comfortable with in the problem space you want to work in.
There is micropython as well.