windows-rs

Rust for Windows (by microsoft)

Windows-rs Alternatives

Similar projects and alternatives to windows-rs

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better windows-rs alternative or higher similarity.

windows-rs reviews and mentions

Posts with mentions or reviews of windows-rs. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-11-29.
  • Any recommendations for operating system authentication libraries?
    4 projects | reddit.com/r/rust | 29 Nov 2022
    I'm assuming I could try to crank something out for Windows using the windows crate, but I don't have the knowledge on the available methods or how to use them.
  • Windows API as a C++ module ?
    3 projects | reddit.com/r/cpp_questions | 12 Nov 2022
    Even Rust has a native projection of the windows API (which is actually pretty usable). This projection has the same roots as the C++ projection mentioned by u/amnesiac0x07C5. So I don't believe macros are a blocker here.
  • NSA urges orgs to use memory-safe programming languages - C/C++ on the bench, as NSA puts its trust in Rust, C#, Go, Java, Ruby and Swift
    11 projects | reddit.com/r/programming | 11 Nov 2022
  • My next Mac might be the last
    10 projects | news.ycombinator.com | 24 Oct 2022
    I jumped ship from macOS to Windows back in 2020 and honestly it has been great. Most of the time I essentially use Windows as a DE for Linux under WSL2.

    Especially since the windows-rs[1] crate was published, for me it is just so much more infinitely customizable for my needs than macOS ever was.

    Once you get the hang of the Win32 API (pretty easy with the excellent developer documentation), the sky is really the limit.[2]

    [1]: https://github.com/microsoft/windows-rs

    [2]: With the exception of the Virtual Desktops API. I'm still salty about this, see more here: https://news.ycombinator.com/item?id=33169588

  • Will Rust drop dependency on libc and make direct system calls? when ? (Please don't mention no_std case)
    6 projects | reddit.com/r/rust | 16 Oct 2022
    Windows: Syscalls are undocumented and unstable, and it is in fact impossible to compile any native code for Windows without linking against proprietary lib files ("import library" in Windows lingo). That said, there is a new feature #[link(kind="raw-dylib")] that allows windows-rs crate to link against dlls directly instead of using compile time import libraries: https://github.com/microsoft/windows-rs/pull/977. This is as "native" as you can get on Windows.
  • What bindings do I need for making a modern Windows 11 GUI?
    7 projects | reddit.com/r/rust | 14 Oct 2022
    WinUI doesn’t really support Rust; see this PR removing XAML support from the official windows crate: https://github.com/microsoft/windows-rs/pull/1836
  • Azure CTO: “It's time to halt starting any new projects in C/C++ ”
    15 projects | news.ycombinator.com | 19 Sep 2022
    In theory yes, but there's a lot of quirks and limitations.

    The main issues are:

    - Rust string types assume UTF-8, but Windows generally uses double-byte Unicode encodings. The Windows string type isn't even UTF16, because it can include invalid code points. This means that at every API call there will be the overhead of converting the string encodings.

    - Rust compilation is still very slow. In C++, it was a simple matter of including "windows.h" and then start typing code. In Rust, trying to do this naively would result in terrible "inner loop" for the developers. There are some fixes, but they're fiddly.

    - Enormous API surface with missing metadata. This is a problem with Rust-to-C interop in general, but the Win32 APIs are so huge that it's impractical to solve manually. There have been efforts by Microsoft to produce official and authoritative interface definitions with additional metadata such as tagging "in" and "out" parameters, etc... This isn't sufficient for Rust, which has a much more complex type system than vanilla C pointers. E.g.: lifetimes, non-null by default, etc...

    At this time, programming in Rust for Windows is basically writing C++ code in Rust syntax, but with a slower compile time than C++ would have. Arguably, there isn't even much of a safety benefit, because that would require an extensive set of "shims" to be produced to make Win32 act more like Rust and less like C/C++. Take a look at the size of the .NET Framework standard library to get an idea of what that entails. Not impossible, but not a trivial effort either!

    The best and most authoritative bindings are: https://github.com/microsoft/windows-rs

    The "demo" looks okay at first glance:

        unsafe {
    15 projects | news.ycombinator.com | 19 Sep 2022
    It looks like this official MS Rust library adds a lot of Win32 support: https://github.com/microsoft/windows-rs

    It should work well with VS Code.

  • Sharing Saturday #432
    5 projects | reddit.com/r/roguelikedev | 17 Sep 2022
    I finally was able to work past the issues I was having after the last update. Implementing FFI/Win32 interop in Rust is not nearly as straightforward as it is in C#. Fortunately after taking a step back and approaching the problem with a fresh perspective, I found the answer that I was looking for. The source code is now based on an example taken from the WinRT/Rust API projection, found here. I'm convinced for now that this is going to be the best way to work with Windows APIs in Rust. Other than that I still need to do some more research on the content. Most likely I'm going to have a Fallout-style open-world environment, but in Japan instead of US. And maybe an underground labyrinth of tunnels to serve as the dungeons, if I can come up with enough variety. Also using Japanese characters to display things like locations I think would be good. The translations would be in the manual pages. As for the mechanics, I don't think it's going to be pure survival. I like the idea of survival mechanics, but in practice I still tend to get bored of it early on. Maybe because the genre already been done too many times, or maybe my attention span is not what it used to be, but either way I will definitely be influenced by it. Also stealth mechanics, sneaking, etc. would be a plus.
  • How to use a windows COM object using Rust?
    2 projects | reddit.com/r/rust | 10 Aug 2022
    https://github.com/microsoft/windows-rs then you go straight up to the official win API tutorials. Language doesn't matter.
  • A note from our sponsor - InfluxDB
    www.influxdata.com | 3 Dec 2022
    InfluxDB is the Time Series Data Platform where developers build real-time applications for analytics, IoT and cloud-native services in less time with less code. Learn more →

Stats

Basic windows-rs repo stats
82
7,551
9.4
2 days ago
Truly a developer’s best friend
Scout APM is great for developers who want to find and fix performance issues in their applications. With Scout, we'll take care of the bugs so you can focus on building great things 🚀.
scoutapm.com