Better HN
topnewbestaskshowjobs
Log inSign up

ivanpribec

55 karma · joined Dec 21, 2020 (5y ago) · 16 submissions

Submissions

comment 8mo ago · link · parent

Reminds me of spreadsheet-fortran (https://github.com/lwsinclair/spreadsheet-fortran), a project creating a VisiCalc lookalike in FORTRAN 66, which even runs on a PDP-11.

comment 10mo ago · link · parent

*same translation unit as the call site

comment 10mo ago · link · parent

I can see the subtle distinction you make. The flang notes on array composition provide a good introduction to the way array expressions (https://flang.llvm.org/docs/ArrayComposition.html) are treated.

But in practice it looks like the elemental function must be in the same translation unit for vectorization to occur with compilers popular today. Explicit options like !$omp declare simd are a different matter (and have different pitfalls).

4.

FortranCon 2025(events.fortrancon.org ↗)

2 points · by ivanpribec · 1y ago · discuss

comment 2y ago · link · parent

Both. :)

comment 2y ago · link · parent

The "!omp simd" works very well IMO. In general however, the auto-vectorizer tends to do a pretty good job.

comment 2y ago · link · parent

The NumPy part is a misconception. Fortran is used in SciPy however.

comment 2y ago · link · parent

Personally, I like to think of Fortran as the language of large-scale numerical PDE and eigenproblem solvers. Most scientific and engineering problems boil down to one of these two.

comment 2y ago · link · parent

Bjarne Stroustrup on Fortran users [1]:

> Fortran is harder to compete with. It has a dedicated following who [...] care little for programming languages or the finer points of computer science. They simply want to get their work done.

[1] https://ieeexplore.ieee.org/document/4263269

comment 2y ago · link · parent

A few of these things exist already: - http: https://github.com/fortran-lang/http-client - sockets: https://github.com/modern-fortran/tcp-client-server - threads: https://github.com/interkosmos/fortran-unix

comment 2y ago · link · parent

For "broadcasting" an array along a particular axis, you'll need to use the function "spread(source,dim,ncopies)". But mixed array/scalar expressions are indeed supported.

comment 2y ago · link · parent

OpenMP support in Fortran will improve as flang matures. In OpenMP 5.0 "#pragma omp requires unified_shared_memory" was introduced. At LLNL, they are are currently building El Capitan (https://www.datacenterknowledge.com/supercomputers/lawrence-...), a supercomputer using AMD MI300A accelerators which support this concept. LLNL is also one of the OpenMP ARB members (https://www.openmp.org/about/members/).

comment 2y ago · link · parent

They do. Some national HPC centers offer Fortran courses including elements of Fortran 2018 [1,2], including the latest features. (Disclaimer: I work at one.) The Intel Fortran compiler already includes some Fortran 2023 features [3].

[1] https://doku.lrz.de/programming-with-fortran-10746212.html [2] https://doku.lrz.de/prace-course-advanced-fortran-topics-107... [3] https://www.intel.com/content/www/us/en/developer/articles/r...

comment 2y ago · link · parent

Historically, it has been easier for vendors to work in their own walled gardens, and get customers locked in, than it is to collaborate on open standards and APIs.

comment 2y ago · link · parent

For fun, I wrote a CHIP8 interpreter in Fortran recently [1].

Fortran is still heavily used in computational chemistry, computational fluid dynamics, marine engineering, nuclear engineering, reservoir engineering, and numerous other engineering fields. Volcanologists use it to predict ash dispersal [2]. Biomedical companies use it for cardiac electrophysiology. Econometrists use it to do tax research [4]. Plasma physicists use it to design magnetic confinement fusion devices [5]. Astrophysicists use it for relativistic magnetohydrodynamics [6]. NASA uses it for all kinds of fluid dynamics-related purposes [7] (read jet engines and rockets), and so do they at CERFACS [8]. For all I know, some integrated circuit manufacturers probably use it use it [9]. It's also used in ham radio and probably some military agencies [10]. It's used in vehicle crash testing [11]. It's used in combustion simulation software [12], fire dynamics [13], hydrometallurgy (ore leaching) [14]. US Geological Survey uses it for ground-water flow modelling [15]. We could go on and on.

[1] https://news.ycombinator.com/item?id=38920486 [2] https://doi.org/10.1016/j.cageo.2008.08.008 [3] https://www.elem.bio/index.html [4] https://taxsim.nber.org/ [5] https://doi.org/10.1016/j.cpc.2021.107986 [6] https://doi.org/10.3390/fluids9010016 [7] https://fun3d.larc.nasa.gov/ [8] https://www.cerfacs.fr/avbp7x/ [9] https://en.wikipedia.org/wiki/SPICE [10] https://en.wikipedia.org/wiki/Numerical_Electromagnetics_Cod... [11] https://www.openradioss.org/ [12] https://en.wikipedia.org/wiki/CHEMKIN [13] https://en.wikipedia.org/wiki/Fire_Dynamics_Simulator [14] https://youtu.be/-dvG270QttE?si=AO-ky0fGwkIEmXDx [15] https://www.usgs.gov/mission-areas/water-resources/science/m...

16.

Show HN: Fortran Chip-8 Interpreter(github.com ↗)

5 points · by ivanpribec · 2y ago · discuss