Difference between revisions of "Programming Languages"

From HPC Wiki
Jump to navigation Jump to search
 
(8 intermediate revisions by the same user not shown)
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 translated 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. Note that being standard-compliant for both the code and the compiler greatly enhance the chances of porting to be a smooth, enjoyable procedure.
  
 +
* Fortran, the 1st wide-used high-level programming, used in HPC since 1954 and will likely be used for a long time, as there are still many Fortran projects  and tons of libraries-canot-give-up around. Fortran handles multi-dimensional arrays very 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
 
  
* C and C++
+
* JAVA is a widely used programming language, but due to performance issues in most cases not suited for true high performance computing.
* JAVA
 
  
Script / interpreted languages
+
== Script / interpreted languages ==
* Shell
+
* [[Shell|Shell]] helps you to script many calls to a single program. The [[Batch-Scheduler|batch scripts]] are programmed in one of Shell languages.
* Python
+
* [[Python/pip|Python]] evolves to very powerful scientific computing language nowadays, especially for those prepared to abadon MATLAB from the compute pipeline.
* Perl
+
* [https://en.wikipedia.org/wiki/Perl Perl] is another scripting language with very powerful handling of regular expressions.
 +
* MATLAB is a powerful numerical computing environment with same-called programming language.
  
Other
+
== Books an Links ==
* MATLAB
+
* C
 
+
** Brian W. Kernighan, Dennis M. Ritchie: Programmieren in C  - Carl Hanser Verlag - 1990. ISBN-13: 978-3446154971 (in German)
== References ==
+
** Brian W. Kernighan, Dennis M. Ritchie: The C Programming Language - Prentice Hall; 2nd edition (April 1, 1988). ISBN-13: 978-0131103627
 +
** Henry S. Warren: [https://openlibrary.org/books/OL26754454M/Hacker's_Delight_(2nd_Edition) Hacker's Delight] - Addison-Wesley Professional; 2nd revised edition (25. September 2012). ISBN-13: 978-0321842688 Webpage: [http://web.archive.org/web/20190916060535/http://hackersdelight.org/ hackersdelight.org/ (Archived)]
 +
* C++
 +
** Ulrich Breymann: [http://www.cppbuch.de/ Der C++ Programmierer] - Hanser Verlag - 2017. ISBN-13: 978-3446448841 (in German)
 +
** [http://cppreference.com/ online C++ reference]
 +
** William H. Press: Numerical Recipes 3rd Edition: The Art of Scientific Computing - Cambridge University Press - 2007. ISBN-13: 978-0521880688 Webpage: [http://numerical.recipes/  numerical.recipes/] (The original ''nr.com'' two-letter domain gone by the wind.)
 +
* Fortran
 +
** Stephen Chapman: Fortran for Scientists and Engineers -  McGraw-Hill Education. This book was ''the'' Fortran book for many years; the actual 4ed - 2017 seem to be overprised.
 +
** Michael Metcalf, John Reid, Malcolm Cohen: Modern Fortran Explained: Incorporating Fortran 2018 -  ISBN-13: 978-0198811893. Latest edition of Fortran books by those autors.
 +
** Walter S. Brainerd: Guide to Fortran 2008 Programming - 2015 - ISBN-13: 978-1447167587. Also available in older editions for older Fortran standards.
 +
** [http://gcc.gnu.org/wiki/GFortranStandards Fortran Standards Documents]

Latest revision as of 17:06, 26 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 translated 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. Note that being standard-compliant for both the code and the compiler greatly enhance the chances of porting to be a smooth, enjoyable procedure.

  • Fortran, the 1st wide-used high-level programming, used in HPC since 1954 and will likely be used for a long time, as there are still many Fortran projects and tons of libraries-canot-give-up around. Fortran handles multi-dimensional arrays very 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 true high performance computing.

Script / interpreted languages

  • Shell helps you to script many calls to a single program. The batch scripts are programmed in one of Shell languages.
  • Python evolves to very powerful scientific computing language nowadays, especially for those prepared to abadon MATLAB from the compute pipeline.
  • Perl is another scripting language with very powerful handling of regular expressions.
  • MATLAB is a powerful numerical computing environment with same-called programming language.

Books an Links

  • C
    • Brian W. Kernighan, Dennis M. Ritchie: Programmieren in C - Carl Hanser Verlag - 1990. ISBN-13: 978-3446154971 (in German)
    • Brian W. Kernighan, Dennis M. Ritchie: The C Programming Language - Prentice Hall; 2nd edition (April 1, 1988). ISBN-13: 978-0131103627
    • Henry S. Warren: Hacker's Delight - Addison-Wesley Professional; 2nd revised edition (25. September 2012). ISBN-13: 978-0321842688 Webpage: hackersdelight.org/ (Archived)
  • C++
    • Ulrich Breymann: Der C++ Programmierer - Hanser Verlag - 2017. ISBN-13: 978-3446448841 (in German)
    • online C++ reference
    • William H. Press: Numerical Recipes 3rd Edition: The Art of Scientific Computing - Cambridge University Press - 2007. ISBN-13: 978-0521880688 Webpage: numerical.recipes/ (The original nr.com two-letter domain gone by the wind.)
  • Fortran
    • Stephen Chapman: Fortran for Scientists and Engineers - McGraw-Hill Education. This book was the Fortran book for many years; the actual 4ed - 2017 seem to be overprised.
    • Michael Metcalf, John Reid, Malcolm Cohen: Modern Fortran Explained: Incorporating Fortran 2018 - ISBN-13: 978-0198811893. Latest edition of Fortran books by those autors.
    • Walter S. Brainerd: Guide to Fortran 2008 Programming - 2015 - ISBN-13: 978-1447167587. Also available in older editions for older Fortran standards.
    • Fortran Standards Documents