This conversation is reminding me of a post from John D Cook a couple years ago (www.johndcook.com/blog/2012/04/02/why-scipy/) where he said he would "rather do math in a general-purpose language than try to do general-purpose programming in a math language." He has a point, for example interfacing between Mathematica or AMPL and the outside world can be painful at times, but on the other hand I think he underestimates the importance of paying detailed attention to math as part of language design. Trying to do math in a non-math language is definitely possible, but I always end up with the feeling that I'm using the wrong tool for the job.
In this respect Julia has done a wonderful job of being careful about the math without making other tasks substantially harder. Having to disambiguate between operations that have different meanings but similar notation is a good thing. And the flexibility of the Julia system is such that you can make dramatic changes to major functionality that would be difficult or impossible to do in Python, Ruby, etc - but at the obvious cost that code written under your heavily-customized version of Julia won't work the same for everyone else. On Sunday, April 13, 2014 4:22:42 PM UTC-7, Stefan Karpinski wrote: > > Multiplication is not generally invertible. This is true of real numbers > at zero and true of floating-point numbers at many non-zero values. For > vectors and matrices, multiplication is highly non-invertible. Given this > feature of reality, I'm not sure what else we can do. > > > On Sun, Apr 13, 2014 at 7:05 PM, <[email protected] <javascript:>>wrote: > >> Sure. This was just a side note. I would expect that a "notation" A*B/B >> == A to be always true (except for division by zero of course), since >> division the inverse process of multiplication, like for scalar values >> (a*b/b == a or A.*B./B .== A). >> >> >> Am Montag, 14. April 2014 00:38:57 UTC+2 schrieb andrew cooke: >> >>> >>> >>> On Sunday, 13 April 2014 19:18:31 UTC-3, [email protected] wrote: >>>> >>>> (Also note that division does not look like the inverse operation of >>>> multiplication, since e.g. A=[1 2 3]; B=[1, 2, 4]; A*B/B == A returns >>>> false.) >>>> >>> >>> what would you expect to happen here? you're taking a scalar product >>> and asking "this was one of the vectors; what is the other?". that's not >>> well defined. you've lost information. >>> >>> on the other hand: >>> >>> julia> A = [1 2;3 4] >>> 2x2 Array{Int64,2}: >>> 1 2 >>> 3 4 >>> >>> julia> B = [2 3;4 5] >>> 2x2 Array{Int64,2}: >>> 2 3 >>> 4 5 >>> >>> julia> A*B/B >>> 2x2 Array{Float64,2}: >>> 1.0 2.0 >>> 3.0 4.0 >>> >>> andrew >>> >>> >
