|
|
Subscribe / Log in / New account

Overloading

Overloading

Posted Apr 29, 2014 20:53 UTC (Tue) by mathstuf (subscriber, #69389)
In reply to: Overloading by simlo
Parent article: Porting the Go compiler to Go

When is multiplication noncommutative? If you mean quaternions, octanions also are non-associative, so the (a * b * c) must be done left-to-right (which I think may be optimized either way by the standard).


to post comments

Overloading

Posted Apr 29, 2014 21:18 UTC (Tue) by khim (subscriber, #9252) [Link] (2 responses)

Matrix multiplication is most definitely not commutation. Vector multiplication can be commutative or anticommutative (and these are two different operations which immediately put C++ in the more-or-less the same bucket as Go because you can not create new operators there).

The whole story looks like such a tempest in a teapot to me that it's not even funny. What's the #1 general purpose language used by mathematicians and scientists? Right: Fortran. Does it support operator overloading? Yup. So what are we discussing here? IMNSHO it's pointless to discuss taste of oysters with the ones who are regularly consuming them.

Overloading

Posted Apr 29, 2014 22:18 UTC (Tue) by mathstuf (subscriber, #69389) [Link]

They mentioned matrix multiplication and the sentence seemed to indicate that there was some other instance HelloWorld was referring to.

> What's the #1 general purpose language used by mathematicians and scientists? Right: Fortran. Does it support operator overloading? Yup. So what are we discussing here? IMNSHO it's pointless to discuss taste of oysters with the ones who are regularly consuming them.

And they're the only group that cares about matrix multiplication? See game developers, visualization and rendering programmers, etc.. Anyways, I think operator overloading is working from flawed principles (that operators work on concrete types rather than type classes), but since Go lacks generics, that's not even a remote possibility[1].

[1]There's interface{}, but that's only slightly better than C's void* in that you can still type match on it safely.

Overloading

Posted Apr 30, 2014 6:15 UTC (Wed) by torquay (guest, #92428) [Link]

    What's the #1 general purpose language used by mathematicians and scientists? Right: Fortran.

Not these days. It used to be in 1970s and 80s. In the 1990s its popularity among scientists and engineers dropped quite considerably, ceding ground to Matlab, C and C++. These days Fortran is largely considered as a "legacy language", akin to Cobol. Yes, the often used LAPACK and BLAS are still written in Fortran, but that's simply due to momentum. Matlab is in effect a user-friendly wrapper for LAPACK. Similarly, C++ has many good libraries providing wrappers for LAPACK.

The grounds are shifting yet again, with many scientists, quants, etc moving to the R language and Python (using numpy etc). The point is that due to Go's inherent limitations (lack of operator overloading being one of them), it will never be seriously considered as a suitable language by mathematicians, engineers and scientists. While Go was designed by a bunch of well intentioned people, in the end they have proven to be myopic and only concerned with specific use cases.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds