Wikipedista:Walter Klosse/Pískoviště

Z Wikipedie, otevřené encyklopedie
Související informace naleznete také na stránce Wikipedista:Walter Klosse/Pískoviště/2.

Programming languages are used for controlling the behavior of a machine (often a computer). Like natural languages, programming languages conform to rules for syntax and semantics.

There are thousands of programming languages[1] and new ones are created every year. Few languages ever become sufficiently popular that they are used by more than a few people, but professional programmers may use dozens of languages in a career.

Most programming languages are not standardized by an international (or national) standard, even widely used ones, such as Perl or Standard ML (despite the name). Notable standardized programming languages include ALGOL, C, C++, JavaScript (under the name ECMAScript), Smalltalk, Prolog, Common Lisp, Scheme (IEEE standard), Ada, Fortran, COBOL, SQL and XQuery.

General comparison[editovat | editovat zdroj]

The following table compares general and technical information for a selection of commonly used programming languages. See the individual languages' articles for further information. Please note that the following table may be missing some information.

Language Intended use Imperative Object-oriented Functional Procedural Generic Reflective Event-driven Other paradigm(s) Standardized?
ActionScript 3.0 Application, client-side, web Ano Ano Ano Ano Šablona:Yes, ECMA
Ada Application, embedded, realtime, system Ano Ano[2] Ano[3] Ano[4] concurrent,[5] distributed,[6] Šablona:Yes, 2005, 2012, ANSI, ISO, GOST 27831-88[7]
Aldor Highly domain-specific, symbolic computing Ano Ano Ano Ne
ALGOL 58 Application Ano Ne
ALGOL 60 Application Ano Šablona:Yes, IFIP WG 2.1, ISO[8]
ALGOL 68 Application Ano concurrent Šablona:Yes, IFIP WG 2.1, GOST 27974-88,[9]
Ateji PX Parallel application Ano pi calculus Ne
APL Application, data processing Ano Ano Ano Ano Ano Ano Ano array-oriented, tacit Šablona:Yes, ISO
Assembly language General Ano any, syntax is usually highly specific, related to the target processor Ne
AutoHotkey GUI automation (macros), highly domain-specific Ano Ano[10] Ano Ano Ne
AutoIt GUI automation (macros), highly domain-specific Ano Ano Ano Ne
Bash Shell, scripting Ano Ano
Ballerina Integration, agile, server-side, general Ano Ano Ano Ano Ano concurrent, transactional, statically and strongly typed programming, diagrammatic / visual programming Šablona:Yes De facto standard via Ballerina Language Specification[11]
BASIC Application, education Ano Ano Šablona:Yes, ANSI, ISO, ECMA
BBj Application, business, web Ano Ano Ne
BeanShell Application, scripting Ano Ano Ano Ano (norsky), JCP[12]
BitC System Ano Ano Ne
BLISS System Ano Ne
BlitzMax Application, game Ano Ano Ano Ano Ne
Blue Education Ano Ano Ano Ne
Boo Application Ne
Bro domain-specific, application Ano Ano Ne
C Application, system,[13] general purpose, low-level operations Ano Ano Šablona:Yes, ANSI C89, ISO C90, ISO C99, ISO C11[14]
C++ Application, system Ano Ano Ano Ano Ano Šablona:Yes, ISO/IEC 1998, ISO/IEC 2003, ISO/IEC 2011,ISO/IEC 2014[15]
C# Application, RAD, business, client-side, general, server-side, web Ano Ano Ano[16] Ano Ano Ano Ano structured, concurrent Šablona:Yes, ECMA, ISO[17]
Clarion General, business, web Ano Ano Ano[18] Šablona:Unknown
Clean General Ano Ano Ne
Clojure General Ano concurrent Ne
CLU General Ano Ano Ano Ano Ne
COBOL Application, business Ano Ano Ano Šablona:Yes
Cobra Application, business, general, web Ano Ano Ano Ano Ano Ne
ColdFusion (CFML) Web Ano Ano Ne
Common Lisp General Ano Ano Ano Ano Ano Ano Ano extensible syntax, Array-oriented, syntactic macros, multiple dispatch, concurrent Šablona:Yes, ANSI
COMAL 80 Education Ano Ano Ne
Crystal General purpose Ano Ano[19] Ano Ano alpha stage[20] Ne
Cython Application, general, numerical computing Ano Ano Ano Ano aspect-oriented Ne
D Application, system Ano Ano Ano Ano Ano Ano generative, concurrent Ne
Dart Application, web, server-side, mobile, IoT Ano Ano Ano structured Šablona:Yes
Dylan Application Ano Ano Ne
Eiffel General, application, business, client-side, server-side, web (EWF) Ano Ano Ano[21][22] Ano Ano Erl-G Ano Agents distributed SCOOP, Void-safe Šablona:Yes, ECMA, ISO[23]
Elixir Application, distributed Ano Ano concurrent, distributed Ne
Erlang Application, distributed Ano Ano concurrent, distributed Ne
Euphoria Application Ano Ano Ne
Factor General Ano can be viewed as Ano Ano stack-oriented Ne
Falcon General, application Ano Ano Ano prototype OOP, message oriented, tabular programming Ne
FP Ano Ne
F# Application Ano Ano Ano Ano Ne
Forth General Ano can be viewed as stack-oriented Šablona:Yes, ANSI
Fortran Application, numerical computing Ano Ano Ano Ano Šablona:Yes, ANSI 66, ANSI 77, MIL-STD-1753, ISO 90, ISO 95, ISO 2003, ISO/IEC 1539-1:2010 (2008)
FreeBASIC Application, numerical computing Ano Ano Ano Ano Ne
G2 Application, inference, expert system Ano Ano Ano common graphical development and runtime environment Ne
Gambas Application Ano Ano Ano Ne
Game Maker Language Application, games Ano Ano Ano Ne
GLBasic Application, games Ano Ano Ano simple object-oriented Ne
Go Application, web, server-side Ano [24] Ano Ano Ano concurrent Šablona:Yes via Go Language Specification
Gosu Application, general, scripting, web Ano Ano Ano Ano Ne
GraphTalk Application Ano logic Ne
Groovy Application, general, scripting, web Ano Ano Ano aspect-oriented (norsky), JCP[25]
Harbour Application, business, data processing, general, web Ano Ano Ano Ano Ano Ano declarative Ne
Haskell Application Ano Ano lazy evaluation Šablona:Yes, Haskell 2010[26]
Haxe Application, general, web Ano Ano Ano Ano Ano Ne
HyperNext Application, education Ano Ano weakly typed Ne
HyperTalk Application, RAD, general Ano Ano weakly typed Neznámé
Io Application, host-driven scripting Ano Ano Ne
IPL General Ano Neznámé
ISLISP General Ano Ano Ano Ano Šablona:Yes, ISO
J Data processing array-oriented, function-level, tacit Ne
JADE Application, distributed Ano Ano Ne
Java Application, business, client-side, general, mobile development, server-side, web Ano Ano Ano Ano Ano Ano Ano concurrent Šablona:Yes via Java Language Specification
JavaScript Client-side, server-side, web Ano Ano Ano Ano Ano Ano prototype-based Šablona:Yes, ECMA
Joy Research Ano stack-oriented Ne
Julia General, technical computing Ano Ano Ano Ano Ano Ano multiple dispatch, meta, scalar and array-oriented, parallel, concurrent, distributed ("cloud") Ne
K Data processing, business array-oriented, tacit Neznámé
Kotlin Application, mobile development, server-side, client-side, web Ano Ano Ano Ano Ano[27] Ne
LabVIEW (G) Application, industrial instrumentation-automation Ano Ano Ano Ano dataflow, visual Ne
Lisp General Ano Neznámé
LiveCode Application, RAD, general Ano Ano weakly typed Ne
Logtalk Artificial intelligence, application Ano Ano Ano logic Ne
LSL Virtual worlds content scripting and animation Ano Ano Ano Scripts exist in in-world objects Ano[28]
Lua Application, embedded scripting Ano Ano[29] Ano Ano Ano aspect-oriented Ne[30]
Maple Symbolic computation, numerical computing Ano Ano Ano Ano distributed Ne
Mathematica Symbolic language Ano Ano Ano Ano logic, distributed Ne
MATLAB Highly domain-specific, numerical computing Ano Ano Ano Ne
Modula-2 Application, system Ano Ano Šablona:Yes, ISO[31]
Modula-3 Application Ano Ano Ano Ne
MUMPS (M) Application, databases Ano Ano concurrent, multi-user, NoSQL, transaction processing Šablona:Yes, ANSI
Nim Application, general, web, scripting, system Ano Ano Ano Ano Ano Ano multiple dispatch, Concurrent, meta Ne
Oberon Application, system Ano Ano Ne
Object Pascal Application, general, mobile app, web Ano Ano Ano Ano Ano Ano structured Ne
Objective-C Application, general Ano Ano Ano Ano concurrent Ne
OCaml Application, general Ano Ano Ano Ano Ano Ne
Occam General Ano Ano concurrent, process-oriented Ne
Opa Web applications Ano Ano Ano distributed Ne
OpenLisp General, Embedded Lisp Engine Ano Ano Ano Ano Šablona:Yes, ISO
Oxygene Application Ano Ano Ano Ne
Oz-Mozart Application, distribution, education Ano Ano Ano concurrent, logic Ne
Pascal Application, education Ano Ano Šablona:Yes, ISO[32]
Perl Application, scripting, text processing, Web Ano Ano Ano Ano Ano Ano Ne
Perl 6 Scripting, text processing, glue Ano Ano Ano Ano Ano Ano aspect-oriented, array, lazy evaluation, multiple dispatch, metaprogramming Ano
PHP Server-side, web application, web Ano Ano[33] Ano[34] Ano Ano Šablona:Yes via language specification and Requests for Comments (RFCs)
PL/I Application Ano Ano Ano Šablona:Yes, ECMA-50 (1976)
Plus Application, system development Ano Ano Ne
PowerShell Administration, application, general, scripting Ano Ano Ano Ano Ano pipeline Ne
Prolog Application, artificial intelligence logic, declarative Šablona:Yes, ISO
PureBasic Application Ano Ne
Python Application, general, web, scripting, artificial intelligence, scientific computing Ano Ano Ano Ano Ano Ano aspect-oriented Šablona:Yes via Python Enhancement Proposals (PEPs)
R Application, statistics Ano Ano Ano Ano Ano Ne
Racket Education, general, scripting Ano Ano Ano Ano modular, logic, meta Ne
REALbasic Application Ano Neznámé
REBOL Distributed Ano Ano Ano dialected Ne
RPG Application, system Ano Ano Ne
Ruby Application, scripting, web Ano Ano Ano Ano aspect-oriented Šablona:Yes
Rust Application, system Ano Ano[35] Ano Ano Ano concurrent Ne
S Application, statistics Ano Ano Ano Ano Ne
S-Lang Application, numerical, scripting Ano Ano Ne
Scala Application, distributed, web Ano Ano Ano Ano Ano Ano Šablona:Yes via Scala Language Specification (SLS)
Scheme Education, general Ano extensible syntax Šablona:Yes, R6RS
Seed7 Application, general, scripting, web Ano Ano Ano Ano multi-paradigm, extensible, structured Ne
Simula Education, general Ano Ano Ano discrete event simulation, multi-threaded (quasi-parallel) program execution Šablona:Yes
Small Basic Application, education, games Ano Ano component-oriented Ne
Smalltalk Application, general, business, artificial intelligence, education, web Ano Ano Ano Ano Ano Ano concurrent, declarative Šablona:Yes, [ANSI
SNOBOL Text processing Neznámé
Standard ML Application Ano Ano Ano Šablona:Yes, SML '97[36]
Swift Application, general Ano Ano Ano Ano Ano Ano Ano concurrent, Multi-paradigm Ne
Tcl Application, scripting, web Ano Ano Ano Ano Ano Ano Ne
Visual Basic Application, RAD, education, business, general, (Includes VBA), office automation Ano Ano Ano Ano component-oriented Ne
Visual Basic .NET Application, RAD, education, web, business, general Ano Ano Ano Ano Ano Ano Ano structured, concurrent Ne
Visual FoxPro Application Ano data-centric, logic Ne
Visual Prolog Application Ano Ano Ano Ano declarative, logic Ne
Wolfram Language Symbolic language Ano Ano Ano Ano logic, distributed Ne
XL Ano Ano concept programming Ne
Xojo Application, RAD, general, web Ano Ano Ano Ano Ano Ne
XPath/XQuery Databases, data processing, scripting Ano tree-oriented Šablona:Yes 1999 XPath 1, 2010 XQuery 1, 2014 XPath/XQuery 3.0
Caché Object Script Application Programming Ano Ne Ano Ano Concurrent Ne

Type systems[editovat | editovat zdroj]

Podrobnější informace naleznete na stránce Comparison of programming languages by type system.

Failsafe I/O and system calls[editovat | editovat zdroj]

Most programming languages will print an error message or throw an exception if an input/output operation or other system call (e.g., chmod, kill) fails, unless the programmer has explicitly arranged for different handling of these events. Thus, these languages fail safely in this regard.

Some (mostly older) languages require that the programmer explicitly add checks for these kinds of errors. Psychologically, different cognitive biases (e.g., optimism bias) may affect novice and experts alike and these omissions can lead to erroneous behavior.

Language Failsafe I/O
Ada Ano (exceptions)
ALGOL Ano (exceptions or return value depending on function)
AutoHotkey Ne (global ErrorLevel must be explicitly checked)
Bash Šablona:Optional[FSIO 1]
Ballerina Ano
Bro Ano
C Ne[FSIO 2]
C++ Šablona:Some (STL iostreams throw on failure but C APIs like stdio or POSIX do not)[FSIO 2]
C# Ano
COBOL Ne
Common Lisp Ano ("conditions and restarts" system)
D Ano (throwing on failure) [FSIO 3]
Eiffel Ne – It actually depends on the library and it is not defined by the language
Erlang Ano
Falcon Ano
Fortran Ano
GLBasic Ne – Will generally cause program to crash
Go Ano (unless result explicitly ignored)
Gosu Ano
Harbour Ano
Haskell Ano
ISLISP Ano
Java Ano
Julia Ano
Kotlin Ano
LabVIEW Ano
Lua Ne (some functions do not warn or throw exceptions)
Mathematica Ano
Object Pascal Šablona:Some
Objective-C Ano (exceptions)
OCaml Ano (exceptions)
OpenLisp Ano
Perl Ne[FSIO 4]
Perl 6 Ano
PHP Ano
Python Ano
REBOL Ano
Rexx Ano (with optional signal on… trap handling)
RPG Ne
Ruby Ano
Rust Ano (unless result explicitly ignored)
S Šablona:Unknown
Smalltalk Ano
Scala Ano[FSIO 5]
Standard ML AnoŠablona:Citation needed
Swift ≥ 2.0 Ano (exceptions)
Tcl Ano
Visual Basic Ano
Visual Prolog Ano
Wolfram Language Ano
Xojo Ano
XPath/XQuery Ano (exceptions)
Language Failsafe I/O
  1. set -e enables termination if any unchecked exit status is nonzero.
  2. a b gcc can warn on unchecked errno. Newer versions of Visual Studio usually throw exceptions on failed I/O when using stdio.
  3. https://dlang.org/phobos/std_stdio.html
  4. Considerable error checking can be enabled optionally, but by default Perl is not failsafe.
  5. Scala runs on the Java Virtual Machine from which it inherits the runtime exception handling.

Expressiveness[editovat | editovat zdroj]

Language Statements ratio[37] Lines ratio[38]
C 1 1
C++ 2.5 1
Fortran 2 0.8
Java 2.5 1.5
Perl 6 6
Smalltalk 6 6.25
Python 6 6.5

The literature on programming languages contains an abundance of informal claims about their relative expressive power, but there is no framework for formalizing such statements nor for deriving interesting consequences.[39] This table provides two measures of expressiveness from two different sources. An additional measure of expressiveness, in GZip bytes, can be found on the Computer Language Benchmarks Game.[40]

Benchmarks[editovat | editovat zdroj]

Benchmarks are designed to mimic a particular type of workload on a component or system. The computer programs used for compiling some of the benchmark data in this section may not have been fully optimized, and the relevance of the data is disputed. The most accurate benchmarks are those that are customized to your particular situation. Other people's benchmark data may have some value to others, but proper interpretation brings many challenges. The Computer Language Benchmarks Game site warns against over-generalizing from benchmark data, but contains a large number of micro-benchmarks of reader-contributed code snippets, with an interface that generates various charts and tables comparing specific programming languages and types of tests.[41]

Timeline of specific language comparisons[editovat | editovat zdroj]

  • 1973 – Comparative Notes on Algol 68 and PL/I – S. H. Valentine – February 1973
  • 1976 – Evaluation of ALGOL 68, JOVIAL J3B, Pascal, Simula 67, and TACPOL Versus TINMAN – Requirements for a Common High Order Programming Language.
  • 1977 – A comparison of PASCAL and ALGOL 68[42]Andrew S. Tanenbaum – June 1977.
  • 1993 – Five Little Languages and How They Grew – BLISS, Pascal, ALGOL 68, BCPL & CDennis M. Ritchie – April 1993.
  • 2009 – On Go – oh, go on – How well will Google's Go stand up against Brand X programming language? – David Given – November 2009

See also[editovat | editovat zdroj]

Šablona:Category tree all

References[editovat | editovat zdroj]

  1. As of May 2006 Diarmuid Pigott's Encyclopedia of Computer Languages Archivováno 20. 2. 2011 na Wayback Machine. hosted at Murdoch University, Australia lists 8512 computer languages.
  2. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, 3.9 Tagged Types and Type Extensions
  3. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, Section 6: Subprograms
  4. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, Section 12: Generic Units
  5. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, Section 9: Tasks and Synchronization
  6. Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3 Annex E: Distributed Systems
  7. Vak.ru
  8. ISO 1538:1984
  9. Vak.ru
  10. AutoHotkey object protocol and concepts
  11. Ballerina Language Specification [online]. WSO2, 2018-05-01 [cit. 2018-05-03]. Dostupné online. 
  12. JSR 274
  13. bell-labs.com
  14. ANSI C89, ISO/IEC 9899:1990, 1999, 2011
  15. ISO/IEC 14882:1998, 2003, 2011
  16. Codeproject.com: Functional Programming in C# 3.0 using Lambda Expression
  17. ECMA-334; ISO/IEC 23270:2006
  18. Softvelocity.com
  19. https://github.com/crystal-lang/crystal#why
  20. https://github.com/crystal-lang/crystal#status
  21. Basic Eiffel language mechanisms
  22. Closure (computer programming)
  23. ECMA-367; ISO/IEC 25436:2006
  24. [1]
  25. JSR 241
  26. The Haskell 2010 Language Report [online]. [cit. 2011-12-07]. Dostupné online.  Most Haskell implementations extend the Haskell 2010 standard.
  27. M8 is out! [online]. Dostupné online. 
  28. "De facto" reference is the Second Life implementation of LSL. Halcyon (Inworldz) and Open Sims propose compatible implementations with additionnal functions
  29. Lua doesn't have explicit "object" type (more general type of "table" is used for object definition), but does have explicit syntax for object method calling
  30. Version releases are accompanied with a definitive Lua Reference Manual showing full syntax and semantics; a reference implementation, and a test suite. These are used to generate other Lua VM implementations and compilers such as Kahlua and LLVM-Lua.
  31. ISO/IEC 10514-1:1996
  32. ISO 7185
  33. PHP Manual, Chapter 19. Classes and Objects (PHP 5),
  34. PHP Manual, Chapter 17. Functions
  35. Is Rust an Object-Oriented Programming Language?
  36. SMLNJ.org
  37. Data from Code Complete, p. 100. The Statements ratio column "shows typical ratios of source statements in several high-level languages to the equivalent code in C. A higher ratio means that each line of code in the language listed accomplishes more than does each line of code in C.
  38. The ratio of line count tests won by each language to the number won by C when using the Compare to feature at benchmarksgame.alioth.debian.org. Last updated May, 2006. C gcc was used for C, C++ g++ was used for C++, FORTRAN G95 was used for FORTRAN, Java JDK Server was used for Java, and Smalltalk GST was used for Smalltalk.
  39. Felleisen, Matthias. "On the Expressive Power of Programming Languages" in ESOP '90 3rd European Symposium on Programming.. 
  40. How programs are measured | Computer Language Benchmarks Game [online]. [cit. 2018-05-29]. Dostupné online. 
  41. The Ultimate Benchmark | The Computer Language Benchmarks Game [online]. [cit. 2018-05-29]. Dostupné online. 
  42. http://dare.ubvu.vu.nl/bitstream/1871/2609/1/11054.pdf

Further reading[editovat | editovat zdroj]

  • CEZZAR, Ruknet. A Guide to Programming Languages: Overview and Comparison. [s.l.]: [s.n.] ISBN 978-0-89006-812-0. 

External links[editovat | editovat zdroj]