Erlang (programming language): Difference between revisions
imported>Eric Evers No edit summary |
imported>Eric Evers No edit summary |
||
Line 2: | Line 2: | ||
''For other uses, see [[erlang (disambiguation)]].'' | ''For other uses, see [[erlang (disambiguation)]].'' | ||
'''erlang''' is a general-purpose, functional [[computer]] [[programming language]] which shares | '''erlang''' is a general-purpose, functional [[computer]] [[programming language]] which shares some syntax with [[prolog]]. It was designed specificly to do parallel programming. | ||
which is used than twenty years after its creation. '''erlang''' was developed in 1987 by [[Joe Armstrong]] and others (then of [[ | which is used than twenty years after its creation. '''erlang''' was developed in 1987 by [[Joe Armstrong]] and others (then of [[Ericsonn]]) for use to program telephone networks. Ref: Joe Armstrong (2003). "Making reliable distributed systems in the presence of software errors". Ph.D. Dissertation. http://www.erlang.org/download/armstrong_thesis_2003.pdf | ||
New versions are released by Ericsson on a yearly basis. A present there is increased interest in parallel programming languages because of the spread of [[multicore]] microprocessor based personal computers. | New versions are released by Ericsson on a yearly basis. A present there is increased interest in parallel programming languages because of the spread of [[multicore]] microprocessor based personal computers. | ||
Line 20: | Line 20: | ||
The [[Hello World]] program (see above) appears in many programming languages books and articles as a cursory introduction into a language's [[syntax]]. It was introduced in the book ''The C Programming Language''<ref name="K&R"/>. | The [[Hello World]] program (see above) appears in many programming languages books and articles as a cursory introduction into a language's [[syntax]]. It was introduced in the book ''The C Programming Language''<ref name="K&R"/>. | ||
<code>-module(hello)</code> tells the [[ | <code>-module(hello)</code> tells the [[compiler]] to create a new module(library) called hello. The code tells us the file name for this code: hello.erl. | ||
<code>-export([start/0]). </code> exports a function named start with 0 arguments to the world outside of this module called hello. | <code>-export([start/0]). </code> exports a function named start with 0 arguments to the world outside of this module called hello. | ||
<code> start() -> </code> tells the compiler that there is a [[function]] named start with no arguments. | <code> start() -> </code> tells the compiler that there is a [[function]] named start() with no arguments. | ||
<code>io:format("Hello, world!\n").</code> will make the program output <code>Hello, world!</code> and a new line (<code>\n</code>) on the screen. | <code>io:format("Hello, world!\n").</code> will make the program output <code>Hello, world!</code> and a new line (<code>\n</code>) on the screen. |
Revision as of 14:01, 29 January 2008
For other uses, see erlang (disambiguation).
erlang is a general-purpose, functional computer programming language which shares some syntax with prolog. It was designed specificly to do parallel programming. which is used than twenty years after its creation. erlang was developed in 1987 by Joe Armstrong and others (then of Ericsonn) for use to program telephone networks. Ref: Joe Armstrong (2003). "Making reliable distributed systems in the presence of software errors". Ph.D. Dissertation. http://www.erlang.org/download/armstrong_thesis_2003.pdf New versions are released by Ericsson on a yearly basis. A present there is increased interest in parallel programming languages because of the spread of multicore microprocessor based personal computers.
Syntax
Hello World
-module(hello). -export([start/0]). start() -> io:format("Hello, world!\n").
Analysis of the example
The Hello World program (see above) appears in many programming languages books and articles as a cursory introduction into a language's syntax. It was introduced in the book The C Programming Language[1].
-module(hello)
tells the compiler to create a new module(library) called hello. The code tells us the file name for this code: hello.erl.
-export([start/0]).
exports a function named start with 0 arguments to the world outside of this module called hello.
start() ->
tells the compiler that there is a function named start() with no arguments.
io:format("Hello, world!\n").
will make the program output Hello, world!
and a new line (\n
) on the screen.
See also
References
- ↑ Cite error: Invalid
<ref>
tag; no text was provided for refs namedK&R