Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

There's an attempt to make this work for Rust desktop applications. There's the winit crate, which does cross-platform windowing and event loops. There's egui, for menus and subwindows. There's rfd, for file dialogs, which are special for security reasons. And there's wgpu, for cross-platform 3D.

I'm using all of these in my ui-mock,[1] which is a GUI for a game without the game. It has 3D graphics with 2D GUI elements on top. I'm using this to shake down all the cross-platform problems for my metaverse client. My own code, which is 100% safe Rust, has no platform dependent code.

Results are pretty good. There's minor dirty laundry in those libraries, which has been reported to the various maintainers. Stuff like this:

- You can get a file dialog hidden behind the main window, which, in a full screen program, is a real problem. Mostly a Linux problem; works fine on Windows.

- Full screen on Windows mode under Wine 7 crashes Wine. Known Wine bug.

- Warnings from WGPU, but it works around all of them with some minor performance loss.

- Cross-platform packaging, to make a Windows installer without Windows, isn't implemented yet.

So, not big stuff. A lot of stuff works that you might not expect to work, such as profiling with tracy. Wgpu is taking care of Vulkan vs Apple's Metal. (Apple just had to Think Different, to the annoyance of everybody doing 3D.) Opening a web page in the default browser is cross-platform. You can cross-compile - I build the Windows version on Linux, without using any Microsoft tools.

With some more work, I could make this work on WASM and Android as well, but that requires some special casing, mostly because WASM doesn't have proper threads.

So cross-platform desktop development is working pretty well. Most of the problems I'm running into would not appear in a more typical application.

[1] https://github.com/John-Nagle/ui-mock



Incidentally, if there's anyone into Windows installers and Rust, see [1][2] There's a Rust bundler for making installers cross-platform. Mac is done, Linux is partly done, and Windows needs someone familiar with the arcane world of Windows install files.

[1] https://github.com/neovide/neovide/issues/1374

[2] https://github.com/burtonageo/cargo-bundle/issues/116


Worth noting for c (and hence your niche language of choice via ffi) there is also glfw for windowing and webgpu-native which is from the same folk as wgpu.

EDIT: and also libuv which is the cross platform event loop for node.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: