Fortran

I'm learning Fortran, and it seems like a comfy language. People have been telling me that there's typically only one way to do a given thing in Fortran, which leaves little room for doing stuff wrong, and I think I'm starting to see what they mean.

Anyone else here like Fortran?

And btw, ow do I use LAPACK? I don't know much about programming to be honest besides syntax. Before now I've been writing in Python using Spyder, which literally just werks. I didn't need to mess around with SciPy or anything, just install Spyder and "import" everything. So how do I "install" LAPACK? And how do I get the BLAS? Do I just download some files and place them in the right folder, then continue using gfortran to compile?

Hopefully this is a good place to ask. I tried asking in a programming thread in /g/ as well, but the conversation was headed in another direction.
>C++ is really good
>no it is shit
>no it is good
>no

Other urls found in this thread:

physics.oregonstate.edu/~landaur/nacphy/lapack/fortran.html
twitter.com/AnonBabble

idk every time I looked at fortran code in my compilers course shit looked really weird.

but i'm not saying it's bad.

Also C++ isn't shit, kys

C++ is huge and messy. It means you won't know how to use it properly. For smaller tasks that doesn't really matter though.

I'm not saying anything about C++, I'm just saying that /g/ were busy bickering over how shit/not-shit it was, so no one responded.

We use it a lot in chemical engineering, lots of programs use Fortran as a kind of 'scripting' language in its simulations. I like it, you only need to learn a handful of things to completely know the language.

THat said, I dont think id want to write large programs in in since it (at least the vertion im used to) doesnt have a lot of the modern features that makes organizing code easier.

Ive never used fortran as a stand alone programming langiuge, or installed LAPACK, so cant help you.

> I tried asking in a programming thread in /g/
I have never in my life gotten good programming advice from /g/, Veeky Forums, and the amature game dev threads on Veeky Forums and /mlp/ have been a lot more helpful because they actualy help you. /g/ just argues about something irreverent to your question.

>you only need to learn a handful of things to completely know the language.
That's my impression so far as well. I found a short written introductory guide, and I was done with my first reading in an afternoon. Now I just want to find some exercises on which to grind my teeth.

And yeah, I get less and less interest in /g/ each time I go there.

what would make one use fortran instead of, say, C?
I've heard of it, but what I heard was mainly that it was old, yet efficient

I've been told it's wicked fast, because it is written with only that goal in mind, that is to say it even beats C. There are so many stupidly fast and old libraries for doing numerics, written in Fortran and still being used. I think there may be versions of those same libraries in other languages, but still.

That, and it is really simple to learn, write and read.

physics.oregonstate.edu/~landaur/nacphy/lapack/fortran.html

Why would you use an outdated language such as fortran instead of python? Just wondering not trying to hate on fortran but you cannot deny it's a bit old

python is more versatile, but is also really slow compared to languages like fortran

install ATLAS thru the package manager

They wanted to make something that was fast for numerics, and got it right the first time. Lots of libraries have been written through the years which make it worth learning even today, so you might say it remains popular because it is popular.

Also, it is deliberately not very versatile, so that there is only one "canonical" way of writing a given algorithm. This makes the job of the compiler easier, and you can be relatively sure that the compiled program will run as fast as possible.

I'm not an expert myself, but I have seen the difference in speed between Python and Fortran. For assignments in a numerics class I took, Fortran code would run several orders of magnitude faster than my own Python code, which I even thought was cleverly written.

I see thanks, seems like speed and reliability are strong points of fortran

C++ is a hulking monstrosity that needs to be put out of its own misery.

>look mommy, I'm repeating stuff /g/ said! Aren't I good with computers?

goddamnit, I made this thread to escape the C++ discussions.

Thanks guys, will look into these

Tough luck, /g/ is the most autistic board on Veeky Forums and the urge to either defend or shit talk C++ is stronger than they are.

>most autistic board on Veeky Forums
That has to be hyperbole, surely

Fortran is probably the best language for scientific computing imo. I think a lot of people were put off by the antiquated f77 version which had syntax based on punch card inputs, but the latest versions are much more intuitive. The language has been around forever and has a ton of libraries that are optimized for performance. Check out numerical recipes which has all of its code online. The hardest part is often understanding the numerical analysis that goes into solving a problem and the appropriate approach to the given problem. Library functions often have an easy to understand description with explicit input and output parameters.

I don't have experience with LAPACK but you should look for how to compile your program with the LAPACK library for your given system. It shouldn't be too difficult, good luck.

Numerical Recipes is a fantastic tome of a book, I'm going to have to read through it properly this summer.

I have to admit I'm not a strong programmer, so while I appreciate your guidance I don't know how to interpret it.
>compile your program with the LAPACK library for your given system
I am able to compile using gfortran, but I don't know what it would mean to do it along with LAPACK. Essentially, I don't understand the words you are using.