Live data from Hacker News

Rust/WinRT Public Preview

blogs.windows.com

21–30 of 219 posts

Re: Rust/WinRT Public Preview

#21
post #15

You have to hand it to Microsoft: It may be the only large software company that doesn't seem susceptible to not-invented-here syndrome. It's true that Microsoft historically has been an intensely competitive company, often trying to undermine competing technologies, e.g., with "embrace and extend" strategies. But whenever a competing technology -- whether a language, or a framework, or an application -- gains adopti…

It's in their blood - its the 'Embrace' in EEE.

Re: Rust/WinRT Public Preview

#22

Never really understood whether WinRT binds me to store apps, sandboxes, appx and so on. Can I develop a single windows app with this that runs on Windows 10 desktop as a win32 app does (such as a plugin to another application where I can’t can’t decide the deployment model)?

The future of Win32 is also bound to sandboxing, although we are not yet there.

"How Windows 10X runs UWP and Win32 apps"

https://www.youtube.com/watch?v=ztrmrIlgbIc&list=PLWZJrkeLOr...

WinRT is an improvement of COM, it either runs sandboxed in UWP (its home), or you can access it from Win32 via XAML Islands and Win32/UWP interop.

Right now Win32 applications can still choose between legacy mode, or opt into Win32 sandoxing via MSIX packages.

As Windows 10X shows, it might not be for long.

Re: Rust/WinRT Public Preview

#23

Never really understood whether WinRT binds me to store apps, sandboxes, appx and so on. Can I develop a single windows app with this that runs on Windows 10 desktop as a win32 app does (such as a plugin to another application where I can’t can’t decide the deployment model)?

A lot of WinRT APIs are usable from "normal" desktop win32 apps, but some are restricted to the sandboxed/appx/etc model.

The most prominent of these is probably the XAML GUI stuff, but those are becoming available everywhere in the near future, and being decoupled from the OS itself, to go along with WinUI 3.0

Re: Rust/WinRT Public Preview

#24
post #6

I stopped reading at "The Windows Runtime is based on Component Object Model (COM) APIs..." Is that a bad choice on my part? I see COM and think of OLE, CORBA and I remember that I'm old and going to die pretty soon (within the next 40-50 years almost assuredly). https://en.wikipedia.org/wiki/Component_Object_Model

COM is a fantastic invention and implementation. Granted, it was pretty painful in C and somewhat in C++, but all the other languages (VB and C# mostly, but plenty of others) really unlock the power of COM. Nothing like that remotely exists on Linux or macOS.

My only experience with COM (that I know of) was trying to do MS Office automation from C# >10 years ago.

I recall that it was very awkward, and somehow prone to memory leaks, and unclosed resources. To this day, I still don't really understand what COM is, or is supposed to be. But I still have a negative visceral reaction.

Re: Rust/WinRT Public Preview

#25
post #6

I stopped reading at "The Windows Runtime is based on Component Object Model (COM) APIs..." Is that a bad choice on my part? I see COM and think of OLE, CORBA and I remember that I'm old and going to die pretty soon (within the next 40-50 years almost assuredly). https://en.wikipedia.org/wiki/Component_Object_Model

Yes it is.

After the whole political disaster that was Longhorn, the Windows team decided to rebuilt Longhorn ideas, originally based on .NET, and redo them with COM.

So while many outside Windows have considered COM dead, actually since Vista all major Windows APIs have been provided as COM interfaces, the large majority of Win32 surface has been frozen since Windows XP.

With WinRT/UA/UAP/UWP they have gone back to the roots, while pursuing this idea one level up.

Basically they replaced COM type libraries with .NET Metadata, added support for generics, structured data types and implementation inheritance, bringing it to what .NET would have been like if they did not decided to copy Java.

So while the implementation of this reboot has been somewhat clusmy, COM is not going anywhere on Windows.

Also, this isn't a Windows only thing, Linux has gathered around DCOP, Android has AIDL, Fuchsia FIDL, macOS/iOS has XPC, then there is gRPC and plenty of other variants.

Re: Rust/WinRT Public Preview

#27
post #15

You have to hand it to Microsoft: It may be the only large software company that doesn't seem susceptible to not-invented-here syndrome. It's true that Microsoft historically has been an intensely competitive company, often trying to undermine competing technologies, e.g., with "embrace and extend" strategies. But whenever a competing technology -- whether a language, or a framework, or an application -- gains adopti…

[deleted]

Re: Rust/WinRT Public Preview

#28

Never really understood whether WinRT binds me to store apps, sandboxes, appx and so on. Can I develop a single windows app with this that runs on Windows 10 desktop as a win32 app does (such as a plugin to another application where I can’t can’t decide the deployment model)?

The minesweeper example from the article is a regular Win32 app. Desktop Win32 apps can call WinRT API’s.

https://github.com/robmikh/minesweeper-rs/blob/master/src/ma...

Re: Rust/WinRT Public Preview

#29
post #6

I stopped reading at "The Windows Runtime is based on Component Object Model (COM) APIs..." Is that a bad choice on my part? I see COM and think of OLE, CORBA and I remember that I'm old and going to die pretty soon (within the next 40-50 years almost assuredly). https://en.wikipedia.org/wiki/Component_Object_Model

Trouble is you can't really the solve the problem Microsoft had without using something like COM. Good news is you don't have to care - you can use C# or Rust and not worry about COM.

Somehow I think .NET would have been much better had it started as something like .NET Native, but yeah cannot turn back in time.

Re: Rust/WinRT Public Preview

#30
While we've been hacking on the vst3-sys crate [0], we wound up forking the mentioned com-rs crate to support COM APIs on non-win32 targets (notably, there's some stuff with endianness of the IIDs, the calling convention of the generated vtables) as well as usability (the com-rs crate only supports up to 5 interfaces implemented at once). We're still chasing down some issues with order mattering when implementing the interfaces. Even without those small changes, it's an impressive piece of macro programming that is very close to being usable for general purpose, ABI-stable rust crates.

As a little dose of irony, clippy doesn't like the com-rs crate too much.

[0] https://github.com/RustAudio/vst3-sys.git

Post reply on HN