4 ms·
Works fine in Fortran, R, and Julia. People do pretty complex stuff in these languages and two of them are compiled.
by orhmeh09 3y ago
Works fine in Fortran, R, and Julia. People do pretty complex stuff in these languages and two of them are compiled.
- cyberax 3y agoIt'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.
- NeuroCoder 3y agoI'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.
- goatlover 3y agoWeird then that scientific computing languages prefer 1 based arrays. Maybe can show how it's very annoying in lots of Fortran or Julia code?
- cyberax 3y agoPython is as much a "scientific computing language" as anything, and it's zero-based.
- mananaysiempre 3y ago> 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.