Hacker News new | ask | show | jobs
by outworlder 2960 days ago
I can't think of 2 as written.

But big, successful programs will often do (2).

1 comments

C# has had a dynamic type built in for years now. It's literally a dynamically typed language embedded within the statically typed C#,which grew out of the work on gradual type systems.
dynamic is just based on COM variant type, before .NET even existed.
C#'s dynamic type has nothing to do with COM.
It shows you never had to implement COM interfaces for Visual Basic Variant type via the IDispatch interface.

https://msdn.microsoft.com/en-us/library/windows/desktop/ms2...

The way dynamic is implemented is exactly following the same idea using DynamicObject instead of IDispatch.

https://docs.microsoft.com/en-us/dotnet/api/system.dynamic.d...

And if you actually bother to read MSDN documentation, one of the use cases for dynamic was to simplify COM automation interop.

https://blogs.msdn.microsoft.com/srivatsn/2008/02/04/dynamic...

https://docs.microsoft.com/en-us/dotnet/csharp/language-refe...

That's not why the dynamic type was created, that was just one side benefit. The dynamic type grew out of the IronPython effort which grew into the DLR in order to better support dynamically typed languages on the CLR, by having reusable polymorphic inline caching for efficient dispatch.

COM integration with the CLR has existed since the beginning, which I used quite extensively many years ago, they just took advantage of the DLR to make it easier.

Still given that it was already available as Variant on Visual Basic before .NET was even an idea, it hardly has anything to do with "which grew out of the work on gradual type systems.".