Difference between revisions of "Programming Languages"

From HPC Wiki
Jump to navigation Jump to search
Line 9: Line 9:
  
 
== High-level programming languages ==
 
== High-level programming languages ==
... are readable by humans. The source code is a text file, to be modufie to an executable file by a [[Compiler|compiler]] (we do not want to introduce the definition bush about compiled and [https://en.wikipedia.org/wiki/Interpreted_language interpreted languages] here).
+
... are readable by humans. The source code is a text file, to be modufie to an executable file by a [[Compiler|compiler]] (we do not want to introduce the definition bush about compiled and [https://en.wikipedia.org/wiki/Interpreted_language interpreted languages] here). In addition to human-readablity these programs are portable, you just need to recompile your code on another hardware using a compiler understanding the same language.  
  
 +
* Fortran, the 1st wide-used high-level programming, used in HPC since 1954 and will likely be used for a lomg time, as there are still many Fortran projects around. Fortran handles multi-dimensional arrays comfortably. Due to some restrictions in the memory handling the compiler has more optimisation freedom leading to quite well-performing code out of the box, usually.
  
Portability
+
* C and C++ are related languages with the second being object-oriented with a lot of programming comfort. “C programs are the fastest” is usually not true. As C has very few syntax limitations, this often gives the compiler a hard time optimizing. The passing of pointers is in most cases the biggest handicap. You can rid this, but need to take care.
* Fortran, the 1st wide-used high-level programming, used in HPC since 1954 and will likely be used for a lomg time, as there are still many Fortran projects around. Fortran handles multi-dimensional arrays comfortably. Due to some restrictions i the language
+
* JAVA is a widely used programming language, but due to performance issues in most cases not suited for high performance computing.
 
 
* C and C++
 
* JAVA
 
  
 
Script / interpreted languages
 
Script / interpreted languages
* Shell
+
* [[Shell|Shell]]
* Python
+
* [[Python/pip Python]]
 
* Perl
 
* Perl
  

Revision as of 15:43, 5 May 2020


Among the decades, very many programming languages has been evolved. We list some most widely used in the context of HPC here.

Low-Level programming languages

  • Machine code: That are 10001001011110 your computer can understand. You likely not.
  • Assembler: human-readable (to somehow extent; many says 'for special humans'), but still very low-level. Allows the programmer to get the very last possible performance crumbs from the hardware, but in turn is hardware-dependent and very tedious to program. Highly-tuned libraries often contain ASM parts, often making this software less-portable. You should not start at assembler level when programming an application.

High-level programming languages

... are readable by humans. The source code is a text file, to be modufie to an executable file by a compiler (we do not want to introduce the definition bush about compiled and interpreted languages here). In addition to human-readablity these programs are portable, you just need to recompile your code on another hardware using a compiler understanding the same language.

  • Fortran, the 1st wide-used high-level programming, used in HPC since 1954 and will likely be used for a lomg time, as there are still many Fortran projects around. Fortran handles multi-dimensional arrays comfortably. Due to some restrictions in the memory handling the compiler has more optimisation freedom leading to quite well-performing code out of the box, usually.
  • C and C++ are related languages with the second being object-oriented with a lot of programming comfort. “C programs are the fastest” is usually not true. As C has very few syntax limitations, this often gives the compiler a hard time optimizing. The passing of pointers is in most cases the biggest handicap. You can rid this, but need to take care.
  • JAVA is a widely used programming language, but due to performance issues in most cases not suited for high performance computing.

Script / interpreted languages

Other

  • MATLAB

References