Re:Go as an alternative to Node.js for very fast servers
by pcwalton on Wednesday August 14, 2013 @09:50AM
(#6211446)
> I'm also uncertain whether scalars (e.g. integral types) can be used through interface{}.
They can (and there are optimizations to avoid heap allocation in some cases when you do use them), but you still have to write downcasts everywhere.
Yes.
> If so it seems it would be possible to write highly functional code given the flexibility of interface{}
Not really, you'd have to add type assertions everywhere as go has neither generic functions nor user-defined generic types (only a handful of special-status types get to have type parameters, IIRC they're chans, arrays, slices and maps). That makes higher-order operations extremely cumbersome.
I'm also uncertain whether scalars (e.g. integral types) can be used through interface{}.