4 ms·
The world seems like it's moving to ML. That needs matrices, complex numbers, autodiff, different fixed/floating point types. All four of these need operator ov
by ogogmad 3y ago
The world seems like it's moving to ML. That needs matrices, complex numbers, autodiff, different fixed/floating point types. All four of these need operator overloading.
- yangl1996 3y agoYour last sentence seems fishy to me. Are you suggesting that support for C++ like operator overloading is a necessary condition for, say, autodiff? I thought Go is a Turing complete language.
- ogogmad 3y agoOperator overloading is about syntax and type safety. Brainfuck is Turing complete.
- campbel 3y agoI agree it is about syntax. But how is it about type safety?
- ogogmad 3y agoYou might want the same piece of code to work correctly under different numerical types. Answer: Op overloading + generics. E.g. Dual numbers for autodiff; 2x2 matrices of quaternions for texture mapping; matrices of differing floating point types for machine learning. Why should I implement the same matrix operations a million times over?
- campbel 3y agoCould you explain _why_ they need overloads and functions don't work? That does not immediately follow for me.
- ogogmad 3y agoAutodiff requires interpreting the same piece of code using "dual numbers" that would normally expect "real numbers". This needs operator overloading combined with generics.