NHacker Next
  • new
  • past
  • show
  • ask
  • show
  • jobs
  • submit
▲Adding Fortran Support to LLDB (GSoC 2026) (blog.llvm.org)
kergonath 3 days ago [-]
Good. The current state is a start, but I look forward to proper support.
CyLith 3 days ago [-]
I'm a computational physicist. Why can't we let this poor old language rest in peace already?
shakna 3 days ago [-]
Fortran isn't some extinct language that hasn't changed. The latest standard is only three years old.

We're not talking a language trapped on obsolete hardware. We're talking something that is still in regular use for any numeric tower, because that is what it is good at.

If you touch floating point, ever, there is a good chance the library used for processing it is a maintained, probably fairly modern, Fortran codebase.

jordand 3 days ago [-]
The oil and gas industry still runs on Fortran code written many decades ago. The mathematicians and physicists got things right way back then in Fortran, no need to rewrite it.
eesmith 3 days ago [-]
Every time I've heard about a present-day Fortran code base it's because 1) Fortran is really good at those sorts of problems, and 2) lock-in because it's too hard to rewrite to another language, with little career benefit when you could be adding new features.
pjmlp 3 days ago [-]
It applies to all programming languages.

The whole "I rewrote X in Y" is mostly about career building, gathering Y portfolio, to jump ecosystems.

Now it doesn't matter any longer, it is one natural language paragraph away, what the output language should be.

eesmith 2 days ago [-]
My experience is that usually it's only 2), for example in large code bases written in MUMPS.

With Fortran it's 1) and 2).

As I understand it, Fortran outperforms other languages for problems like matrix math, especially if you care about issues like portability and memory use.

Not only is Fortran designed for those problems, but the there's been a lot of thought, time, effort, and money used to make the generated code go fast.

adrian_b 2 days ago [-]
Yes, in a language like C++, which has been frequently used to substitute Fortran, the native support for arrays is very bad.

You can eventually obtain the same performance in C++ like in Fortran, by defining your custom array types, with a complete set of operators and functions for them, possibly using inline assembly or SIMD intrinsics for implementing trickier operations. The same may be true for other programming languages that are extensible enough.

But just replacing Fortran with another currently popular programming language is not sufficient, without some extensive support libraries.

kergonath 3 days ago [-]
I’m a computational Physicist. Sometimes, it’s the right tool for the job.
adrian_b 2 days ago [-]
None of the programming languages that are popular today is a good replacement for Fortran, because by default they have very poor support for arrays and for many features of the floating-point computations.

The languages that are extensible, like C++, allow the definition of custom data types and of operators for them, with which the defects from the language specification can be compensated.

But that means that it is not enough to choose a programming language to replace Fortran, but also a set of libraries that would provide facilities at least as good as those provided by default in Fortran.

Such libraries introduce additional dependencies, so the choice is not simple.

Julia is one of the very few programming languages that has been intended for the same domain of applications as Fortran, but Julia has made some controversial design choices and it is doubtful that there are many cases where substituting Fortran with Julia would be a definite improvement in comparison with using the latest Fortran standard.

pjmlp 3 days ago [-]
Because modern Fortran has all the goodies as other languages, first class support for CUDA, and a performance Python will never achieve, all coupled with 70 years of production code.

Also lets not forget that the beloved C is only about 10 years younger.

adrian_b 2 days ago [-]
C is actually 20 years younger.

The preliminary Fortran specification was written in 1954, while the first version of C is from 1974.

The first Fortran implementation is from 1956, but that was not yet a complete high-level programming language, because any complicated functions and subroutines had to be written in assembly language.

In 1958, "Fortran II" added the features required to write any functions and subroutines also in Fortran, so that can be considered the first complete implementation.

Even when considering the first complete implementation, not the first written specification, C would be 16 years younger.

Even if modern Fortran compilers can still compile old Fortran programs, when writing a new Fortran program that would resemble very little with the original Fortran.

throw0101d 18 hours ago [-]
> The preliminary Fortran specification was written in 1954, while the first version of C is from 1974.

Early history:

    1951 – Regional Assembly Language
    1952 – Autocode
    1954 – IPL (forerunner to LISP)
    1955 – FLOW-MATIC (led to COBOL)
    1957 – FORTRAN (first compiler)
    1957 – COMTRAN (precursor to COBOL)
    1958 – LISP
    1958 – ALGOL 58
    1959 – FACT (forerunner to COBOL)
    1959 – RPG
    1960 – COBOL
    […]
* https://en.wikipedia.org/wiki/History_of_programming_languag...

FORTRAN, LISP, and COBOL are probably the big three 'legacy' languages still being used. BASIC was in 1964.

pjmlp 1 days ago [-]
Just like C23 has very little resemblance to K&R C.

In fact, it is so far back, that the standard dropped support for the syntax, and changed semantics of the empty parameter list.

After 49 years, to keep your 1974 date, not the youngest reaching half century of age.

Also I mentioned about, not exact time period.

ajasmin 3 days ago [-]
And now proper debugger support it would seem...
pjmlp 3 days ago [-]
That has been available for decades as well, this is only about lldb.
cozzyd 3 days ago [-]
gdb works with fortran, no?
wolvesechoes 2 days ago [-]
GDB and Visual Studio debugger were supported.
ddahlen 3 days ago [-]
I feel this, my field (orbital dynamics) has a lot of heritage fortran that at this point I think will never go away. Much of it has a proven history, but there are large swaths of it that the original authors have long since died and no one knows the innards anymore.

I know, if it aint broke... but it feels like something has been lost if we are using code that no one alive knows what it is doing. I suppose that is the AI future.

3 days ago [-]
sitzkrieg 2 days ago [-]
intels fortran compiler can often beat c. there is also absolutely nothing wrong w modern fortran

had to maintain simulations which hot loop was written in fortran. i learned the hard way why they are in fortran..

Routine8502 3 days ago [-]
Fortran is a beautiful language for scientific computation. The only problem is a) dogshit older code and b) the lack of ergonomic high level abstractions. The first is excusable since Fortran predates logical IF statements, and the latter is trivial with python, FFI and an LLM.
shakna 3 days ago [-]
Typed Unions and Visitors give you sum types and the like.

What kind of high level abstraction do you feel is too unergonomic to use?

az09mugen 2 days ago [-]
One thing that could be nice is having an ergonomic language that transpiles to Fortran.
pjmlp 3 days ago [-]
B has been solved for a while, we are on Fortran 2023 nowadays.

You get as much ergonomics as a language like Zig, that gets praises all over the place.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact
Rendered at 20:57:20 GMT+0000 (Coordinated Universal Time) with Vercel.