@live questions

Paulo Pinto pjmlp at progtools.org
Thu Nov 26 12:38:26 UTC 2020

On Thursday, 26 November 2020 at 05:24:22 UTC, Gordan wrote:
> On Wednesday, 25 November 2020 at 10:51:12 UTC, Walter Bright 
> wrote:
>> Other languages have done it (see Microsoft's "Managed C++") 
>> but I don't think it caught on because I haven't heard much 
>> about it in years.
> Yes, it was called VC++, there were 2-3 versions to try and 
> jump start it. Eventually it was replaced by a completely 
> native C++ header file using modern C++ with smart pointers 
> instead of a GC to communicate with COM objects.
> The C++ header implementation hasn't seen any major 
> developments but it is still their recommended way of 
> interfacing. By the looks of it they are focusing more on Rust 
> and seem to be cutting out C++ altogether.

You mean C++/CX, which was replaced by C++/WinRT.

C++/CLI, the .NET variant is alive and doing quite well as more 
productive way to interface with native code than doing a bunch 
of P/Invoke declarations all over the place.

As for C++/WinRT, unless we are talking about Windows dev team 
members used to write code with Windows Runtime Library 
previously, the large majority of UWP devs is quite pissed off 
with C++/WinRT, because Windows dev team has thrown it at us 
without any consideration for providing a Visual Studio 
experience comparable to C++/CX. So you are left editing IDL 
files without any kind of editor experience, and every time 
wrappers are generated by cppwinrt compiler, you need to manually 
copy and merge the outcome.

Wait for ISO C++ to reach feature parity with C++/CX in metadata 
and reflection capabilities they say.

COM libraries approach has always been header files generated out 
of COM type libraries (.tlb) or now with the UWP/WinRT related 
improvements, .NET Metadata files (.winmd).

Also to have a good performance in Release/AddRef calls versus 
.NET GC, C++/WinRT makes use of background threads for disposal, 
stack allocation of handles for COM/UWP references and constexpr 
generation of metadata.

More information about the Digitalmars-d mailing list