Hacker News new | ask | show | jobs
by yangl1996 847 days ago
Your 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.
1 comments

Operator overloading is about syntax and type safety. Brainfuck is Turing complete.
I agree it is about syntax. But how is it about type safety?
You 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?