5 ms·
but there is a lot to love in C# and .NET that have been there for a long time. Real generics. Real generics, as in generic programming? As in, this: http://ww
by gngeal 13y ago
but there is a lot to love in C# and .NET that have been there for a long time. Real generics.
Real generics, as in generic programming? As in, this: http://www.haskell.org/haskellwiki/Research_papers/Generics http://www.haskell.org/haskellwiki/Research_papers/Generics ? The last time I saw C# (2.0?), it only had simple parametric polymorphism.
- profquail 13y agoTo be fair, very few languages have type systems as powerful as Haskell's ;) You're right though -- the .NET CLR type system (specified in ECMA-335) basically supports only a simple form of parametric polymorphism with subtyping constraints, along with co- and contra-variance. The idea is to allow some limited forms of generic programming while keeping the type system simple enough that it doesn't impose significant overhead during JIT compilation. Another advantage, is that it allows the JIT compiler to generate type-specialized code, which offers a significant performance advantage for unboxed value types. The F# type system is a little more powerful, though anything it offers beyond what the CLR officially supports gets erased when the program is compiled (e.g., unit-of-measure types). See: http://msdn.microsoft.com/en-us/library/vstudio/dd548046.aspx http://msdn.microsoft.com/en-us/library/vstudio/dd548046.asp... One interesting thing I've realized recently is that F# could potentially support GADTs in the future, just like Haskell and OCaml. The hard part -- the GADT type inference -- would take place at compile time, so there shouldn't be any problems encoding the result (the inferred type) in the CLR's type system. If you're interested in type systems (and as a Haskeller, I imagine you are), there's also F* -- it's a dependently-typed variant of F# which is being used for verification research at MSR: https://research.microsoft.com/en-us/projects/fstar/ https://research.microsoft.com/en-us/projects/fstar/
- gngeal 13y agoIf you're interested in type systems (and as a Haskeller, I imagine you are) Bah! Interested, definitely yes, but I share Alan Kay's point of view that "I like type systems but I don't know any that doesn't suck", so in this particular area, I'm a bit of a Luddite. (I'm much more of a lisper in heart.)