Languages

Languages#

Introduction#

Traditionally the languages used in HPC have followed an imperative programming paradigm, that is they drive a process by explicitly telling it what to do at each step - rather than declarative, which is telling a process what a user wants and letting it figure out the steps itself.

Earlier programming approaches have also been procedural - where a program proceeds by calling subroutines, procedures or functions. More recent paradigms include object oriented programming (OOP) which focuses on data objects and methods used to query or update their state and functional programming (FP) which focuses on the use of state-preserving functions and basic, standardized data structures.

Considerations when adopting a language for a particular application include:

  • existing use of a language in that domain

  • choice of programming paradigm and suitability for the authors and domain

  • availability and ergonomics of tooling and plugin ecosystems

  • performance in terms of computer resource use, including ease of use of parallelism

  • safety in terms of resource use, particularly memory

  • stability and how future-proof the ecosystem is

This Chapter introduces the following languages typically used in HPC and ICHEC projects, with the above considerations reviewed for each:

  • c

  • c++

  • Python

  • Fortran

All of these languages are imperative. c and Fortran are primarily procedural, while C++ and Python typically have more of an OOP than FP focus. Other languages with more declarative and FP focus are introduced in the advanced and specialist Parts of this book.

Further Reading#