stringtranslate.com

Comparison of programming languages (basic instructions)

This article compares a large number of programming languages by tabulating their data types, their expression, statement, and declaration syntax, and some common operating-system interfaces.

Conventions of this article

Generally, var, var, or var is how variable names or other non-literal values to be interpreted by the reader are represented. The rest is literal code. Guillemets (« and ») enclose optional sections. Tab ↹ indicates a necessary (whitespace) indentation.

The tables are not sorted lexicographically ascending by programming language name by default, and that some languages have entries in some tables but not others.

Type identifiers

Integers

Floating point

Complex numbers

Other variable types

Derived types

Array

Other types

Variable and constant declarations

Control flow

Conditional statements

Loop statements

Exceptions

Other control flow statements

Functions

See reflective programming for calling and declaring functions by strings.

Type conversions

Where string is a signed decimal number:

Standard stream I/O

Reading command-line arguments

Execution of commands

^a Fortran 2008 or newer.[17]

References

  1. ^ a b c d e f g h i j k l m n o p Ada Reference Manual – Language and Standard Libraries; ISO/IEC 8652:201x (E), "Reference Manual" (PDF). Archived from the original (PDF) on 2011-04-27. Retrieved 2013-07-19.
  2. ^ "Common Lisp HyperSpec (TM)". lispworks.com. Retrieved 30 January 2017.
  3. ^ "www.islisp.info: Specification". islisp.info. Archived from the original on 22 January 2016. Retrieved 30 January 2017.
  4. ^ a b "selected_int_kind in Fortran Wiki". fortranwiki.org. Retrieved 30 January 2017.
  5. ^ "Erlang — Types and Function Specifications". erlang.org. Retrieved 30 January 2017.
  6. ^ "Erlang — Advanced". erlang.org. Retrieved 30 January 2017.
  7. ^ a b 8.5 The Number Type
  8. ^ a b "selected_real_kind in Fortran Wiki". fortranwiki.org. Retrieved 30 January 2017.
  9. ^ "The GNU C Library: Complex Numbers". gnu.org. Retrieved 30 January 2017.
  10. ^ "Grammar vb". Visual Basic Language Specification. 2016-06-17. Archived from the original on 2019-08-29. Retrieved 2019-08-29.
  11. ^ "for...of". mozilla.org. Retrieved 30 January 2017.
  12. ^ "Try-Catch for VB". google.com. Archived from the original on 16 April 2016. Retrieved 30 January 2017.
  13. ^ Klabnik, Steve; Nichols, Carol. "Error Handling". The Rust Programming Language.
  14. ^ "Prime decomposition – Rosetta Code". rosettacode.org. Retrieved 30 January 2017.
  15. ^ "iso_fortran_env in Fortran Wiki". fortranwiki.org. Retrieved 30 January 2017.
  16. ^ "Execute a system command – Rosetta Code". rosettacode.org. Retrieved 30 January 2017.
  17. ^ "EXECUTE_COMMAND_LINE – The GNU Fortran Compiler". gnu.org. Retrieved 30 January 2017.