[HN Gopher] Rust for Windows 0.9
___________________________________________________________________
Rust for Windows 0.9
Author : chenzhekl
Score : 182 points
Date : 2021-05-08 08:15 UTC (14 hours ago)
(HTM) web link (blogs.windows.com)
(TXT) w3m dump (blogs.windows.com)
| turbinerneiter wrote:
| I feel like MS naming convention are flipped on the head.
|
| Rust for Windows -> a version of Rust for Windows? Windows
| Library for Rust -> a library for Rust that allows to interface
| with Windows APIs
|
| Same with Windows Subsystem for Linux. It's a Linux system for
| Windows.
|
| But hey, that's just names. Nice for win-devs to get more
| languages supported.
| signal11 wrote:
| The way to parse WSL is that it's a <Windows (NT) Subsystem>
| for Linux.
|
| Windows NT had environment subsystems as a key part of its
| architecture, with subsystems for POSIX and OS/2,
| originally[1], and even Win32 was conceptually a subsystem for
| NT, albeit a very important one.
|
| [1]
| https://en.wikipedia.org/wiki/Architecture_of_Windows_NT#/me...
| antibuddy wrote:
| > The way to parse WSL is that it's a <Windows (NT)
| Subsystem> for Linux.
|
| For me that still parses wrong on first try. I mean I can
| make sense of it, because I already know how it is meant,
| however for me the most obvious assumption is, that it is for
| the given host and that host is Windows, not Linux. So Linux
| (compatibility) subsystem for Windows would make more sense
| to me.
| harles wrote:
| I think rearranging those words in almost any other order
| would've been superior: WLS, LSW, LWS
| vbezhenar wrote:
| And the fun part is that since WSL 2 it's no longer a Windows
| Subsystem, but just a Linux kernel in VM with some nice
| integrations with host Windows OS.
| skohan wrote:
| And how are you supposed to parse the rust library?
| gpm wrote:
| <A Rust Library> for Windows
| remram wrote:
| That still sounds like it's a Rust library you get to use
| on Windows, not a library of Windows functions to use
| from Rust.
| [deleted]
| moron4hire wrote:
| A Rust Binding for WinAPI
| skohan wrote:
| That doesn't even contain "Rust for Windows"
| uranusjr wrote:
| Shirley you realise WinAPI is officially named the
| Windows API?
| skohan wrote:
| Yeah but MS could actually call this library what it is,
| not leave it to multiple levels of inference.
|
| And don't call me Shirley!
| [deleted]
| contextfree wrote:
| It was Rust/WinRT, then they added support for other kinds of
| Windows APIs alongside the WinRT support. Someone probably
| thought Rust/Windows looked weird, so, Rust for Windows.
|
| Rust/WinRT was called that because it was patterned after
| C++/WinRT, which was called that because it was a replacement
| for or alternative to C++/CX, which was called that because it
| was an analog to C++/CLI. C++/CX and C++/CLI are language
| extensions/forks, while C++/WinRT and Rust/WinRT are just
| libraries (and tools).
|
| (I always thought C++/WinRT was a bad choice of name for this
| reason)
| Boulth6 wrote:
| This is mostly for legal reasons and the "for X" where X is a
| trademark is a common theme. (just look at Google Play store
| "for Twitter" or "for Reddit").
|
| Looks and sounds weird though!
| dataflow wrote:
| They use that excuse but it doesn't explain the fact that
| they had alternatives like "the Windows Linux Subsystem" or
| "the Windows Rust library"...
| skohan wrote:
| Even "Rust Library for Windows" (or why not just "Rust
| Windows API Library") would be more clear.
| dataflow wrote:
| I think the legal issue was that you don't want to start
| with a trademark name since it suggests
| endorsement/support from that party.
| skohan wrote:
| Doesn't "Rust for Windows" start with a trademark name?
| dataflow wrote:
| Yeah I don't know how they got away with that!
| rasz wrote:
| and windows 0.9? Cmon, not even full 1.0?
| https://en.wikipedia.org/wiki/Windows_1.0
| 29athrowaway wrote:
| That's exactly what I thought.
|
| It should be Windows support for Rust and not the other way
| around.
| worble wrote:
| When it was Windows Subsystem for Linux, I assumed marketing
| dictated "No no, the word Windows MUST be the first word."
|
| This one just seems deliberately confusing for no reason.
| bitwize wrote:
| AFAIK it was their legal department, who advised them that
| calling it a "Linux Subsystem" may run afoul of the Linux
| trademark, especially considering that in WSL1, Linux itself
| was not involved at all.
| kaetemi wrote:
| Correct. It's a trademark law issue. In the same way that
| you can develop a "Chess for Windows" but not a "Windows
| Chess". Using "for X" is fair use.
| mastax wrote:
| Similarly, the unofficial Reddit apps had to rename from
| e.g. "Reddit Sync" to "Sync for Reddit".
| MereInterest wrote:
| But even in your example, it shows how bad of a name WSL
| is. "Chess for Windows" implies that there is a chess
| program that runs on windows. By analogy, "Windows
| Subsystem for Linux" implies that there is a Windows
| Subsystem that can run on Linux.
| losvedir wrote:
| You say "correct" but you're directly contradicting the
| parent's point, since with your argument the easily and
| correctly parsed 'Linux Subsystem "for Windows"' would
| not run afoul of any trademarks.
| bitwize wrote:
| Remember -- the name "Linux" is trademarked. Microsoft is
| free to call something Windows X since they own the
| Windows trademark, but they can't call something Linux X
| because they don't own the Linux trademark. But they can
| call something X for Linux the same way a third party can
| call something X for Windows. Hence, Windows Subsystem
| for Linux. It sounds dumb, but that's the legal
| rationale.
| oaiey wrote:
| Mentioned somewhere else: Windows NT has subsystems. E.g.
| posix, os2, win32, ... What they do is adding a subsystem to
| windows. The module they code is the subsystem not the
| distribution. Nowadays it is a bit blurry die to the full
| kernel and this windowing subsystem.
| lostmsu wrote:
| I think Microsoft played all of us with this name. The
| confusion is there intentionally for developers to argue about,
| therefore generating marketing material for free.
| skohan wrote:
| Maybe it's cynical, but I wonder if it's a PR/imaging move.
| When you read these kind of names, it seems like the Linux/Rust
| community is embracing and supporting Windows, while really
| it's the reverse.
| loa_in_ wrote:
| I don't think it's cynical at all, and is probably both. I
| guess in all big companies PR/marketing teams chime in to all
| public facing projects
| mcny wrote:
| I think you are right. If I remember correctly, someone on
| the typescript team said they have no control over version
| numbers. PR/marketing decides what is version 4.0 vs 3.11.
| Vinnl wrote:
| I don't think that's strictly true: https://twitter.com/d
| rosenwasser/status/1098748330765619200
|
| As far as major versions go, AFAIK they just bump the
| mayor version every ten minor versions, of which they
| release a new one every 3 (?) months.
| guerrilla wrote:
| Thank you. I was wondering why someone resurrected Windows 0.9
| (was that even a thing?) and why in the hell someone would port
| Rust to it.
| shp0ngle wrote:
| At least they didn't name it Azure Rust, Rust Live, Rust.net or
| Rust 365 :)
| [deleted]
| dvfjsdhgfv wrote:
| I'm pretty certain some of these names will appear sooner or
| later.
| mrlonglong wrote:
| Rusty Windows ftw
| ZuLuuuuuu wrote:
| A good usage example for a similar naming is "Qt for Python"
| which is the name of Python bindings of Qt framework.
|
| I literally didn't understand what "Rust for Windows" meant, I
| needed to read the blog post to understand what it is, which is
| a Rust library to use Windows API from Rust.
| Iv wrote:
| Microsoft sucks at many things. Naming things in a descriptive
| way is one of them.
| pjc50 wrote:
| Microsoft naming is incomprehensible sometimes. Doing a .net
| framework -> dotnet core transition at the moment has really
| exposed me to a lot of this.
| xbar wrote:
| I find Microsoft naming is always suspicious.
|
| "Let's deliberately choose a name for a thing that could be
| confused for a different thing. [some amount of time and
| nefarious activity later, and with false innocence] Oh, we've
| always called it that, so you can't have that namespace even
| though you think it should belong to that technology that
| predates our suspicious name with which we encroached on non-
| Microsoft technology."
| arwhatever wrote:
| New Microsoft project name idea: Microsoft Namespace
| dmytrish wrote:
| Yes, this is more of a "Rust rof Windows" thing.
| gtirloni wrote:
| I'm completely confused by Microsoft's use of "for Windows"
| naming.
|
| Rust for Windows already exists. This is a Windows SDK for Rust.
|
| Windows Subsystem for Linux is Linux subsystem for Windows.
|
| Is this some usage of the "for" word that I'm not getting? I'm a
| non-native English speaker so I could be at fault here.
| themulticaster wrote:
| This was mentioned somewhere else already, but the way to parse
| [Windows Subsystem for Linux] is [Windows] [Subsystem for
| Linux] (not [Windows Subsystem] [for Linux]). In case of [Rust
| for Windows], it should actually be called something like
| [Rust] [API for Windows].
|
| But I agree, the naming is very confusing.
| elcomet wrote:
| That's incorrect. The name is Windows Subsystem (as in a
| Subsystem that runs on the windows kernel) for linux, that
| is, designed to run Linux.
| IshKebab wrote:
| I think it's more like (Windows Subsystem) for [running]
| Linux.
| MereInterest wrote:
| Even with that, I'd expect a "subsystem for Linux" to be a
| subsystem that runs _on_ Linux, not a subsystem that runs
| Linux. I think it 's the word "for" that is causing
| confusion, rather than the parsing order itself.
| eterm wrote:
| The most generous interpretation I can think of is to parse
| this as "Rust for Windows <Development>"
| TuganBara wrote:
| That's what i thought
| bobnamob wrote:
| It's not just non-native speakers that are getting confused by
| their inconsistent English. Don't worry, not just you
| softblush wrote:
| Why is the v in v0.9 missing in the title
| spicybright wrote:
| I sure can't wait when they release Rust for Windows 3.1
| BoardsOfCanada wrote:
| I wish apple would do the same.
| diego_moita wrote:
| Check Core Foundation [0]. It implements a lot of OS-X's API in
| Rust.
|
| It is not Apple, is made by Mozilla as part of their Servo
| browser project. But is probably the best we'll have. Apple
| stopped playing the "open" game long ago, even before MS
| started it.
|
| https://github.com/servo/core-foundation-rs
| vlovich123 wrote:
| I wonder if there's some way to leverage the Swift
| annotations in the SDK to help generate the Rust code
| automatically.
| tristan957 wrote:
| Servo is now managed by the Linux Foundation. Mozilla quit
| managing it after their round of layoffs early last year.
| dataflow wrote:
| A bit off-topic but is the C++ API library for Windows coming
| along too? I've been looking out for that, but I'm not sure what
| state it's in.
| pjmlp wrote:
| In what concerns C++/WinRT, doing great, assuming that you
| enjoy editing IDL files without any kind of Visual Studio
| support, manually copying and merging files, and that the team
| had waves any complaint how the tool is lacking versus C++/CX
| to the miraculous day when ISO C++ gets reflection support.
|
| Really, ageing MFC feels more productive.
|
| I don't know, maybe at BUILD 2021 they will announce something,
| there is always hope.
| pdenton wrote:
| After Windows 10 comes 0.9? Did 11 cause a version integer
| overflow?
| saurabh20n wrote:
| I just started using this library 2 weeks ago. It is beautiful.
| We were in python land, and dreading moving to C++ for
| performance. This is a life saver.
|
| Not having to dig up COM UUIDs for interfaces is super nice. The
| lead developer of com-rs told me that com-rs is deprecated in
| favor of windows-rs (he works on both.)
| mattdeboard wrote:
| This is _awesome_.
| mrlonglong wrote:
| When are they going to do a Rust backend to generate .Net code?
| wvenable wrote:
| Why would they? Rust is for native development -- that's its
| reason to exist.
| lostmsu wrote:
| Somebody is doing it as a side project:
| https://ericsink.com/entries/llama_rust_013.html
| k4ch0w wrote:
| I recently tried to use this library and had to go back to
| winapi-rs for the mean time.
|
| The bindings to set it up gave hard to debug errors and there is
| no support for compiling the x86_64-pc-windows-gnu toolchain on
| anything else besides a windows system; Which makes sense but
| winapi-rs compiled on Linux so I stuck with it. I don't want to
| manage another build machine and I know I'm probably like the one
| guy.
|
| Working with strings was a bit rough too, it'd be nice if you
| could just pass a CStr and call it a day instead of messing with
| buffers and lengths and double function calls, one to get size of
| the string and then another to fill the actual buffer. I know
| this is how Win32 works, but it doesn't feel natural coming from
| Linux Kernel Dev.
|
| Regardless of my criticisms, I am excited to see the future of
| this crate. I think it's an awesome effort and a great addition
| to Rust and Windows.
| a3w wrote:
| Windows 0.9 was an OS in 1980s... NOT.
| tbrock wrote:
| Why is microsoft posting this / working on this rather than the
| rust project itself?
| wejick wrote:
| Because it's rust interface to windows API
| fnord123 wrote:
| Does it replace or compete with the winapi crate?
| Jare wrote:
| It's their Windows API SDK, same as Amazon posting about their
| Rust SDK for AWS.
| Erlangen wrote:
| Aws named it "A New AWS SDK for Rust - Alpha Launch".[1]
|
| [1]https://aws.amazon.com/de/blogs/developer/a-new-aws-sdk-
| for-...
| creata wrote:
| Judging by the getting started guide[0], they thankfully _haven
| 't_ forked Rust or anything, this is all about windows-rs[1], a
| Rust library for conveniently accessing the Windows API.
|
| [0]: https://docs.microsoft.com/en-us/windows/dev-
| environment/rus...
|
| [1]: https://github.com/microsoft/windows-rs
| aldanor wrote:
| So it's more like "Windows for Rust" rather than "Rust for
| Windows"...
| usrusr wrote:
| It's still Rust for Windows, as in "this is what we need to
| make Rust an option for Windows development". Thankfully,
| it's not 2003 anymore when the tools involved would only
| run on the target OS unless written in Java or by RMS.
| Nobody wants to bother with the specifics of their build
| server environment.
| hrydgard wrote:
| They're just bad at naming - that's not what they're doing.
| v8dev123 wrote:
| I hate their all caps names.
| steveklabnik wrote:
| Microsoft does also contribute to the Rust project itself,
| alongside the other stuff folks are talking about.
___________________________________________________________________
(page generated 2021-05-08 23:02 UTC)