Re:Why we created Julia - new language for fresh approach to...
by coffeeaddicted on Saturday February 18, 2012 @07:34AM
(#3606478)
C as desert island programming language but making all indexing 1-based: "the first element of any integer-indexed object is found at index 1, not index 0, and the last element is found at index n rather than n-1, when the string has a length of n." Also begin end blocks - maybe there was a pascal ninja hidden in the syntax committee room?
[ Parent
| on HN ]
Re:Why we created Julia - new language for fresh approach to...
by jfager on Saturday February 18, 2012 @07:45AM
(#3606490)
Matlab, Octave, Mathematica, and other mathematical programming environments use 1-based indexing, it's a well-established norm for the domain.
Re:Why we created Julia - new language for fresh approach to...
by Loic on Saturday February 18, 2012 @07:54AM
(#3606498)
Fortran too and in HPC we all code in Fortran a lot. Look at the loop construct:
for i = 1:t
in Fortran: DO I=1,T
The ability to load both C and Fortran dynamic libraries is also really really nice.
Re:Why we created Julia - new language for fresh approach to...
by ced on Saturday February 18, 2012 @10:41AM
(#3606779)
Does 1-based indexing have any advantage, beyond familiarity to scientists?
Re:Why we created Julia - new language for fresh approach to...
by cscheid on Saturday February 18, 2012 @02:38PM
(#3607501)
Dijkstra to the rescue: http://www.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EW...
Re:Why we created Julia - new language for fresh approach to...
by jballanc on Saturday February 18, 2012 @12:44PM
(#3607115)
With 1-based indexing, length == last index.
Does 0-based indexing have any advantage, beyond ability to do pointer arithmetic with indexes?
Re:Why we created Julia - new language for fresh approach to...
by scott_s on Saturday February 18, 2012 @10:55PM
(#3608607)
In 0-based indexing, n % length is a value inside the range.