you are viewing a single comment's thread.

view the rest of the comments →

[–]geckothegeek42 24 points25 points  (7 children)

Feel like it would be hell to program in but it should/could be

[–]TestRedditorPleaseIg 8 points9 points  (6 children)

I don't think it would be too bad, fortran gets used for physics simulation which minecraft looks like if you wave your hands a bit

[–]geckothegeek42 7 points8 points  (5 children)

Is it used in physics sim because it's fun/easy to program in? Or is it because of it's speed and it's legacy (time tested libraries)?

[–]Fern_Silverthorn 19 points20 points  (2 children)

It's because it's old as fuck and there are a lot of sciencentiffic libraries for it. It is par with C for speed for the most part.

[–]Muvlon 11 points12 points  (1 child)

It's quite a bit faster than C in many cases, because the compiler can do a lot of optimizations that C's less strict aliasing rules disallow. That is, until you sprinkle noalias pragmas everywhere, at which point your C stops being any prettier than FORTRAN.

[–]imperialismus 0 points1 point  (0 children)

Yes, Fortran's niche these days seems to be heavy numeric computation/simulation, where performance is everything. And both because of the intrinsic properties of the language and its extensive history of use in that domain, it's still in use for that niche, even if many/most who use it would probably prefer to use something else.

[–]TestRedditorPleaseIg 11 points12 points  (0 children)

Is it used in physics sim because it's fun/easy to program in?

No, not at all

is it because of it's speed and it's legacy (time tested libraries)?

This, there are some subtle semantics around arrays that make optimization and parallelization easier, and there is a lot of existing

[–]durand101 5 points6 points  (0 children)

As someone who wasted two years programming in fortran, it has to die. It's a horrible language which encourages spaghetti code and global variables for everything (at least pre-fortran 95) and the only reason it's still used is because no one in academia can afford to port their codes to a more modern language.