help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Octave and cargo cult programmingHello


From: Judd Storrs
Subject: Re: Octave and cargo cult programmingHello
Date: Wed, 19 Sep 2012 12:48:42 -0400

On Wed, Sep 19, 2012 at 11:47 AM, Sergei Steshenko <address@hidden> wrote:
Sergei is rather expressing frustration with Octave's development going in _strategically_ wrong direction; broadcasting and its stupid (without line number) warning messages being a clear indication of that direction.

From a purely *strategic* POV, broadcasting is the right decision given the vast performance difference between vector and loop operations in octave (new JIT branch notwithstanding). IMHO if you want to persuade anyone that broadcasting is a strategic blunder you're going to have to be *specific*. Lacking specificity, it's impossible to discern this from a run-of-the-mill concern troll.

In my code, using bsxfun allowed me achieve massive performance gains in my workload at the price of readability. But now with broadcasting I get the performance gains without losing readability--in fact it's even more readable than the loop form! Further, this decision wasn't made lightly and it was discussed to death. Ultimately, even with broadcasting enabled, Octave is fully capable of running valid Matlab code. We've been waiting for someone to show *actual* harm from the change.

Further, broadcasting is a well-established and ancient vector-language concept used other high-performance high-level languages like APL and IDL*. IMHO Matlab has been on the wrong side of broadcasting for eons and it's inexcusable that they didn't include it in their language design from the get go. It's probably related to the fact that Matlab started as a linear system solver and didn't get around to dealing with image processing problems or statistics until they had inertia and their communities didn't demand it. IDL on the other hand developed under heavy use by image processing folks which is why you see IDL heavily used historically in the astronomy, remote sensing, and medical imaging communities. 


--judd

*In IDL it was slightly different and called "recycling". IDL's approach differs in a few subtle details that aren't worth emulating. Comparatively IDL's implementation can induce some excessive operations (unneeded flipping, transposing, reshaping, permutations). IDL's model does allow mismatched things to be combined (i.e. something like ones(3,5) + ones(2,1) works), which is very, very occasionally legitimately useful but overwhelmingly usually a bug. In any case, the IDL folks have embraced the numpy model which is what octave implemented IIRC. So octave has incorporated the best-of-breed model.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]