News for hackers. Stuff that matters.
Re:Fortran Standard Library by azhenley on Wednesday May 13, 2020 @03:39PM (#23170899)
If Fortran has been around for this long without a standard library, then what do people use now? Does each compiler have its own? Are they very different? Is there much of a need for this since it hasn't existed for 60+ years?
Re:Fortran Standard Library by colechristensen on Wednesday May 13, 2020 @04:07PM (#23171228)
Much is built in to the language spec, which then becomes a definition debate about what constitutes a standard library, not a useful debate in this context.

There are many popular "standard" libraries that people use like BLAS and LAPACK and domain specific code for say, mesh generation.

Also, most Fortran code is used for numerical calculation, most of what you need for that is already there.

As for compilers, there are still regularly released Fortran standards. The first proposal for what became Fortran was in 1953! The first compilers came a few years later. This was still on punch cards, and details of the syntax still remain from that era. Most of the standards are real standards and come with a date, Fortran 66, Fortran 90, etc. There have also been many branded releases tied to compilers. There are definitely differences in compilers on the edges, and the results you get can differ from one to another. But mostly they are the same with some compilers adding features specific to themselves.

Is there a need for this? Well there is some very commonly done linear algebra which you either have to write yourself or pick out a library, so it does make some sense to have these things standardized and included which would ease some burden.

Here's a reference to built in functions for a specific compiler:

http://docs.nscl.msu.edu/ifc/intelfor_lib.pdf

Re:Fortran Standard Library by leephillips on Wednesday May 13, 2020 @05:16PM (#23171925)
Fortran is so old that at first it was used without an operating system; in a sense the Fortran compiler was the operating system.
Re:Fortran Standard Library by colechristensen on Thursday May 14, 2020 @06:17PM (#23186251)
Moreso it was proposed as a language abstracted away from programming computers in assembly on punchcards.
Re:Fortran Standard Library by AlexeyBrin on Wednesday May 13, 2020 @03:47PM (#23170989)
> If Fortran has been around for this long without a standard library, then what do people use now?

The actual language, for example most of the functionality that in C is considered to be in the standard library (like I/O operations, mathematical functions) is implemented in the language in Fortran's case.

If the language is not enough for your particular case, you can use third party library like BLAS, LAPACK ...

Re:Fortran Standard Library by walshemj on Wednesday May 13, 2020 @03:56PM (#23171084)
Back when I worked with Fortran we tended to buy our library's from NAG https://www.nag.co.uk/content/nag-library or Gino F for graphics
Re:Fortran Standard Library by overheadnoise on Thursday May 14, 2020 @03:02AM (#23176332)
In my experience as a researcher in computational numerics, the “standard library” is going to be defined by the in-house code that I use. That code is going to use other scientific libraries like for example PETSc, Atlas/blas/mkl, MPI in the background, but the typically researcher isn’t going to be exposed to that because their focus is on setting up the equation Ax = b and writing the algorithm to solve it for x.
Re:Fortran Standard Library by sampo on Wednesday May 13, 2020 @03:53PM (#23171042)
> then what do people use now?

Language has basic string type (character array, really) and basic file access. People would use NetCDF or HDF libraries for reading and writing big numeric datasets. Algorithms, people would write their own when needed. For linear algebra, BLAS, LAPACK and (sometimes Intel MKL) is de facto standard, it's just not called a standard library.

Re:Fortran Standard Library by fortran-guy on Wednesday May 13, 2020 @04:24PM (#23171405)
I also tend to use `iso_c_binding` a fair amount these days if I need something in `stdlib`.
Re:Fortran Standard Library by gnufx on Wednesday May 13, 2020 @06:10PM (#23172408)
It's probably worth pointing out that LAPACK/BLAS is a strictly Fortran77 interface, which isn't ideal. Unfortunately there's no de facto standard modern interface available.
Re:Fortran Standard Library by atrettel on Wednesday May 13, 2020 @05:03PM (#23171804)
Fortran has some aspects of a standard library already, though compared to other languages the shelves are rather bare, let's say. It wasn't until Fortran 2003 that there was a standard way to get command line arguments. Before then different compilers had different ways to do that.

Most users of Fortran are only looking to crunch numbers. That's their application, and for that application Fortran already comes with everything you need, including a large standard library of mathematical functions and operations. I would argue that many users do not have much of a need for anything beyond multidimensional arrays, to be honest. I only know two people who have implemented linked lists in Fortran, for example. That said, it would be nice if Fortran had a good standard library. I would appreciate if Fortran had assertions, for example.