Re:Go 2 Draft Designs
by majewsky on Tuesday August 28, 2018 @05:22PM
(#17863026)
If you need a generic algorithm where the possible types are very finite (e.g. just float32 and float64, or just NxM matrices for N,M=1,...,4) you might be able to `go generate` the concrete implementations from a text template.
[ Parent
| on HN ]
Re:Go 2 Draft Designs
by jacques_chester on Tuesday August 28, 2018 @09:41PM
(#17864638)
Text generation is fragile, error prone, does not play well with other type-based tooling, is difficult to upgrade, adds unnecessary busywork to the programmer's day.
When Java's limited, half-crippled version of generics showed up, sourcecode generation died. Pretty much overnight. Why doesn't anyone do it? Because it's a terrible experience compared to having types.