3 ms·
> 2) What makes Fortran so much 'faster' at computation than C? I think it's more like this: As long as the numerics is vectors, matrices and multidimensional
by sampo 10y ago
> 2) What makes Fortran so much 'faster' at computation than C?
I think it's more like this: As long as the numerics is vectors, matrices and multidimensional arrays (no complex graph or tree data structures implemented with pointers, no string manipulation, no bit-level fiddling), a scientist or engineer who spent less than a week learning Fortran, can write code, almost in a first pass, with nice array notation, that is close to as performant as a relatively seasoned C-expert could write.
- vegabook 10y agoWow. This should be the canonical answer for all Why Fortran performance questions. Never thought about this effectiveness/experience advantage in Fortran's favour.
- gpderetta 10y agoNice. Is there an introduction, available online, to Fortran support for vector/matrix operation?
- idm 10y agoIs it true that pointers are completely non-existent in Fortran? This may be related to your point about data structures. I've heard there is no null dereferencing and pointer nonsense - all without the need for a garbage collector - which ultimately leads to Fortran's great reputation for speed.
- sampo 10y agoFortran has pointers since Fortran 90. But you don't always need to resort to pointers like in C, as Fortran also has allocatable arrays. You can still follow a null pointer, though, if you don't test for it first.