4 ms·
quaternions?! This is exactly something I need but never would have expected in the base language.
by LanceH 9y ago
quaternions?! This is exactly something I need but never would have expected in the base language.
- pjmlp 9y agoUsually with languages that are feature rich they can be plain library types. With Go, they will keep adding special case after special case.
- geodel 9y agoYou may have point. Though in this case it was 1st april joke.
- pjmlp 9y agoAh I see.
- masklinn 9y ago> Usually with languages that are feature rich they can be plain library types. Eh, in most languages you'd still need language support if you want quaternion literals.
- int_19h 9y agoLiterals are usually not a big issue. You don't get that much in going from "1 + 2i" to "complex(1, 2)" or something like that. It's value type semantics, operator overloading, and implicit conversions that are usually challenging. Go doesn't have any form of customized operator overloading. If something needs to look like a number, it has to be in the base language. Stuff that isn't, is second-class even if it's in the standard library. Ironically, this is the case for big integer / floating-point numbers - you have to write things like x.Add(y, z): https://golang.org/pkg/math/big/ https://golang.org/pkg/math/big/
- vanderZwan 9y agoLook at the date the issue was opened and closed...
- LanceH 9y agoOk, that makes more sense than a quaternion library :(
- jerf 9y agoI'm actually surprised Go even has a complex type in it, honestly. The places where you'd use it and the types of programs you'd use Go for don't strike me as overlapping much.
- jwilk 9y agohttps://github.com/golang/go/issues/19813 https://github.com/golang/go/issues/19813