3 ms·
Hm. Which of these does C# use? Which does Haskell use?
by SideburnsOfDoom 13y ago
Hm. Which of these does C# use? Which does Haskell use?
- pjmlp 13y agoRegarding C# it depends on which compiler you talk about. Microsoft's current JIT/NGEN, generate a single version for reference types and a separate version for each value type. So a mix of Java/C++ approaches. Not sure what the new JIT/NGEN compilers, RyuJIT will use. I also don't know what approaches are taken by Mono, Bartok and IL2CPU, but they might be similar.
- SideburnsOfDoom 13y agoYep, now I can see why this is trilema is "incomplete at best" - c# and other use what can be described as a mixture of these three approaches. I was going to say that the c# compiler is fast enough despite this, but then I remembered that one of go's selling points is that the go compiler is blindingly fast compared to languages such as c#. Perhaps maintaining that performance with generics is a real issue.
- pjmlp 13y agoAlthough any language with modules is fast enough, compared with C and C++. Many old timers like myself can remember the blazing fast compile times of Modula-2 and Turbo Pascal compilers in MS-DOS systems. Go compilers also lack a strong optimizer, which is tends to slow down compilation.
- dbattaglia 13y agoI believe C# does it at runtime for reference types, and compile time for value types, so that you don't eat the cost of boxing at runtime. It doesn't make sense to make separate compile time generic types for reference types in C# since the type is basically constrained to using system.object members anyway (unless you add type constraints to the generic type class definition).
- thirsteh 13y agoHaskell: A mix of 2 and 3.