News for hackers. Stuff that matters.
Re:Julia 0.5 release by jmde on Monday September 19, 2016 @06:25PM (#12535286)
This could either be brilliant or a total nightmare:

"Support for arrays with indexing starting at values different from 1. The array types are expected to be defined in packages, but now Julia provides an API for writing generic algorithms for arbitrary indexing schemes (#16260)."

Originally I thought total nightmare but now I'm not sure.

Re:Julia 0.5 release by KenoFischer on Monday September 19, 2016 @06:30PM (#12535314)
Many people think this was added for support of 0 offset arrays, but that's only a side effect really. This feature was requested by people who work with rather odd arrays (e.g. diagonal slices through high dimensional data). I have mentioned in previous threads on the subject that julia's 1-indexed arrays don't matter much in practice because the generic APIs hide that fact most of the time. This just adds the last bit of code to make that completely true and adds documentation/cleanup. For those seeking more information, I'd recommend Tim Holy's JuliaCon keynote on the subject: https://www.youtube.com/watch?v=fl0g9tHeghA
Re:Julia 0.5 release by zerofan on Tuesday September 20, 2016 @12:10AM (#12536989)
> I have mentioned in previous threads on the subject that julia's 1-indexed arrays don't matter much in practice because the generic APIs hide that fact most of the time.

My guess is that most people who prefer zero-based feel strongly about it, and most people that like one-based don't care that much. If it really doesn't matter that much, I think Julia should've gone with zero. FFTs, Vandermonde matrices (least squares), polynomials, and pretty much anything where the array subscript relates to the mathematics is cleaner with zero-based arrays.

Re:Julia 0.5 release by sundarurfriend on Tuesday September 20, 2016 @06:56AM (#12538514)
> My guess is that most people who prefer zero-based feel strongly about it, and most people that like one-based don't care that much.

FWIW, as someone in the latter category (liking one-based indexing), I'd say you're partially correct: I'm not emotional attached to 1-based indexing the way some 0-based folks seem to be, but it's a practical nicety and one of the things I'm really glad Julia chose to do. Making 0-based the default would definitely reduce its appeal to me.

Re:Julia 0.5 release by zerofan on Tuesday September 20, 2016 @08:59AM (#12539133)
Call it emotional if you like, but I won't use a language that has an off by one error built into its specfication :-)
Re:Julia 0.5 release by Avshalom on Monday September 19, 2016 @06:37PM (#12535356)
Pascal and Ada have had arbitrary indexing for decades. It's been fine.
Re:Julia 0.5 release by StefanKarpinski on Monday September 19, 2016 @06:54PM (#12535450)
And Fortran, where it works fine. Perl lets you change the array index offset but everyone warns you that your computer will reach out and slap you in the face if you do. As is often the case, the devil is in the details.
Re:Julia 0.5 release by Avshalom on Monday September 19, 2016 @07:00PM (#12535489)
In perl is it APL style where it changes the index for the entire world (until changed again) or is it Fortran/Pascal style where you are expected to declare the lowest/highest index per array?
Re:Julia 0.5 release by PeCaN on Monday September 19, 2016 @07:04PM (#12535513)
APL-style with a global index origin ($[ in Perl, à la ⎕IO in most APLs).
Re:Julia 0.5 release by nimrody on Monday September 19, 2016 @11:44PM (#12536883)
Pascal and Ada don't usually use their arrays as matrices in mathematical expressions. Julia is targeted at people using Matlab.

How do you multiply two matrices that use different indexing? Ignore the indexing differences?

It's also problematic when different libraries use different conventions (0-based vs 1-based). Can you use the output of one such library to feed another?

Re:Julia 0.5 release by yaantc on Tuesday September 20, 2016 @07:57AM (#12538797)
Ada has the notion of attributes applying to types and variables, to access related properties. Among those, there are attributes to get the starting and ending indexes of an array. So it's possible to program completely generic array processing, independent of the underlying choice or range for the array. All this from memory, and it's been a long time...
Re:Julia 0.5 release by ch_123 on Monday September 19, 2016 @07:16PM (#12535574)
Eiffel too IIRC (same family I suppose)
Re:Julia 0.5 release by data_hope on Tuesday September 20, 2016 @10:47AM (#12539909)
Doesn't Fortran feature variable indices for quite a while now?

I think the varying indices are a great feature for porting old code over from other programming languages.