Informatika & Komputer    
   
Daftar Isi
(Sebelumnya) Comparison of object database ...Comparison of project-manageme ... (Berikutnya)

Perbandingan -- programming languages

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.

Contents


General comparison

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.

LanguageIntended useParadigm(s)Standardized?
ActionScript 3.0Application, client-side, Webevent-driven, imperative, object-oriented1996, ECMA
AdaApplication, embedded, realtime, systemconcurrent,[2] distributed,[3] generic,[4] imperative object-oriented,[5] procedural,[6]1983, 2005, 2012, ANSI, ISO, GOST 27831-88[7]
AldorHighly domain-specific, symbolic computingimperative, functional, object-orientedNo
ALGOL 58ApplicationimperativeNo
ALGOL 60Applicationimperative1960, IFIP WG 2.1, ISO[8]
ALGOL 68Applicationconcurrent, imperative1968, IFIP WG 2.1, GOST 27974-88,[9]
Ateji PXParallel applicationobject-oriented, pi calculusNo
APLApplication, data processingarray-oriented, tacit1989, ISO
Assembly languageGeneralany, imperative, syntax is usually highly specific, related to the target processorNo
AutoHotkeyGUI automation (macros), highly domain-specificimperativeNo
AutoItGUI automation (macros), highly domain-specificevent-driven, imperative, proceduralNo
BASICApplication, educationimperative, procedural1983, ANSI, ISO
BBjApplication, business, Webobject-oriented, proceduralNo
BeanShellApplication, scriptingfunctional, imperative, object-oriented, reflectiveIn progress, JCP[10]
BLISSSystemproceduralNo
BlitzMaxApplication, gameimperative, object-oriented, proceduralNo
BooApplication No
CSystem[11]imperative, procedural1989, ANSI C89, ISO C90, ISO C99, ISO C11[12]
C++Application, systemgeneric, imperative, object-oriented, procedural, functional1998, ISO/IEC 1998, ISO/IEC 2003, ISO/IEC 2011[13]
C#Application, business, client-side, general, server-side, Web, Roboticsstructured, functional,[14] generic, imperative, object-oriented, reflective, concurrent, event-driven2000, ECMA, ISO[15]
ClarionGeneral, business, Webfunctional,[16] imperative, object-orientedUnknown
CleanGeneralfunctional, genericNo
ClojureGeneralconcurrent, functionalNo
CLUGeneralgeneric, imperative, object-oriented, proceduralNo
COBOLApplication, businessimperative, object-oriented2002 (ISO/IEC 1989)
CobraApplication, business, general, Webfunctional, generic, imperative, object-oriented, reflectiveNo
ColdFusion (CFML)Webobject-oriented, proceduralNo
Common LispGeneralfunctional, generic, imperative, object-oriented, reflective1994, ANSI
COMAL 80Educationimperative, proceduralNo
Crystal 1.0.0Educationfunctional, imperative, proceduralNo
CythonApplication, general, numerical computingaspect-oriented, functional, imperative, object-oriented, reflectiveNo
DApplication, systemgeneric, generative, imperative, object-oriented, functional, concurrentNo
DartApplication, Webimperative, structured, object-orientedNo
DylanApplicationfunctional, object-orientedNo
DYL-280Application, systemimperative, proceduralNo
EiffelApplicationgeneric, imperative, object-oriented2005, ECMA, ISO[17]
ErlangApplication, distributed, telecomconcurrent, distributed, functionalNo
EuphoriaApplication. Since the interpreter is shared for system and application code, system is not an intended use because application crashes would affect the whole system.procedural, reflectiveNo
Factor stack-orientedNo
FalconGeneral, Applicationprocedural, functional, object oriented, prototype OOP, message oriented, tabular programmingNo
FP functionalNo
F#Applicationfunctional, generic, imperative, object-orientedNo
ForthGeneralimperative, stack-oriented1994, ANSI
FortranApplication, numerical computinggeneric, imperative, object-oriented, procedural1966, ANSI 66, ANSI 77, MIL-STD-1753, ISO 90, ISO 95, ISO 2003
G2Application, inference, expert systemcommon graphical development and runtime environment, event-driven, imperative, object-orientedNo
GambasApplicationevent-driven, imperative, object-orientedNo
Game Maker LanguageApplication, gamesevent-driven, imperative, object-orientedNo
GLBasicApplication, gamesimperative, procedural, simple object-orientedNo
GoApplication, systemconcurrent, imperativeNo
GosuApplication, general, scripting, Webgeneric, imperative, object-oriented, reflectiveNo
GraphTalkApplicationlogic, object-orientedNo
GroovyApplication, Webaspect-oriented, imperative, object-oriented, functionalIn progress, JCP[18]
HarbourApplication, business, data processing, general, Webdeclarative, functional, generic, imperative, object-oriented, procedural, reflectiveNo
HaskellApplicationfunctional, generic, lazy evaluation2010, Haskell 2010[19]
HaxeApplication, general, Webimperative, object-oriented, functional, generic, reflectiveNo
HyperNextApplication, educationevent-driven, procedural, weakly typedNo
IoApplication, host-driven scriptingimperative, object-orientedNo
ISLISPGeneralfunctional, generic, imperative, object-oriented1997, ISO
JData processingarray-oriented, function-level, tacitNo
JADEApplication, distributedimperative, object-orientedNo
JavaApplication, business, client-side, general, server-side, Webgeneric, imperative, object-oriented, reflectiveDe facto standard via Java Language Specification
JavaScriptClient-side, Webfunctional, imperative, prototype-based, reflective1997, ECMA
JoyResearchfunctional, stack-orientedNo
KData processing, businessarray-oriented, tacitUnknown
LabVIEW (G)Application, industrial instrumentation-automationdataflow, visualNo
LispGeneralfunctionalUnknown
LogtalkArtificial intelligence, applicationevent-driven, logic, object-oriented, reflectiveNo
LuaApplication, embedded scriptingaspect-oriented, functional, imperative, object-oriented, procedural, reflectiveNo[20]
MathematicaSymbolic languagefunctional, procedural, imperative, logic, distributed, object-orientedNo
MATLABHighly domain-specific, numerical computingimperative, object-oriented, proceduralNo
Modula-2Application, systemgeneric, imperative1996, ISO[21]
Modula-3Applicationgeneric, imperative, object-orientedNo
OberonApplication, systemimperative, object-orientedNo
Objective-CApplicationimperative, object-oriented, reflectiveNo[22]
OCamlApplicationfunctional, generic, imperative, object-orientedNo
Object Pascal (Delphi)Application, business, client-side, general, server-side, Webaspect-oriented,[23] event-driven, functional, generic, imperative, object-oriented, procedural, reflectiveNo
OccamGeneralconcurrent, imperative, procedural, process-orientedNo
OpaWeb applicationsfunctional, generic, imperative, distributedNo
OxygeneApplicationgeneric, imperative, object-orientedNo
OzApplication, distribution, educationconcurrent, functional, imperative, logic, object-orientedNo
PascalApplication, educationimperative, procedural1983, ISO[24]
PawnEmbedded, host-driven scriptingimperativeNo
PerlApplication, scripting, text processing, Webfunctional, generic, imperative, object-oriented, procedural, reflectiveNo
PHPServer-side, Web Application, Webimperative, object-oriented,[25] procedural,[26] reflectiveNo
PL/IApplicationimperative, object-oriented, procedural1969
PlusApplication, system developmentimperative, proceduralNo
PrologApplication, artificial intelligencelogic1995, ISO
PureBasicApplicationproceduralNo
PythonApplication, general, Web, scriptingaspect-oriented, functional, imperative, object-oriented, reflectiveDe facto standard via Python Enhancement Proposals (PEP)s.
RacketEducation, general, scriptingfunctional, procedural, modular, object-oriented, logic, reflective, metaNo
REALbasicApplicationproceduralUnknown
REBOLDistributeddialected, functional, imperative, object-orientedNo
RPG (IBM)Application, systemimperative, proceduralNo
RubyApplication, scripting, Webaspect-oriented, functional, imperative, object-oriented, reflective2011(JIS X 3017), 2012(ISO/IEC 30170)
RustApplication, systemconcurrent, functional, generic, imperative, object-oriented, reflectiveNo
SApplication, statisticsfunctional, imperative, object-oriented, proceduralNo
S-LangApplication, numerical, scriptingimperative, proceduralNo
ScalaApplication, distributed, Webfunctional, generic, imperative, object-orientedDe facto standard via Scala Language Specification (SLS)
SchemeEducation, generalfunctional1998, R6RS
SimulaEducation, generaldiscrete event simulation, event-driven, imperative, multi-threaded (quasi-parallel) program execution, object-oriented1968
Small BasicApplication, education, gamescomponent-oriented, event-driven, imperativeNo
SmalltalkApplication, educationconcurrent, declarative, event-driven, object-oriented, reflective1998, ANSI
SNOBOLText processing Unknown
Standard MLApplicationfunctional, generic, imperative1997, SML '97[27]
TclApplication, scripting, Webevent-driven, imperative, procedural, reflectiveNo
Visual BasicApplication, educationcomponent-oriented, event-driven, imperativeNo
Visual Basic .NETApplication, education, Webevent-driven, imperative, object-orientedNo
Visual PrologApplicationdeclarative, event-driven, functional, imperative, logic, object-orientedNo
Windows PowerShellAdministrationfunctional, imperative, object-oriented, pipeline, reflectiveNo
XL concept programming, imperative, object-orientedNo
LanguageIntended useParadigm(s)Standardized?

Type systems

Brief definitions

  • Compatibility among composite types describes the behavior of functions applied to data typed similarly to its intended type. Name-based compatibility means that functions work only on data of its intended type and declared subtypes. Property-based compatibility means that functions work on any data that has the same properties as its intended type.
  • Type checking determines whether and when types are verified. Static checking occurs at compile-time. Dynamic checking occurs at run-time.
LanguageType strengthType safetyType expressionType compatibility among compositesType checking
ActionScript 3.0strongsafeimplicit with optional explicit typing static
Adastrongsafe[TS 1]explicitname-basedpartially dynamic[TS 2]
Aldorstrongunsafeimplicit static
ALGOL 58strongsafeexplicit static
ALGOL 60strongsafeexplicit static
ALGOL 68strongsafeexplicitproperty-basedstatic
APLstrongsafe  dynamic
AutoHotkeynone    
Ateji PXstrongsafeexplicitname-basedstatic
BASICvaries by dialect    
BLISSnonen/an/an/an/a
BeanShellstrongsafe name-baseddynamic
Boostrongsafeimplicit with optional explicit typing static with optional dynamic typing
Cweakunsafeexplicitname-basedstatic
C++ (ISO/IEC 14882)strongunsafeexplicitname-basedstatic[TS 3]
C#strongsafe[TS 4]implicit with optional explicit typingname-basedstatic[TS 5]
Cleanstrongsafeimplicit static
Clojurestrongsafeimplicit with optional explicit typing dynamic
COBOLstrong   static
ColdFusion (CFML)strongsafeimplicit dynamic
Common Lispstrongsafeimplicit with optional explicit typing dynamic
Curlstrongsafe name-based 
Cythonstrongsafeimplicit with optional explicit typingname-based (extension types) and property-based (Python)dynamic with optional static typing
Dstrongunsafe[TS 6]explicitname-basedstatic
Dylanstrongsafe  dynamic
Eiffelstrongsafe name-basedstatic
Erlangstrongsafeimplicit dynamic
Euphoriastrongsafeexplicit, implicit with objectsname-basedstatic, dynamic with objects
F#strongsafeimplicitname-basedstatic
Falconstrongsafeimplicitproperty-baseddynamic
Forthnonen/an/an/an/a
Fortranstrongsafeexplicit[TS 7]name-basedstatic
Gambasstrongsafeexplicitname-based 
GLBasicstrongsafeexplicit. Non-explicit declarations available through project optionsname-basedstatic
Go[28]strongsafeimplicit with optional explicit typingproperty-basedstatic
Gosustrongsafepartially implicit (local type inference)name-based (subclassing) and property-based (structural)static
GraphTalkweak    
Groovystrongsafeimplicit with optional explicit typing dynamic with optional static typing
Harbourstrongsafeimplicit with optional explicit typing dynamic
Haskellstrongsafeimplicit with optional explicit typingproperty-basedstatic
Haxestrongsafeimplicit with optional explicit typingname-based (subclassing) and property-based (structural)static with optional dynamic typing
Iostrongsafeimplicit dynamic
ISLISPstrongsafe  dynamic
Jstrongsafe  dynamic
Javastrongsafe[29]explicitname-basedstatic
JavaScriptweak implicit dynamic
Joystrongsafe  dynamic
Luaweaksafeimplicit dynamic
Mathematicastrong   dynamic
MATLAB M-code    dynamic
Modula-2strongunsafe[TS 6]explicitname-basedstatic
Modula-3strongunsafe[TS 6]explicitproperty-basedstatic
Oberonstrongsafeexplicitname-basedstatic and partially dynamic[TS 8]
Objective-Cweaksafeexplicitname-based (subclassing) and property-based (protocols)dynamic with optional static typing[30]
OCamlstrongsafeimplicit with optional explicit typingproperty-basedstatic
Object Pascal (Delphi)strongsafeexplicitname-basedstatic
Opastrongsafeimplicit with optional explicit typingproperty-basedstatic
Oxygenestrongunsafeimplicit static
Ozstrongsafeimplicitproperty-baseddynamic
Pascalstrongunsafe[TS 6]explicitname-basedstatic
Perl 5weak implicit dynamic
Perl 6  partially implicit[TS 9] dynamic with optional static typing
PHPweak implicit dynamic
Plusstrongsafeexplicitproperty-basedstatic, dynamic (optional)
Prologstrong   dynamic
Pure    dynamic
Pythonstrongsafeimplicitproperty-baseddynamic
REBOLstrongsafeimplicit dynamic
RPG (IBM)strongunsafe  static
Rubystrongsafeimplicitproperty-baseddynamic
Ruststrongsafeimplicit with optional explicit typing static with optional dynamic typing
Sstrong   dynamic
S-Langstrongsafeimplicit dynamic
Scalastrongsafepartially implicit (local type inference)name-based (subclassing) and property-based (structural)static
Schemestrong implicit dynamic (latent)
Simulastrongsafe  static[TS 10]
Smalltalkstrongsafeimplicit dynamic
Standard MLstrongsafeimplicit with optional explicit typingproperty-basedstatic
Tcl    dynamic
Visual Basicstrongsafeimplicit with optional explicit typingname-basedstatic
Visual Basic .NETstrongunsafe[TS 6]explicit static
Visual Prologstrongsafepartially implicitname-basedstatic
Windows PowerShellstrongsafeimplicit dynamic
XLstrongsafe name-basedstatic
LanguageType strengthType safetyType expressionType compatibility among compositesType checking
  1. ^ Unsafe operations are well isolated by a "Unchecked_" prefix.
  2. ^ Dynamic type checking is used when type safety can not be determined statically, i.e., for tagged types (type extension / inheritance), numeric ranges and array bounds.
  3. ^ with optional dynamic type casting (see dynamic_cast)
  4. ^ Safe, but supports unsafe code through an explicit declaration
  5. ^ with optional dynamic type (see dynamic member lookup)
  6. ^ a b c d e It is almost safe, unsafe features are not commonly used.
  7. ^ Optionally, typing can be explicitly implied by the first letter of the identifier (known as implicit typing within the Fortran community).
  8. ^ dynamic checking of type extensions i.e. inherited types
  9. ^ explicit for static types
  10. ^ optional for formal and virtual procedures

Failsafe I/O and system calls

Most programming languages will print an error message and/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. It is common for novice programmers to forget to add these checks, and even experts occasionally do so—these omissions can lead to erroneous behavior.

LanguageFailsafe I/O
AdaYes (exceptions)
AutoHotkeyNo (global ErrorLevel must be explicitly checked)
CNo[FSIO 1]
C++No[FSIO 2]
C#Yes
Common LispYes
DYes[citation needed]
EiffelYes - It actually depends on the library and it is not defined by the language
ErlangYes
FalconYes
FortranYes
GLBasicNo - Will generally cause program to crash
GoNo
GosuYes
HarbourYes
HaskellYes
ISLISPYes
JavaYes
LuaNo (some functions do not warn or throw exceptions)
MathematicaYes
Object Pascal (Delphi)Some
Objective-CYes (exceptions)
OCamlYes (exceptions)
PerlNo[FSIO 3]
PHPYes
PythonYes
REBOLYes
RubyYes
RustYes
SUnknown
ScalaYes[31]
Standard MLYes[citation needed]
TclYes
Visual BasicYes
Visual PrologYes
LanguageFailsafe I/O
  1. ^ gcc can warn on unchecked error status. Newer versions of Visual Studio usually throw exceptions on failed I/O when using stdio.
  2. ^ g++ can warn on unchecked error status. Newer versions of Visual Studio usually throw exceptions on failed I/O when using stdio.
  3. ^ Considerable error checking can be enabled optionally, but by default Perl is not failsafe.

Expressiveness

LanguageStatements ratio[32]Lines ratio[33]
C11
C++2.51
Fortran20.8
Java2.51.5
Perl66
Smalltalk66.25
Python66.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.[34] 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.[35]


Benchmarks

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. See this page about over-generalizing from benchmark data. The Computer Language Benchmarks Game site 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.

Timeline of specific language comparisons

See also

References

  1. ^ As of May 2006 Diarmuid Pigott's Encyclopedia of Computer Languages hosted at Murdoch University, Australia lists 8512 computer languages.
  2. ^ Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, Section 9: Tasks and Synchronization
  3. ^ Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3 Annex E: Distributed Systems
  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, 3.9 Tagged Types and Type Extensions
  6. ^ Ada Reference Manual, ISO/IEC 8652:2005(E) Ed. 3, Section 6: Subprograms
  7. ^ Vak.ru
  8. ^ ISO 1538:1984
  9. ^ Vak.ru
  10. ^ JSR 274
  11. ^ CM.bell-labs.com
  12. ^ ANSI C89, ISO/IEC 9899:1990, 1999, 2011
  13. ^ ISO/IEC 14882:1998, 2003, 2011
  14. ^ Codeproject.com: Functional Programming in C# 3.0 using Lambda Expression
  15. ^ ECMA-334; ISO/IEC 23270:2006
  16. ^ Softvelocity.com
  17. ^ ECMA-367; ISO/IEC 25436:2006
  18. ^ JSR 241
  19. ^ "The Haskell 2010 Language Report". http://www.haskell.org/onlinereport/h askell2010/. Retrieved 2011-12-07. Most Haskell implementations extend the Haskell 2010 standard.
  20. ^ 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.
  21. ^ ISO/IEC 10514-1:1996
  22. ^ GCC.GNU.org
  23. ^ Cirrus: Aspect-oriented programming in Delphi Prism
  24. ^ ISO 7185
  25. ^ PHP Manual, Chapter 19. Classes and Objects (PHP 5),
  26. ^ PHP Manual, Chapter 17. Functions
  27. ^ SMLNJ.org
  28. ^ The Go Programming Language Specification
  29. ^ Sheng Liang, Gilad Bracha. Dynamic class loading in the Java virtual machine. Volume 33, Issue 10 of ACM SIGPLAN Notices, October 1998.
  30. ^ Developer.apple.com
  31. ^ Scala runs on the Java Virtual Machine from which it inherits the runtime exception handling.
  32. ^ 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.
  33. ^ 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.
  34. ^ From On the Expressive Power of Programming Languages, Matthias Felleisen, ESOP '90 3rd European Symposium on Programming.
  35. ^ Computer Language Benchmarks Game ranking

Further reading

  • Cezzar, Ruknet. A Guide to Programming Languages: Overview and Comparison. ISBN 978-0-89006-812-0.

External links

(Sebelumnya) Comparison of object database ...Comparison of project-manageme ... (Berikutnya)