6 ms·
I can't think of 2 as written. But big, successful programs will often do (2).
by outworlder 9y ago
I can't think of 2 as written.
But big, successful programs will often do (2).
- naasking 9y agoC# 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.
- pjmlp 9y agodynamic is just based on COM variant type, before .NET even existed.
- naasking 9y agoC#'s dynamic type has nothing to do with COM.
- pjmlp 9y agoIt 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/ms221608(v=vs.85).aspx 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.dynamicobject?view=netframework-4.7.2 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-dispatch-in-c/ https://blogs.msdn.microsoft.com/srivatsn/2008/02/04/dynamic... https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/dynamic https://docs.microsoft.com/en-us/dotnet/csharp/language-refe...
- naasking 9y agoThat'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.
- pjmlp 9y agoStill 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.".
- naasking 9y agoVisual basic is hardly the first language with a dynamic type, and the DLR is clearly descended from Self, Smalltalk and other dynamically typed languages and started with Iron Python: https://blogs.msdn.microsoft.com/hugunin/2007/04/30/a-dynamic-language-runtime-dlr/ https://blogs.msdn.microsoft.com/hugunin/2007/04/30/a-dynami... VB's variants and COM were not a consideration when conceiving of or designing the DLR, merely a convenient application. Furthermore, integrating a dynamic type into C#'s type system absolutely built in the work on gradual typing. See their published work: https://www.researchgate.net/publication/221496299_Adding_Dynamic_Types_to_C https://www.researchgate.net/publication/221496299_Adding_Dy...
- pjmlp 9y agoThanks for the paper, that changes my point of view.