TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Deciding between Rust or Go for desktop applications

3 点作者 b1zguy大约 2 年前
I&#x27;m looking to expand my programming skills from web apps, automation, scripting - mainly Python - to more traditional cross-platform, desktop-based (but GUI lite) apps because I progressively want to get closer to the metal (one day work with embedded systems). Nevertheless, I currently desire to create desktop tools like I&#x27;ve done in the browser and with automation scripts in the terminal or web servers.<p>The apps I wish to make need to interact, listen and change things outside of the browser or terminal console. I&#x27;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.<p>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&#x2F;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&#x27;m providing gross simplifications here.<p>And it almost goes without saying, * I&#x27;m not asking what is the best language *. Rather, based on what has been described, <i>which language would be most strategic to learn</i> given my goals and intentions?<p>In another way what are the strengths and weaknesses of Go and Rust? When should one use the other?<p>Thank you in advance!

5 条评论

pjmlp大约 2 年前
Neither of them have GUI tooling for desktop applications comparable to Swift, Objective-C, Java, C#, C++.<p>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.<p>With this in mind, <a href="https:&#x2F;&#x2F;fyne.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;fyne.io&#x2F;</a>
yokaze大约 2 年前
&gt; cause I progressively want to get closer to the metal (one day work with embedded systems)<p>Don&#x27;t see the point in going for desktop apps. If you want to broaden your skills, that&#x27;s great, but it&#x27;s not a progression in skills.<p>For both server side programming as well embedded development, UI is less of a concern, and you control often the whole platform&#x2F;OS.<p>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.<p>Also it depends on what you understand with Embedded systems. They range from full fledged windows&#x2F;Linux&#x2F;... systems (quite close to desktop apps and more UI programming needed) to PICs.<p>In my view, the programming language is the least of the concerns and a small part of the skill set you&#x27;ll need to acquire.<p>Choose the tools you feel comfortable with in the problem space you want to work in.<p>There is micropython as well.
SvenL大约 2 年前
I would go with Rust, because it’s also suited for embedded scenarios. Also, there is some Rust support for Windows API development (<a href="https:&#x2F;&#x2F;learn.microsoft.com&#x2F;en-us&#x2F;windows&#x2F;dev-environment&#x2F;rust&#x2F;rust-for-windows" rel="nofollow">https:&#x2F;&#x2F;learn.microsoft.com&#x2F;en-us&#x2F;windows&#x2F;dev-environment&#x2F;ru...</a>). I think there is even some initiative to support Rust with WinUI 3 but I can’t find the blog post about it. So if you’re developing on Windows you’re covered.
DaSexiestAlive大约 2 年前
Go easy on yourself. Write desktop apps in something you are already familiar with--HTML, CSS, Javascript--with the help of Electron. Then using interfaces like Neon, you can rewrite hot-pots in Rust&#x2F;Go. All you gotta do is profile your code from time to time to find out where the hot-spots are.
评论 #35498236 未加载
Labienus大约 2 年前
I would check out the WebAssembly VM. There are many projects aiming to make it a lightweight embedded standard, and it&#x27;s also in browsers. I think learning a bit about it might help swap between web&#x2F;embedded.<p>WebAssembly also support WASI, a way to access OS system services. You can even access the GPU with WebGPU&#x2F;wgpu at the same time.<p>For a GUI applications, Slint&#x2F;egui&#x2F;Rust offer cross platform GUI-toolkits that target embedded.<p>Cloudflare recently open-sourced workerd, a WASM&#x2F;JS runtime that acts as a server&#x2F;HTTP proxy. You can maybe use that monitor network requests, in combination with the above to manipulate OS&#x2F;GPU&#x2F;etc. at the same time.<p>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.