MHN
Add a comment on Hacker News →
3 of 167 comments
  1. I found Qts signal/slot system very nice to work with to help with bridging the application logic to UI events and flows. Maybe rust's generic async is all you need, but I suspect that a GUI should probably have some opinion of how it interacts with async.

  2. > RAM remains expensive and the focus is shifting to mobile, so bloat has real consequences. Building high-performance UI in Rust is a practical alternative.

    The blogger is making the mistake of trying to come up with problems where Rust is the solution.

    The truth of the matter is that both Android and iOS have native, high performance GUI toolkits. Yet, some mobile apps developed by sizeable professional teams led by smart software engineers still opt to develop them with webview-based technologies. Why would this happen if the blogger's argument was grounded on reality?

    The truth of the matter is that webview-based technologies are already quite performant and run well with the resources of your average phone. Native GUI toolkits moreso.

    Also, today's mobile phones have far more computational resources than your average workstation from 20 years ago, and back then people were fine with using Java-based desktop applications. So to claim that today there is a premium for performance that didn't existed decades ago is an extraordinary claim that is not really supported by reality.

    But again that's why the blogger had to at least try to come up with a problem where Rust for GUI programming was a reasonable solution. It's a shame the problem simply isn't real.

  3. I think immediate-mode UI is awful (does lot of useless work, redraws whole window on every mouse move). Also I think GPU support is not that important:

    • first, GPU requires shaders compilation which is slow so you need CPU renderer anyway
    • second, not all GPUs are supported, not all have drivers, some are buggy and many machines, like VM, do not have a GPU
    • third, it probably uses lot of memory

    You don't need a GPU to add one letter to a text field.

    I did some tests in a GPU-less VM, using one x86-64 core. The test simply rendered black and white 4K frames. Rendering to memory gave numbers like 360 fps (and ~8GiB/s of RAM writes). Rendering to X server via SHM produced something about 80 fps, the X server used 50% of the core and the program used other 50%. But many users have much smaller screens, and you typically do not need to redraw whole window every frame.

    So you can render everything on a CPU and, if the user has a GPU, use it to accelerate drawing rounded rectangles which make probably 90% of GUI.