3 ms·
I recently selected Fortran for a greenfield project. The reasons were primarily (1) speed, (2) clean mathematical syntax, especially for elemental multi-dimens
by wycy 7y ago
I recently selected Fortran for a greenfield project. The reasons were primarily (1) speed, (2) clean mathematical syntax, especially for elemental multi-dimensional array math, (3) clean array slicing syntax, and (4) arbitrary array indices[0] result in cleaner code for my use cases.
People normally think of Fortran as being inscrutable spaghetti code, but for me using Fortran results in the cleanest, fastest code.
[0] Fortran arrays are 1-indexed by default, but can technically use any integer, including 0, or negative numbers. It's trivial to have, say, an array indexed from -7 to +7:
real :: array(-7:7)
- SiempreViernes 7y agoArbitrary indexing is really the one true way! It makes working with subsets of arrays simple, I wish I could use it in more languages.
- eigenspace 7y agoThis is something that's really nicely supported in Julia: https://github.com/JuliaArrays/OffsetArrays.jl https://github.com/JuliaArrays/OffsetArrays.jl
- pjmlp 7y agoMost Algol derived languages (Wirth et al) follow that path and Basics.