3 ms·
> what should really be syntactic sugar They probably use run time reflections, not a compile time syntactic sugar a.k.a. generics. As Go doesn't have those, s
by zzzcpan 10y ago
> what should really be syntactic sugar
They probably use run time reflections, not a compile time syntactic sugar a.k.a. generics. As Go doesn't have those, so anything like that would require a compiler hack and nobody likes hacks.
- DougBTX 10y agoSyntax sugar is extra syntax to make an existing feature easier to use, syntax sugar has no runtime impact. Generics are not syntax sugar, they add functionality such as stricter compile-time type checking and improved run-time performance (e.g., C# can use unboxed primatives in generics)