Hacker News new | past | comments | ask | show | jobs | submit login

Works fine in Fortran, R, and Julia. People do pretty complex stuff in these languages and two of them are compiled.



It's not an insurmountable barrier, for sure. Just something that makes it very annoying in a lot of code. While not really making it easier anywhere.


Weird then that scientific computing languages prefer 1 based arrays. Maybe can show how it's very annoying in lots of Fortran or Julia code?


> Weird then that scientific computing languages prefer 1 based arrays.

Not really when the code is routinely transcribed from papers, and the ages-old convention throughout mathematics is one-based indexing, both bounds of the interval included. (With the notable exception of Euler’s beta and gamma functions.) Of course, in a paper intended for a human reader the occasional off-by-one error is much less dire than in code, so the author is freer to use a more error-prone convention.

I once had to translate from a one-based paper to zero-based Python code (with the added bonus of different discrete Fourier conventions *shudder*), and it’s remarkably annoying even if the resulting code is more obviously correct than the paper’s original formulas.


Python is as much a "scientific computing language" as anything, and it's zero-based.


Not really, the core language is general purpose. It's Python's scientific libraries and ecosystem which became popular.


You haven’t shown how it’s “very annoying” in R, Fortran, and Julia.


I've been working on a PR to document and make atomic pointer interface public in Julia. It's really not that hard to handle it under the hood so that array indexing and translates to LLVM and C zero indexing.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: