alcinnz
alcinnz boosted

Async #Rust is actually awesome! awesome

The last few days I've built a prototype(!) of a global "Hotkey" system e.g.:

Press & Hold LCtrl + Space
=> an async stream starts and only finishes if:
- another key is pressed or
- one of the Hotkeys is released

If it is not clear by now: this is a state-machine, which fits perfectly into Rust's #async model!

And the best part: This is actually the first time I've ever touched async #RustLang! Such a pleasant experience!

1/?

#AsyncRust

alcinnz
alcinnz boosted

Cross-compiling a #Rust project that has custom build scripts that build C/C++ dependencies is an absolute clusterfuck!

I'm trying to cross-compile a Rust project from #Linux -> #Windows (x86_64-pc-windows-gnu) and I get walls of errors!

Some I could already fix by setting env vars to different compilers (gcc, g++, oh my!), but now I'm stuck. Maybe some missing compiler flags to gcc?

Or could it be related to this?
=> https://stackoverflow.com/a/53635241

#Help #RustLang#CrossCompile#CrossCompilation

Output of the terminal after cross-compiling the whisper-rs crate from Linux to Windows (warning: the output is very long):

  -- Detecting C compiler ABI info - failed
     Called from: [3]   /usr/share/cmake-3.28/Modules/CMakeDetermineCompilerABI.cmake
                  [2]   /usr/share/cmake-3.28/Modules/CMakeTestCCompiler.cmake
                  [1]   /home/jan/Dev-Projects/repos/talky/target/x86_64-pc-windows-gnu/release/build/whisper-rs-sys-90a1c9a45fb90ba6/out/whisper.cpp/CMakeLists.txt
  -- Check for working C compiler: /usr/bin/gcc
     Called from: [3]   /usr/share/cmake-3.28/Modules/CMakeTestCompilerCommon.cmake
                  [2]   /usr/share/cmake-3.28/Modules/CMakeTestCCompiler.cmake
                  [1]   /home/jan/Dev-Projects/repos/talky/target/x86_64-pc-windows-gnu/release/build/whisper-rs-sys-90a1c9a45fb90ba6/out/whisper.cpp/CMakeLists.txt
  -- Check for working C compiler: /usr/bin/gcc - broken
     Called from: [3]   /usr/share/cmake-3.28/Modules/CMakeTestCompilerCommon.cmake
                  [2]   /usr/share/cmake-3.28/Modules/CMakeTestCCompiler.cmake
                  [1]   /home/jan/Dev-Projects/repos/talky/target/x86_64-pc-windows-gnu/release/build/whisper-rs-sys-90a1c9a45fb90ba6/out/whisper.cpp/CMakeLists.txt
  -- Configuring incomplete, errors occurred!

  --- stderr
  ./whisper.cpp/ggml/include/ggml.h:210:10: fatal error: 'stdio.h' file not found
Output of the terminal after cross-compiling the whisper-rs crate from Linux to Windows (warning: the output is very long): -- Detecting C compiler ABI info - failed Called from: [3] /usr/share/cmake-3.28/Modules/CMakeDetermineCompilerABI.cmake [2] /usr/share/cmake-3.28/Modules/CMakeTestCCompiler.cmake [1] /home/jan/Dev-Projects/repos/talky/target/x86_64-pc-windows-gnu/release/build/whisper-rs-sys-90a1c9a45fb90ba6/out/whisper.cpp/CMakeLists.txt -- Check for working C compiler: /usr/bin/gcc Called from: [3] /usr/share/cmake-3.28/Modules/CMakeTestCompilerCommon.cmake [2] /usr/share/cmake-3.28/Modules/CMakeTestCCompiler.cmake [1] /home/jan/Dev-Projects/repos/talky/target/x86_64-pc-windows-gnu/release/build/whisper-rs-sys-90a1c9a45fb90ba6/out/whisper.cpp/CMakeLists.txt -- Check for working C compiler: /usr/bin/gcc - broken Called from: [3] /usr/share/cmake-3.28/Modules/CMakeTestCompilerCommon.cmake [2] /usr/share/cmake-3.28/Modules/CMakeTestCCompiler.cmake [1] /home/jan/Dev-Projects/repos/talky/target/x86_64-pc-windows-gnu/release/build/whisper-rs-sys-90a1c9a45fb90ba6/out/whisper.cpp/CMakeLists.txt -- Configuring incomplete, errors occurred! --- stderr ./whisper.cpp/ggml/include/ggml.h:210:10: fatal error: 'stdio.h' file not found

Second: Pinning helpers!

When doing async #Rust, there will be a point, where you'll get the ominous "Doesn't implement Unpin" error and "You need to pin your value".

First, learn about Pinning:
https://doc.rust-lang.org/std/pin/

Like, really learn and understand it:
https://fasterthanli.me/articles/pin-and-suffering

And then use smol's pin! macro and the pin_project crate:
https://docs.rs/pin-project/latest/pin_project/

I might continue this thread with more insights I gain during this little project - stay tuned! 🙂

4/4?

#RustLang#AsyncRust

Async #Rust is actually awesome! awesome

The last few days I've built a prototype(!) of a global "Hotkey" system e.g.:

Press & Hold LCtrl + Space
=> an async stream starts and only finishes if:
- another key is pressed or
- one of the Hotkeys is released

If it is not clear by now: this is a state-machine, which fits perfectly into Rust's #async model!

And the best part: This is actually the first time I've ever touched async #RustLang! Such a pleasant experience!

1/?

#AsyncRust

alcinnz
alcinnz boosted

This second post in the Tyr series dives deeper into GPU driver internals by using the Vulkan-based VkCube application to explain how User Mode Drivers (UMDs) and Kernel Mode Drivers (KMDs) work together to execute GPU workloads: https://www.collabora.com/news-and-blog/blog/2025/08/06/writing-a-rust-gpu-kernel-driver-a-brief-introduction-on-how-gpu-drivers-work/

#OpenSource #Rust

Cross-compiling a #Rust project that has custom build scripts that build C/C++ dependencies is an absolute clusterfuck!

I'm trying to cross-compile a Rust project from #Linux -> #Windows (x86_64-pc-windows-gnu) and I get walls of errors!

Some I could already fix by setting env vars to different compilers (gcc, g++, oh my!), but now I'm stuck. Maybe some missing compiler flags to gcc?

Or could it be related to this?
=> https://stackoverflow.com/a/53635241

#Help #RustLang#CrossCompile#CrossCompilation

Output of the terminal after cross-compiling the whisper-rs crate from Linux to Windows (warning: the output is very long):

  -- Detecting C compiler ABI info - failed
     Called from: [3]   /usr/share/cmake-3.28/Modules/CMakeDetermineCompilerABI.cmake
                  [2]   /usr/share/cmake-3.28/Modules/CMakeTestCCompiler.cmake
                  [1]   /home/jan/Dev-Projects/repos/talky/target/x86_64-pc-windows-gnu/release/build/whisper-rs-sys-90a1c9a45fb90ba6/out/whisper.cpp/CMakeLists.txt
  -- Check for working C compiler: /usr/bin/gcc
     Called from: [3]   /usr/share/cmake-3.28/Modules/CMakeTestCompilerCommon.cmake
                  [2]   /usr/share/cmake-3.28/Modules/CMakeTestCCompiler.cmake
                  [1]   /home/jan/Dev-Projects/repos/talky/target/x86_64-pc-windows-gnu/release/build/whisper-rs-sys-90a1c9a45fb90ba6/out/whisper.cpp/CMakeLists.txt
  -- Check for working C compiler: /usr/bin/gcc - broken
     Called from: [3]   /usr/share/cmake-3.28/Modules/CMakeTestCompilerCommon.cmake
                  [2]   /usr/share/cmake-3.28/Modules/CMakeTestCCompiler.cmake
                  [1]   /home/jan/Dev-Projects/repos/talky/target/x86_64-pc-windows-gnu/release/build/whisper-rs-sys-90a1c9a45fb90ba6/out/whisper.cpp/CMakeLists.txt
  -- Configuring incomplete, errors occurred!

  --- stderr
  ./whisper.cpp/ggml/include/ggml.h:210:10: fatal error: 'stdio.h' file not found
Output of the terminal after cross-compiling the whisper-rs crate from Linux to Windows (warning: the output is very long): -- Detecting C compiler ABI info - failed Called from: [3] /usr/share/cmake-3.28/Modules/CMakeDetermineCompilerABI.cmake [2] /usr/share/cmake-3.28/Modules/CMakeTestCCompiler.cmake [1] /home/jan/Dev-Projects/repos/talky/target/x86_64-pc-windows-gnu/release/build/whisper-rs-sys-90a1c9a45fb90ba6/out/whisper.cpp/CMakeLists.txt -- Check for working C compiler: /usr/bin/gcc Called from: [3] /usr/share/cmake-3.28/Modules/CMakeTestCompilerCommon.cmake [2] /usr/share/cmake-3.28/Modules/CMakeTestCCompiler.cmake [1] /home/jan/Dev-Projects/repos/talky/target/x86_64-pc-windows-gnu/release/build/whisper-rs-sys-90a1c9a45fb90ba6/out/whisper.cpp/CMakeLists.txt -- Check for working C compiler: /usr/bin/gcc - broken Called from: [3] /usr/share/cmake-3.28/Modules/CMakeTestCompilerCommon.cmake [2] /usr/share/cmake-3.28/Modules/CMakeTestCCompiler.cmake [1] /home/jan/Dev-Projects/repos/talky/target/x86_64-pc-windows-gnu/release/build/whisper-rs-sys-90a1c9a45fb90ba6/out/whisper.cpp/CMakeLists.txt -- Configuring incomplete, errors occurred! --- stderr ./whisper.cpp/ggml/include/ggml.h:210:10: fatal error: 'stdio.h' file not found

This second post in the Tyr series dives deeper into GPU driver internals by using the Vulkan-based VkCube application to explain how User Mode Drivers (UMDs) and Kernel Mode Drivers (KMDs) work together to execute GPU workloads: https://www.collabora.com/news-and-blog/blog/2025/08/06/writing-a-rust-gpu-kernel-driver-a-brief-introduction-on-how-gpu-drivers-work/

#OpenSource #Rust

I'm stuck trying to decide whether to implement my own hash table, or use an additional and unnecessary level of pointers with unordered_map

C++17 gave us std::vector, std::list and std::forward_list of incomplete types (HOW DID IT TAKE THAT LONG), but from what I can tell, not even C++26 will have std::unordered_map of incomplete types :(

Of course in #Rust, vectors and hash maps and everything else just works with recursive types no problem

#cplusplus#cpp

#introduction I am Jeremy Soller.

I work at @system76 as Principal Engineer where I maintain our Linux distribution @pop_os_official, port @coreboot and open source embedded controller firmware to our laptops, work on the new desktop environment @COSMIC_desktop, and more!

I also am the creator and BDFL of a microkernel operating system primarily written in @rust called @redox. I am damn near crazy about #Rust and use it anywhere and everywhere!

Follow if you are interested in these things 🙌 🦀

alcinnz
alcinnz boosted

Heck yeah, this thing will blow up! awesome

Introducing Operese (a Windows-to-Linux migration tool made by a nerd):

https://yewtu.be/watch?v=PMoXClh8emw
(or YT: https://www.youtube.com/watch?v=PMoXClh8emw)

The demo is very impressive! 👀

It apparently migrates your #Windows10 installation to #Linux #Kubuntu (❤️) with all your files ready to use. 🚀

Written in #Rust, but not yet #OpenSource (according to author will be Open Source in the near future).

#OS#OperatingSystem #RustLang#Operese#EndOf10 #KDE