News for hackers. Stuff that matters.
Re:How I Wrote a Modern C++ Library in Rust by ChrisSD on Monday December 03, 2018 @09:50AM (#18589155)
Reminds me of COM.
Re:How I Wrote a Modern C++ Library in Rust by Koshkin on Monday December 03, 2018 @10:31AM (#18589475)
Re:How I Wrote a Modern C++ Library in Rust by bluGill on Monday December 03, 2018 @09:55AM (#18589210)
Maybe, but COM's reputation is it is too complex. From what I can tell the reputation is well deserved.
Re:How I Wrote a Modern C++ Library in Rust by Const-me on Monday December 03, 2018 @02:21PM (#18591989)
It's too many things at once. The ABI is excellent and is used all the time, see DirectX, MediaFoundation, .NET, UWP, etc, they all use good parts of COM.

Scripting support (IDispatch, WSH) is OK despite a bit outdated.

Registration infrastructure (HKCR), GUI widgets (ActiveX), threading model (these apartments) and inheritance of implementation (aggregation) ain't good, way overengineered.

Compound document format (structured storage), RPC both local and networked, are just horrible.

Re:How I Wrote a Modern C++ Library in Rust by pjc50 on Monday December 03, 2018 @10:26AM (#18589441)
Much of COM's horror comes from being an OO interop system designed to work in non-OO C. All sorts of manual reference counting. If you use COM objects in C# it's much less horrifying, although there's a certain amount of "body horror" involved in firing up one whole windows application inside another one. You can run IE in a cell of an Excel spreadsheet, but that doesn't make it a good idea.
Re:How I Wrote a Modern C++ Library in Rust by reitanqild on Monday December 03, 2018 @11:43AM (#18590157)
> You can run IE in a cell of an Excel spreadsheet, but that doesn't make it a good idea.

Embedding a MS Works worksheet in a MS Works document however was sometimes a good idea in '95.

I've yet to see a better implementation than that and I find it really disappointing that the state of the art has moved backwards in this area (in addition to UX and performance relative to hardware specs).

Re:How I Wrote a Modern C++ Library in Rust by maxxxxx on Monday December 03, 2018 @01:08PM (#18591181)
I agree. Apple also had an effort called "OpenDoc" which they gave up on.
Re:How I Wrote a Modern C++ Library in Rust by maxxxxx on Monday December 03, 2018 @10:49AM (#18589611)
Working with VB made COM really nice. Both for writing COM servers and consuming them. C# is actually a step back because it doesn't do the reference counting right and instead relies on GC to free objects.
Re:How I Wrote a Modern C++ Library in Rust by int_19h on Monday December 03, 2018 @06:11PM (#18594115)
Core COM is basically predefined vtable layout and object reference comparison rules combined with IUnknown for lifetime and type queries. It can be verbose, but it's very simple.

Stuff like OLE Automation is very much not simple, but it's not a requisite part of it all.

Re:How I Wrote a Modern C++ Library in Rust by pjmlp on Monday December 03, 2018 @01:40PM (#18591560)
COM works pretty well in Delphi, .NET, C++ Builder, MFC, C++/CX and now C++/WinRT.

The problems and boilerplate usually affect those that insist in using the C level APIs.