News for hackers. Stuff that matters.
Re:Go+: Go designed for data science by grayclhn on Saturday March 27, 2021 @01:09PM (#26603709)
Long expressions with matrix operations is a pretty standard example. When people talk about operator overloading in data science, they usually mean “standard operations on various arrays of numbers,” which are defined in common libraries or the programming language. Not “I need to define my own ad hoc equalities.”
Re:Go+: Go designed for data science by marcus_holmes on Saturday March 27, 2021 @04:07PM (#26605180)
yeah, I get this. If there are standard definitions of operations that everyone understands, that's fine.

But I always think that maybe we should be using new operators for this, instead of overloading existing ones that have other, different, meanings in different contexts.

Re:Go+: Go designed for data science by grayclhn on Saturday March 27, 2021 @05:28PM (#26605804)
In a data science context, the key operations are math, so overloading makes a lot of sense and is massively helpful in implementing algorithms and equations. I go back and forth on the wisdom of some of the other common uses — filtering, etc. In addition to the problems that have been mentioned, there are often hidden and infrequent but painful performance issues.
Re:Go+: Go designed for data science by marcus_holmes on Saturday March 27, 2021 @06:01PM (#26606011)
I often think that maths could use the same slap around the chops. Less arcane operators and symbols, more explicit function names please!
Re:Go+: Go designed for data science by grayclhn on Saturday March 27, 2021 @06:39PM (#26606245)
I consider it kind of important that the notation for expressions like “A²” doesn’t depend on whether A is an integer, real number, complex number, matrix, random variable, etc., (even if the results do) or what the specific domain is, but if you feel like it’s important to embed all of that context in the exponent operator... give it a try :)

(And whether “2” is integer, real, rational, complex, etc)

Re:Go+: Go designed for data science by marcus_holmes on Saturday March 27, 2021 @09:00PM (#26607123)
Yeah, but operator overloading doesn't say any of that. You have no idea what the "^" operator does, depending on the operands
Re:Go+: Go designed for data science by FridgeSeal on Saturday March 27, 2021 @08:22PM (#26606928)
Ehhh, it would seem that way, but the compactness of the syntax functions to get out of the way and help you understand the overall structure. Having longer function names ends up getting in your way more often than not in my experience.