Live data from Hacker News

Rust/WinRT Public Preview

blogs.windows.com

101–110 of 219 posts

Re: Rust/WinRT Public Preview

#101

Earlier quoted context omitted.

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.

there is a big difference between out of process COM (like Office Automation) and in process COM (like WinRT and UWP or DirectX). Out of process was always a little tricky and not implemented well. DCOM was even worse. In process COM works really well. Edit: I should add that C# isn’t the best language for COM because it doesn’t release objects when they go out of scope so you either have to release everything manual…

What is the point of "In process COM"? Is the same as any other library?

I thought COM was meant to communicate between processes?

Any enlightenment is appreciated...

Re: Rust/WinRT Public Preview

#102
post #69

Earlier quoted context omitted.

They _lost_? They have a 1.36 trillion USD Market cap (today). That's more than Apple's 1.29 trillion USD Market cap. It's hilarious how people on hacker news live in this bubble where Microsoft has faded away into irrelevance. And they're also very good. I'm running Windows 10 right now on a dual-monitor, dual NVidia GPU, dual Xeon system and everything "just works."

> dual-monitor, dual NVidia GPU Not exactly thanks to Microsoft.

You can't do it on a Mac (unless you want to run two non-supported graphics cards sharing 4 lanes on a Thunderbold/USB-C connector instead of each having their own x16 PCIe connection)

Re: Rust/WinRT Public Preview

#103

Earlier quoted context omitted.

There have been plenty of attempts to emulate what COM does. All operating systems have some sort of object model and sharing API's, but neither macOS nor Linux have anywhere near the thriving ecosystem and actual cooperation model between applications that Windows has.

Yea, this is so true. It would be amazing if some standard similar to COM could unify the Linux community.

GObject gets us some of the way, but the ABI and bindings for other languages make it a royal pain in the ass to export types from anything but C rather than just consuming them.

Rather unfortunate, because with GIR you could easily have a program written in a mix of Rust, C, Go, C++, Vala, etc. all playing nicely if they were all able to expose to the common object model.

Re: Rust/WinRT Public Preview

#104

Earlier quoted context omitted.

there is a big difference between out of process COM (like Office Automation) and in process COM (like WinRT and UWP or DirectX). Out of process was always a little tricky and not implemented well. DCOM was even worse. In process COM works really well. Edit: I should add that C# isn’t the best language for COM because it doesn’t release objects when they go out of scope so you either have to release everything manual…

What is the point of "In process COM"? Is the same as any other library? I thought COM was meant to communicate between processes? Any enlightenment is appreciated...

COM is primarily used in-process, it exposes an ABI that allows multiple languages to operate on a common object model within the same process. That's why you can import COM controls into a .Net application by referencing the DLL in your project and work with them as if they were native CLR objects - or Python, Ruby, Perl, etc. for that matter.

Re: Rust/WinRT Public Preview

#105
post #73

Earlier quoted context omitted.

I don't see Microsoft doing much EEE on their modern non-cost-centre platform (Azure), though. Amazon is a much clearer example these days, with AWS having "embraced and extended" Postgres into Aurora, Redis into ElastiCache, and many other examples. (I don't know if AWS has ever gone all the way and "extinguished" any of the cores they've built upon, though?)

at its most benign embrace/extend can just mean that your product supports the standards people expect and need, and there's also some differentiating aspect in which it's better than the other options (otherwise why does it exist?) It can be a bit fuzzy defining precisely where that benign sense stops and the negative sense where the "differentiation" brings harmful lockin begins. Then if you have a monopoly positio…

> But actually AFAICT Microsoft rarely (never?) actually succeeded in extinguishing any of the open standards they were infamous for attacking

SMB pretty well extinguished the use of NFS; and Active Directory pretty well extinguished the use of LDAP.

Neither of these were really Microsoft-driven, though. It was almost the reverse: the ecosystem cloned Microsoft's approach into FOSS, and then liked it better, and replaced their own stuff with it without Microsoft's participation. Sort of like how BitKeeper's approach was cloned as git, which then extinguished most other SCMs.

Re: Rust/WinRT Public Preview

#106

Earlier quoted context omitted.

there is a big difference between out of process COM (like Office Automation) and in process COM (like WinRT and UWP or DirectX). Out of process was always a little tricky and not implemented well. DCOM was even worse. In process COM works really well. Edit: I should add that C# isn’t the best language for COM because it doesn’t release objects when they go out of scope so you either have to release everything manual…

What is the point of "In process COM"? Is the same as any other library? I thought COM was meant to communicate between processes? Any enlightenment is appreciated...

COM is Common Object Model. What you mean is OLE. In process COM calls are basically direct DLL calls and therefore very fast.

Re: Rust/WinRT Public Preview

#108
post #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…

I think the most similar thing to WinRT on Linux would be GObject Introspection since the main point appears to be a way to somewhat automatically surface the platform API in multiple languages using language-specific idioms. D-Bus is instead for RPC and events, which I guess COM also gets used for?

Re: Rust/WinRT Public Preview

#109
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 may be the only large software company that doesn't seem susceptible to not-invented-here syndrome.

.NET?

Re: Rust/WinRT Public Preview

#110

Would this be possible for Go too?

It is possible for any language, really. They already have 3 language projections for C++ (C++/WinRT being the newest, by the same person running this Rust projection), C#, VB, and JavaScript. Under the hood they call out to (and potentially expose) COM interfaces which are C. So if your language has C interop, or if it could be added, something like this could be built.

C interop is slow in golang so I don’t think it would be the best language for it. People do it with SDL though
Post reply on HN