Pure Fortran is powerful for the numerical and array-oriented computation that’s ubiquitous in physical sciences and engineering. However, quite a few things aren’t possible in Fortran alone; fortunately, they can be done in a low-level systems programming language such as C. They include reading and writing data to hardware devices, drawing graphics on the screen in real time, and sending data over the internet. Interoperability with C allows a programmer to call C functions from Fortran programs. This is important for two reasons:
- It enables the above-mentioned low-level functionality and gives Fortran access to the C ecosystem of libraries.
- C itself is easily called from many popular programming languages today, such as Python, JavaScript, Go, or Rust. By using C as the interfacing language, Fortran code can be invoked from most other languages. In the real world, this allows Fortran code to be used within web servers, databases, and real-time graphics.