Re:Julia: Performance Tips
by leephillips on Friday February 27, 2026 @09:14AM
(#47180680)
“All other languages” such as Fortran, etc.?
Why are you recalculating indices?
I don’t think that any Julia program I’ve ever written would need to change if Julia adopted 0-based tomorrow. You don’t typically write C-style loops in Julia; you use array functions and operators, and if you need to iterate you write `for i in array ...`.
“ergonomics matter”
Definitely. Ergonomics is the main reason I enjoy Julia. Performance is a bonus.
We had this discussion on here recently. It's really puzzling to me. Julia has the most ergonomic array interface I have worked with by far. How did 1 based indexing ever trip you up?
That's just you being unable to let go of your biases? In languages with pointers giving primacy to offsets makes sense. In every other context aligning with natural language and math (first, second, 1..n inclusive) is perfectly logical.
Re:Julia: Performance Tips
by wolvesechoes on Friday February 27, 2026 @12:53PM
(#47183316)
And 1-based indices are much more natural and ergonomic to everyone that doesn't pretend to be a machine. When I think about n-th element of a vector, its offset is not the first thing I am interested in.
Some people may not realize it, but when it comes to programming languages, ergonomics matter—a lot.