Misplaced Pages

Comparison of programming languages: Difference between revisions

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Browse history interactively← Previous editNext edit →Content deleted Content addedVisualWikitext
Revision as of 05:21, 23 May 2006 editLeedar (talk | contribs)88 edits General comparison← Previous edit Revision as of 05:31, 23 May 2006 edit undoHarmil (talk | contribs)8,207 edits User:-Barry- has been taking heat for injecting these flawed benchmark results in Perl, so he's come here. Good faith credulity is strained.Next edit →
Line 2: Line 2:


There are thousands of programming languages and new ones are created every year. (see ]). Few languages ever become sufficiently popular that they are used by more than a few people, but many professional ]s use dozens of different languages during their career. There are thousands of programming languages and new ones are created every year. (see ]). Few languages ever become sufficiently popular that they are used by more than a few people, but many professional ]s use dozens of different languages during their career.
<br clear="all" />


==General comparison== ==General comparison==
Line 14: Line 13:
! ] ! ]
! Introduced ! Introduced
! ] rank<ref name = "webpop">From the first column of the May, 2006 . Languages are ranked sequentially from most to fewest search engine results using the method described on TIOBE's <i>Definition</i> page:
! ] rank<ref name = "webpop">'''The relevance of the TIOBE data is disputed for anything other than estimating how much internet coverage there is of certain programming languages. It's only included here because of its relation to the subject matter of this article. No value to those seeking a popular programming language is implied by the data's inclusion.'''

The data comes from the first column of the May, 2006 . Languages are ranked sequentially from most to fewest search engine results using the method described on TIOBE's <i>Definition</i> page:


:The ratings are calculated by counting hits of the most popular search engines. The search query that is used is :The ratings are calculated by counting hits of the most popular search engines. The search query that is used is
Line 118: Line 115:
| 10 | 10
| -1 | -1
|-
!{{rh}} | ]
| ]/]
| none
| ], ]
| ]
| 1977
| 38
| ?
|- |-
! {{rh}} | ] ! {{rh}} | ]
Line 340: Line 328:
3. From , Matthias Felleisen, ESOP '90 3rd European Symposium on Programming. 3. From , Matthias Felleisen, ESOP '90 3rd European Symposium on Programming.
</div> </div>
<br clear="all" />

==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 ]. See page about flawed benchmarks and comparisons.
===]===
The module Benchmark.pm comes with Perl. One opinion of it comes from a used in a 2006 talk by ] editor ] that says it "sux." Other for Perl exist on ]. They typically rely on Benchmark.pm.

The following data comes from benchmarks from from May 7, 2006 and benchmarks from May 10, 2006. The Debian and Gentoo tests used equivalent benchmarks, but on Gentoo, some benchmarks had a higher workload, most language implementations were built from source, and <i>Size</i> tests measured GZip bytes instead of lines of code.

<div style = "font-size: 13pt; text-align: center; padding-bottom: 2px; margin-top: 20px;">
Number of tests won (Debian : AMD™ Sempron™ / Gentoo : Intel® Pentium® 4)
</div>
<!-- Would be better if the group of tables below was centered. Don't know how. -->
{| class="wikitable" align = "left" style = "font-size: 10pt; background-color: rgb(245,245,245); margin-top: 39px; font-weight: bold;"
|-
|-
| Speed
|-
| Memory
|-
| Size
|-
|}

{| class="wikitable" align = "left" style = "font-size: 10pt;"
|-
! Perl !! C (gcc)
|-
| 1/1 || 12/15
|-
| 0/1 || 13/15
|-
| 11/14 || 2/2
|-
|}

{| class="wikitable" align = "left" style = "font-size: 10pt;"
|-
! Perl !! C++ (g++)
|-
| 0/2 || 14/12
|-
| 0/0 || 14/14
|-
| 10/14 || 4/0
|-
|}

{| class="wikitable" align = "left" style = "font-size: 10pt;"
|-
! Perl !! Java JDK Server
|-
| 3/3 || 13/13
|-
| 12/12 || 4/4
|-
| 13/16 || 2/0
|-
|}

{| class="wikitable" align = "left" style = "font-size: 10pt;"
|-
! Perl !! PHP
|-
| 9/8 || 4/6
|-
| 10/10 || 3/5
|-
| 10/11 || 3/4
|-
|}

{| class="wikitable" align = "left" style = "font-size: 10pt;"
|-
! Perl !! Python
|-
| 5/7 || 11/9
|-
| 8/8 || 8/8
|-
| 6/3 || 9/13
|-
|}

{| class="wikitable" align = "left" style = "font-size: 10pt;"
|-
! Perl !! Ruby
|-
| 14/14 || 2/2
|-
| 10/9 || 6/7
|-
| 8/2 || 6/14
|-
|}
<br clear="all" /> <br clear="all" />



Revision as of 05:31, 23 May 2006

Programming languages are used for controlling the behavior of a machine (often a computer). Like human languages programming languages have syntactic and semantic rules used to define meaning.

There are thousands of programming languages and new ones are created every year. (see list of programming languages). Few languages ever become sufficiently popular that they are used by more than a few people, but many professional programmers use dozens of different languages during their career.

General comparison

The following table compares general and technical information for a selection of programming languages. See the individual languages' articles for further information.

Language General model of execution Influences Paradigm(s) Typing discipline Introduced SERP rank SERP rank change (1 yr)
Ada Compilation Algol, Pascal, C++ (Ada 95), Smalltalk (Ada 95) concurrent, distributed, generic, imperative, object-oriented static, strong, safe, nominative 1983 18 0
C Compilation Algol, B imperative, flow-driven static, weak 1973 2 -1
C++ Compilation C, Simula, Algol 68 imperative, object-oriented, generic static, weak 1980 3 +1
C# JIT compilation Java, C++ object-oriented static, strong, both safe and unsafe, nominative 2000 7 0
COBOL Compilation FLOW-MATIC imperative, object-oriented weak 1959 15 -1
ColdFusion Compilation HTML procedural, functional, object-oriented dynamic (duck), weak 1995 16 +9
Common Lisp Compilation Lisp, Smalltalk functional, object-oriented dynamic 1984 14 +1
D Compilation C , C++, Java, C# imperative, object-oriented, generic strong 2000 19 +8
Delphi Compilation Pascal, Object Pascal imperative, object-oriented static, strong, safe (but unsafe allowed), nominative 1995 10 -1
Java Interpretation/JIT compilation/Dynamic compilation C++, Objective-C object-oriented static, strong 1996 1 +1
JavaScript Interpretation C, LiveScript imperative, object-oriented, functional dynamic 1995 9 +2
Mathematica Interpretation Lisp functional, procedural dynamic, strong 1986 >50 ?
Objective-C Compilation/JIT compilation C, Smalltalk object-oriented dynamic, strong 1986 49 ?
Objective-Caml Compilation ML, Lisp object-oriented, functional static, safe, structural, type inference 1980's? ? ?
Perl Interpretation C, shell, awk, sed, Lisp functional, object-oriented, procedural dynamic 1987 6 -3
PHP Interpretation Perl, C imperative, object-oriented dynamic, weak 1995 4 +1
Python Interpretation ABC, Perl, Modula-3 imperative, object-oriented, functional dynamic (duck), strong 1991 8 0
Ruby Interpretation Smalltalk, Perl imperative, object-oriented, functional, concurrent dynamic (duck), strong 1995 20 +10
Scheme Interpretation Lisp, Algol 60 functional dynamic 1975 14 +1
Smalltalk JIT compilation Sketchpad, Simula object-oriented, functional, concurrent, event-driven, imperative, declarative dynamic, strong, safe, duck 1971 35 ?
Visual Basic Compilation QuickBASIC event-driven static/dynamic hybrid, weak/strong hybrid, safe, nominative 1991 5 +1
Visual Basic .NET JIT compilation Visual Basic object-oriented, event-driven static, strong 2001 17 +11
  1. From the first column of the May, 2006 TIOBE Programming Community Index. Languages are ranked sequentially from most to fewest search engine results using the method described on TIOBE's Definition page:
    The ratings are calculated by counting hits of the most popular search engines. The search query that is used is
    +"<language> programming" -tv -channel
    The search query is executed for the regular Google, MSN, and Yahoo! web search and the Google newsgroups for the last 12 months. The web site Alexa.com has been used to determine the most popular search engines. The word "tv" and "channel" have been filtered out here to avoid any interference with TV programs. Otherwise languages such as ABC and Scheme would have been highly overrated.
    By applying the search engine query as defined above, a lot of hit counts are collected. Let's define "hits(PL#i,SE)" as the number of hits of programming language PL at position i of the TPC index for search engine SE. The counted hits are normalized for each search engine for the first 50 languages. More formally, the rating for PL#i becomes
    ((hits(PL#i,SE1)/hits(PL#1) + ... + hits(PL#50)) + ... + (hits(PL#i,SEn)/hits(PL#1) + ... + hits(PL#50)))/n
    In determining search engine result count for a language, the language may include or exclude certain dialects or other languages. See what's included or excluded in the Exceptions and inclusions chart below.
  2. From the Delta in Position column of the May, 2006 TIOBE Programming Community Index. This number indicates the language's change in SERP rank (see above footnote) over the last year. In determining the SERP rank change for a language, the language may include or exclude certain dialects or other languages. See what's included or excluded in the Exceptions and inclusions chart below.
Exceptions and inclusions
Exceptions and inclusions used in determining SERP rank
Language Exceptions/Inclusions
Awk Included: awk, gawk, mawk, nawk
C# Included: C#, C-Sharp, C Sharp
ColdFusion Included: ColdFusion, Cold Fusion, CFMX, CFML
D Exception: "3-D Programming"
Delphi/Kylix Included: Delphi, Kylix
IDL Exception: "corba"
Lisp/Scheme Included: Lisp, Scheme
Python Included: Python, Jython, IronPython (Jan Persson)
T-SQL Included: T-SQL, Transact-SQL
Tcl/Tk Included: Tcl/Tk, Tcl, Tk
VB.NET Included: VB.NET, Visual Basic.NET, Visual Basic .NET, Visual Basic 2005, VB 2005
Visual FoxPro Included: FoxPro, Fox Pro, VFP

Expressiveness

Language Statements
ratio
Lines
ratio
Expressiveness relative to C
C++ 2.5 1
Fortran 2 .8
Java 2.5 1.5
Perl 6 6
Python 6 6.5
Smalltalk 6 .625
MS Visual Basic 4.5 ?

The literature on programming languages contains an abundance of informal claims about their relative expressive power, but there's no framework for formalizing such statements nor for deriving interesting consequences. This chart provides two measures of expressiveness from two different sources. An additional measure of expressiveness, in GZip bytes, can be found with the Compare to tool on the Gentoo : Intel® Pentium® 4 page of http://shootout.alioth.debian.org.

1. Data from Code Complete. 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."

2. The ratio of line count tests won by each language to the number won by C when using the Compare to feature at http://shootout.alioth.debian.org/debian/c.php. 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.

3. From On the Expressive Power of Programming Languages, Matthias Felleisen, ESOP '90 3rd European Symposium on Programming.


See also

External Links

Stub icon

This programming-language-related article is a stub. You can help Misplaced Pages by expanding it.

Categories: