Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove trailing whitespace

  • Loading branch information...
commit 645ba42be1fa0be426a1640be7c916b75154d4a2 1 parent 0fecc30
@matthiasl authored
View
218 academic.xml
@@ -21,19 +21,19 @@
</p></section>
<section><title>Who invented Erlang?</title>
<p>
- During the 1980s there was a project at the Ericsson
- <url href="http://www.cs-lab.org/">
+ During the 1980s there was a project at the Ericsson
+ <url href="http://www.cs-lab.org/">
Computer Science Laboratory</url>
- which aimed to find out what aspects of computer languages
- made it easier to program telecommunications systems. Erlang
- emerged in the second half of the 80s was the result of
- taking those features which made writing such systems
- simpler and avoiding those which made them more complex
+ which aimed to find out what aspects of computer languages
+ made it easier to program telecommunications systems. Erlang
+ emerged in the second half of the 80s was the result of
+ taking those features which made writing such systems
+ simpler and avoiding those which made them more complex
or error prone.
</p><p>
The people involved at the start were Joe Armstrong,
- Robert Virding and Mike Williams. Others joined later
+ Robert Virding and Mike Williams. Others joined later
and added things like distribution and OTP.
</p></section>
@@ -52,14 +52,14 @@
for Ericsson!)
</p><p>
- <em>Nothing to lose</em>: Ericsson's core business is
- telecommunications products, selling programming
+ <em>Nothing to lose</em>: Ericsson's core business is
+ telecommunications products, selling programming
tools is not really a business Ericsson is interested in.
</p><p>
<em>Stimulate adoption</em>: Erlang is a great
- language for many sorts of systems. Releasing a
- good, free development environment is likely to
+ language for many sorts of systems. Releasing a
+ good, free development environment is likely to
make Erlang catch on faster.
</p><p>
@@ -82,7 +82,7 @@
The more people we have using Erlang, the better quality
the product becomes, the more cool applications we get
and the more libraries are added to Erlang. Volunteers have
- already fixed several important bugs, created a
+ already fixed several important bugs, created a
<url href="http://www.debian.org/">Debian GNU/Linux</url>
package and ported Erlang to new platforms.
</p><p>
@@ -92,7 +92,7 @@
<section><marker id="soft-realtime"/>
<title>What does soft realtime mean?</title>
<p>
-
+
Cynics will say "basically nothing".
</p><p>
@@ -101,20 +101,20 @@
always be carried out in less than a certain time. Many simple
embedded systems can make hard realtime guarantees, e.g.
it is possible to guarantee that a particular interrupt
- service routine on a Z80 CPU will never take more than
+ service routine on a Z80 CPU will never take more than
34us. It gets progressively harder to make such guarantees for
more complex systems.
</p><p>
- Many telecomms systems have less strict requirements, for
- instance they might require a statistical guarantee
- along the lines of "a database lookup takes less than 20ms
+ Many telecomms systems have less strict requirements, for
+ instance they might require a statistical guarantee
+ along the lines of "a database lookup takes less than 20ms
in 97% of cases". Soft realtime
systems, such as Erlang, let you make that sort of guarantee.
</p><p>
A rule of thumb is that it is straightforward to write
- Erlang programs which can respond to
+ Erlang programs which can respond to
external events within a few milliseconds.
The parts of Erlang which help with this are:
</p>
@@ -128,8 +128,8 @@
<item><p>Erlang processes are very lightweight, much lighter
than an operating system thread. Switching
- between Erlang processes is typically an order
- of magnitude or two faster than switching between
+ between Erlang processes is typically an order
+ of magnitude or two faster than switching between
OS threads.
</p></item>
@@ -158,7 +158,7 @@
<quote>
<p>
Then I wrote a compiler from Erlang to JAM
- and an emulator to see if the machine worked.
+ and an emulator to see if the machine worked.
Both these were written in prolog.
</p>
</quote>
@@ -171,13 +171,13 @@
<quote>
<p>
- Then I rewrote the erlang-to-jam compiler in Erlang and
- used the prolog compiler to compile it. The resultant
+ Then I rewrote the erlang-to-jam compiler in Erlang and
+ used the prolog compiler to compile it. The resultant
object code was run in the C emulator. Then we threw away prolog.
</p>
</quote>
<p>
- Some of this is described in <url
+ Some of this is described in <url
href="http://www.erlang.se/publications/prac_appl_prolog.ps">
an old paper</url>
@@ -185,7 +185,7 @@
<section><title> Erlang Syntax and Semantics Details</title>
<p>
- When in doubt about exactly what the language allows or does,
+ When in doubt about exactly what the language allows or does,
the best place to start is the
<url href="http://www.erlang.org/download/erl_spec47.ps.gz">
Erlang Specification</url>. This is still a work
@@ -197,13 +197,13 @@
Yes, but only within one process.
</p><p>
- If there is a live process and you send it message A and then
+ If there is a live process and you send it message A and then
message B, it's guaranteed that if message B arrived, message
A arrived before it.
</p><p>
- On the other hand, imagine processes P, Q and R. P sends
- message A to Q, and then message B to R. There is no
+ On the other hand, imagine processes P, Q and R. P sends
+ message A to Q, and then message B to R. There is no
guarantee that A arrives before B. (Distributed Erlang would
have a pretty tough time if this was required!)
</p>
@@ -222,18 +222,18 @@
<quote>
<p>
- "Delivery is guaranteed if nothing breaks" - and if something
+ "Delivery is guaranteed if nothing breaks" - and if something
breaks, you will find
- out provided you've used <c>link/1</c>. I.e.
- you will get an <c>EXIT</c> signal
+ out provided you've used <c>link/1</c>. I.e.
+ you will get an <c>EXIT</c> signal
not only if the linked process dies, but
- also if the entire remote node crashes, or the network is
- broken, or if any of these happen <em>before</em>
+ also if the entire remote node crashes, or the network is
+ broken, or if any of these happen <em>before</em>
you do the link.
</p><p>
It seems this issue of "guaranteed delivery" comes up every
- now and then, but I've never managed to find out exactly what
+ now and then, but I've never managed to find out exactly what
it is those that are asking for it actually want:
</p>
</quote>
@@ -241,31 +241,31 @@
<list>
<item><p>
A guarantee that the message is put into the receiver's
- input queue? But if the receiver dies before extracting
- it from there, that guarantee is useless, as the message
+ input queue? But if the receiver dies before extracting
+ it from there, that guarantee is useless, as the message
is lost anyway.
</p></item>
<item><p> A guarantee that the receiver extracts the message from its
input queue? Well, besides the obvious problem that
- depending on how the receiver is written, even if
+ depending on how the receiver is written, even if
it lives happily ever after it may <em>never
- </em> extract
+ </em> extract
that particular message, it suffers from a variant of
- the previous problem: Even if you "know" that the
- receiver has "consumed" the message, it may die before
- acting on it in any way, and then again it may as well
+ the previous problem: Even if you "know" that the
+ receiver has "consumed" the message, it may die before
+ acting on it in any way, and then again it may as well
never have been sent.
</p></item>
- <item><p> A guarantee that the receiver actually
+ <item><p> A guarantee that the receiver actually
<em>processes</em>
- the message? Just kidding of course, hopefully it's
- obvious to everyone that the only way to obtain such
+ the message? Just kidding of course, hopefully it's
+ obvious to everyone that the only way to obtain such
a guarantee, regardless of what programming and
- communication system you use, is that the receiver
- is programmed to send an explicit acknowledgment
- when the processing is complete (of course this may
+ communication system you use, is that the receiver
+ is programmed to send an explicit acknowledgment
+ when the processing is complete (of course this may
be hidden below an abstraction such as RPC, but the
fundamental principle holds).
</p></item>
@@ -273,7 +273,7 @@
<quote>
<p>
- Add to this that any guarantee would <em>have</em>
+ Add to this that any guarantee would <em>have</em>
to entail some
form of ack from the remote in at least a distributed
system, even if it wasn't directly visible to the
@@ -281,11 +281,11 @@
comes back from the remote saying that the message had
progressed however far you required - i.e. synchronous
communication of sorts. But this would penalize those that
- <em>don't</em> require the "guarantee" and
+ <em>don't</em> require the "guarantee" and
<em>want</em> asynchronous communication.
</p><p>
- So, depending on your requirements, Erlang offers you
+ So, depending on your requirements, Erlang offers you
<em>at least</em> these levels of "guarantee":
</p>
</quote>
@@ -294,10 +294,10 @@
<title>Super-safe</title>
<p>
- Receiver sends ack after processing;
+ Receiver sends ack after processing;
sender links, sends, waits for <c>ack</c>
or <c>EXIT</c>.
- This means the sender knows, for each message, whether
+ This means the sender knows, for each message, whether
it was fully processed or not.
</p>
</section>
@@ -305,7 +305,7 @@
<section>
<title>Medium-safe</title>
<p>
- Receiver doesn't send acks; Sender links,
+ Receiver doesn't send acks; Sender links,
sends message(s). This means an <c>EXIT</c>
signal informs the sender that some messages may never have
been processed.
@@ -322,13 +322,13 @@
<quote>
<p>
There are any number of combinations of these (e.g. receiver sends
- ack not after each message but at some critical points in the
+ ack not after each message but at some critical points in the
processing).
</p>
</quote>
<p>
- Per concluded by pointing out that "if you think TCP guarantees
+ Per concluded by pointing out that "if you think TCP guarantees
delivery, which most people probably do, then so does Erlang".
</p></section>
@@ -338,18 +338,18 @@
The Erlang language doesn't specify any limits, but
different implementations have different limits on the
number of processes, the maximum amount of RAM and so on.
- These are
+ These are
<url href="http://erlang.org/doc/efficiency_guide/advanced.html#9.2">documented for each implementation</url>.
</p></section>
<section><title>Do funs behave during a code change?</title>
<p>
- Yes and no. A fun is a reference to code; it is not the
+ Yes and no. A fun is a reference to code; it is not the
code itself. Thus a fun can only be evaluated if the code
it refers to is actually loaded on the evaluating node.
In some cases, we can be sure that execution will never
- return to a fun. In these cases the old code can be purged
+ return to a fun. In these cases the old code can be purged
without problems. The following code causes no surprises:
</p>
@@ -374,13 +374,13 @@
spawn(fun() -> loop(F) end).
loop(F) ->
- timer:sleep(1000),
+ timer:sleep(1000),
F(),
cc:loop(F).
]]></code>
<p>
- This type of problem can be solved in the
+ This type of problem can be solved in the
<c>code_change/2</c> function in the standard behaviours.
</p></section>
@@ -390,16 +390,16 @@
</p>
<list>
- <item><p>Mnesia. If you store funs in mnesia, you need to
+ <item><p>Mnesia. If you store funs in mnesia, you need to
have a way to update the table (i.e. replace the
fun references) when you load code.</p></item>
<item><p>Serialisation. The same deal. If you serialise a
fun (e.g. <c>term_to_binary/1</c>) and
then unserialise it, you can only evaluate the fun
- if the code it refers to still exists. In general,
+ if the code it refers to still exists. In general,
serialising a fun, saving it to a file and then
- loading it in another emulator will not do what you
+ loading it in another emulator will not do what you
hoped.</p></item>
<item><p>Message passing. Sending a fun to a remote node
@@ -415,13 +415,13 @@
</p></section>
<section><title>Is it just me, or are records ugly?</title>
<p>
- Compared to the rest of Erlang, records are rather
- ugly and error prone. They're ugly because they
+ Compared to the rest of Erlang, records are rather
+ ugly and error prone. They're ugly because they
require an awful lot of typing (no pun intended).
They're error prone because the usual method of defining
- records, the <c>-include</c> directive,
- provides no protection against multiple, incompatible
- definitions of records.
+ records, the <c>-include</c> directive,
+ provides no protection against multiple, incompatible
+ definitions of records.
</p><p>
Several ways forward have been explored. One is lisp-like
@@ -431,7 +431,7 @@
Another is Richard O'Keefe's <em>abstract patterns</em> which
is an <url
- href="http://www.erlang.org/eeps/eep-0029.html">Erlang Enhancement
+ href="http://www.erlang.org/eeps/eep-0029.html">Erlang Enhancement
Proposal</url>.
Then there is also a suggestion for <url href="http://erlang.org/pipermail/erlang-questions/2005-September/017201.html">making records more reliable</url>.
@@ -466,9 +466,9 @@
The following "questions" all relate to topics which have
generated long discussions in public forums, often with
- some amount of stepping on people's toes. If you're going
- to post a news article (or write a report, or...) about any
- of these, reading the answers here might help you avoid
+ some amount of stepping on people's toes. If you're going
+ to post a news article (or write a report, or...) about any
+ of these, reading the answers here might help you avoid
some arguments we've already been through.
</p></section>
@@ -483,7 +483,7 @@
of problems the Dialyzer can find.
</p>
<p>
- Until about 2005, static type checking was used rarely in
+ Until about 2005, static type checking was used rarely in
commercial Erlang-based systems. Several people experimented
with various approaches to the problem, including Sven-Olof
Nyström, Joe Armstrong, Philip Wadler, Simon Marlow and
@@ -525,7 +525,7 @@ Java/Python/C/C++/Haskell?</title>
</section>
<section><title>
-Why do we have to have yet another programming language; C++ (or Java,
+Why do we have to have yet another programming language; C++ (or Java,
or Visual Basic) does everything.
</title>
<p>
@@ -536,10 +536,10 @@ or Visual Basic) does everything.
</p><p>
On the other hand, we'd hope that some tools are better for
- some things than other tools. Erlang was born from systematic
+ some things than other tools. Erlang was born from systematic
experiments to determine what would make a language good
- at solving telecommunications-related problems, and
- empirical evidence from large projects within Ericsson
+ at solving telecommunications-related problems, and
+ empirical evidence from large projects within Ericsson
suggests that Erlang succeeded in doing that.
</p><p>
@@ -565,16 +565,16 @@ or Visual Basic) does everything.
</p><p>
A common conservative position is to say that processes,
- asynchronous messages, functions and modules provide the
- same ability to structure systems as do threads, classes,
+ asynchronous messages, functions and modules provide the
+ same ability to structure systems as do threads, classes,
methods, inheritance and aggregation.
</p><p>
An aggressive position is to say that OO is just
snake oil, that inheritance is error prone and
that any system which doesn't model concurrent problems
- with concurrency in the program is defective. Taking
- this position in newsgroups/mailing lists tends to trigger
+ with concurrency in the program is defective. Taking
+ this position in newsgroups/mailing lists tends to trigger
a flamewar.
</p>
@@ -586,10 +586,10 @@ or Visual Basic) does everything.
<marker id="string-performance"/>
<title>How are strings implemented and how can I speed up my string code?</title>
<p>
- Strings are represented as linked lists, so each character
+ Strings are represented as linked lists, so each character
takes 8 octets of memory on a 32 bit machine, twice as much on a 64
- bit machine. Access to the Nth element is O(N). This makes it
- easy to accidentally write O(N^2) code. Here's an example of
+ bit machine. Access to the Nth element is O(N). This makes it
+ easy to accidentally write O(N^2) code. Here's an example of
how that can happen:
</p>
@@ -604,7 +604,7 @@ or Visual Basic) does everything.
]]></code>
<p>
- The bit-syntax provides an alternative way of handling
+ The bit-syntax provides an alternative way of handling
strings with different space/time tradeoffs to the
list implementation.
</p>
@@ -623,14 +623,14 @@ or Visual Basic) does everything.
</p></item>
<item><p>Consider using an alternative representation of
- your data, e.g. instead of representing the text as a
+ your data, e.g. instead of representing the text as a
list of characters, it may be better to represent it as
a tree of words.
</p></item>
- <item><p>If you're reading and writing data from sockets,
- consider using binaries instead of lists of bytes. If
- all you're doing is copying data from one socket to
+ <item><p>If you're reading and writing data from sockets,
+ consider using binaries instead of lists of bytes. If
+ all you're doing is copying data from one socket to
another, this will be (much) faster. More generally,
the bit-syntax provides an alternative way of handling
strings with different space/time tradeoffs to the list
@@ -638,13 +638,13 @@ or Visual Basic) does everything.
</p></item>
- <item><p>Write speed-critical (profile first!) code in C,
- and then put it in your erlang system as a port-driver or a
+ <item><p>Write speed-critical (profile first!) code in C,
+ and then put it in your erlang system as a port-driver or a
linked-in driver.
</p></item>
- <item><p>Ports (and sockets) flatten lists for you,
- so flattening lists yourself slows things down.
+ <item><p>Ports (and sockets) flatten lists for you,
+ so flattening lists yourself slows things down.
This can also be used to create more readable code:
</p>
<code><![CDATA[
@@ -662,16 +662,16 @@ gen_tcp:send(Socket, ["GET ", Url, " HTTP/1.0", "\r\n\r\n"]).
own heap and these are collected individually, so
although every process is stopped while GC happens
for one processes, this stop time is expected to
- be short because each process is expected to have a
+ be short because each process is expected to have a
small heap.
</p><p>
The GC for a new process is full-sweep. Once the process'
- live data grows above a certain size, the GC switches to
+ live data grows above a certain size, the GC switches to
a generational strategy. If the generational strategy
reclaims less than a certain amount, the GC reverts
to a full sweep. If the full sweep also fails to recover
- enough space, then the heap size is increased.
+ enough space, then the heap size is increased.
</p><p>
In practice, this works quite well. It scales well
@@ -694,7 +694,7 @@ gen_tcp:send(Socket, ["GET ", Url, " HTTP/1.0", "\r\n\r\n"]).
<section><title>Can I exploit knowledge about my program to make the GC more efficient?</title>
<p>
Maybe, but you might be better off expending effort on
- thinking of other ways to make your system go faster.
+ thinking of other ways to make your system go faster.
</p><p>
One version of <c>spawn/4</c> accepts a list of
@@ -710,15 +710,15 @@ gen_tcp:send(Socket, ["GET ", Url, " HTTP/1.0", "\r\n\r\n"]).
<c>min_heap_size</c> can be useful when you <em>know</em> that a
certain process will rapidly grow its heap to well above
the system's default size. Under such circumstances you get
- particularly bad GC performance with the current GC
+ particularly bad GC performance with the current GC
implementation.
</p><p>
- <c>gc_switch</c> affects the point at
+ <c>gc_switch</c> affects the point at
which the garbage collector
changes from its full-sweep algorithm to its generational
algorithm. Again, in a rapidly growing heap which doesn't
- contain many binaries, GC <em>might</em> perform
+ contain many binaries, GC <em>might</em> perform
better with a higher threshold.
</p><p>
@@ -741,7 +741,7 @@ gen_tcp:send(Socket, ["GET ", Url, " HTTP/1.0", "\r\n\r\n"]).
</p><p>
There is an active research group looking at problems
- related to formal verification, they have a
+ related to formal verification, they have a
<url href="http://www.sics.se/fdt/">home page</url>.
</p></section>
@@ -749,15 +749,15 @@ gen_tcp:send(Socket, ["GET ", Url, " HTTP/1.0", "\r\n\r\n"]).
<p>
The <url href="http://www.erlang.se/doc/programming_rules.shtml">
- Erlang coding guidelines</url> suggest avoiding defensive
- programming. The choice of the term "defensive programming"
+ Erlang coding guidelines</url> suggest avoiding defensive
+ programming. The choice of the term "defensive programming"
is unfortunate, because it is usually associated with good
practice. The point of the recommendation is that allowing
an Erlang process to exit when things go wrong inside the
- Erlang program is a <em>good</em> approach, i.e.
+ Erlang program is a <em>good</em> approach, i.e.
writing code which attempts to avoid an exit is usually a bad idea.
</p><p>
- For example, when parsing an integer it makes perfect
+ For example, when parsing an integer it makes perfect
sense to just write
</p>
@@ -765,7 +765,7 @@ gen_tcp:send(Socket, ["GET ", Url, " HTTP/1.0", "\r\n\r\n"]).
I = list_to_integer(L)
]]></code>
<p>
- if L is not an integer, the process will exit and a supervisor
+ if L is not an integer, the process will exit and a supervisor
somewhere will restart that part of the system, reporting an
error:
</p>
@@ -787,7 +787,7 @@ gen_tcp:send(Socket, ["GET ", Url, " HTTP/1.0", "\r\n\r\n"]).
<code><![CDATA[
uppercase_ascii(C) when C >= $a, C =< $z ->
C - ($a - $A);
- uppercase_ascii(X) ->
+ uppercase_ascii(X) ->
exit({"uppercase_ascii given non-lowercase argument", X}).
]]></code>
<p>
@@ -799,7 +799,7 @@ gen_tcp:send(Socket, ["GET ", Url, " HTTP/1.0", "\r\n\r\n"]).
example is the case where input is coming from an untrusted
interface, e.g. a user or an external program.
</p><p>
- Joe's
+ Joe's
<url href="http://erlang.org/pipermail/erlang-questions/2003-March/007870.html">original explanation</url> is available online.
</p>
View
2  faq.xml
@@ -10,7 +10,7 @@
</header>
<description>
- <p>A list of frequently asked questions (FAQ) and answers for
+ <p>A list of frequently asked questions (FAQ) and answers for
the Erlang programming language.</p>
</description>
View
14 faq_questions.xml
@@ -12,7 +12,7 @@
<section><title>Where can I get the latest version of the FAQ?</title>
<p>
- The <url href="http://www.erlang.org/faq/faq.html">
+ The <url href="http://www.erlang.org/faq/faq.html">
open source Erlang website </url>.
</p>
</section>
@@ -37,7 +37,7 @@
<section><title>The answer to question 2.4 is wrong!</title>
<p>
If you've found an editorial error in the FAQ (broken link,
- an addition to a list of links, typo, ambiguity, badly
+ an addition to a list of links, typo, ambiguity, badly
expressed answer, etc.), send some mail to
<url href="mailto:matthias@corelatus.com">
matthias@corelatus.com</url> and I'll fix it. Alternatively,
@@ -49,8 +49,8 @@
<p>
Problems along the lines of "the advice about
the importance of type checking is complete drivel" might
- be of general interest on the <em>erlang-questions</em>
- mailing list at <url
+ be of general interest on the <em>erlang-questions</em>
+ mailing list at <url
href="mailto:erlang-questions@erlang.org?subject=besserwisser">
erlang-questions@erlang.org</url>.
</p>
@@ -59,15 +59,15 @@
<section><title>Disclaimer/Distribution</title>
<p>
The information in this document is available free of charge in the
- hope that it will be of use. However, the author specifically
- disclaims any liability for any direct, indirect, or consequential
+ hope that it will be of use. However, the author specifically
+ disclaims any liability for any direct, indirect, or consequential
damages arising out of its use. The author grants permission to
distribute this FAQ in unmodified form on any medium.
</p>
<p>
Opinions in this FAQ do not necessarily agree with Ericsson's
- official opinions. The
+ official opinions. The
<url href="http://www.corelatus.com/~matthias">maintainer</url>
no longer works for Ericsson and this FAQ is not an Ericsson product.
</p>
View
36 getting_started.xml
@@ -15,9 +15,9 @@
It depends. (did you expect anything else?)
</p><p>
- With an imperative language background (e.g. C, Python, Java, C++,
+ With an imperative language background (e.g. C, Python, Java, C++,
Pascal, PERL, etc.),
- it takes most people about a week before they can write
+ it takes most people about a week before they can write
nontrivial programs, about a month to feel really comfortable
and a few months before feeling ready to take on something
big by themselves. It helps a lot to have someone who knows
@@ -50,7 +50,7 @@
used as tutorials. </p><p>
The Erlang distribution includes a step-by-step <em>getting
- started</em> guide. This is also
+ started</em> guide. This is also
<url href="http://www.erlang.org/starting.html">online</url>.
</p><p>
@@ -67,7 +67,7 @@
</p><p>
Many <seealso marker="introduction#universities">universities
- </seealso> run
+ </seealso> run
courses either partly or wholly about Erlang. Courses about
functional programming are also useful for getting a solid
grounding which will then let you easily learn Erlang by yourself.
@@ -88,8 +88,8 @@
<p>
To compile this, save it in a file called <c>hello.erl</c> and
- compile it from the erlang shell. Don't forget the full-stop
- ("period" in American English) at the end of each command, as shown:
+ compile it from the erlang shell. Don't forget the full-stop
+ ("period" in American English) at the end of each command, as shown:
</p>
<pre>
@@ -101,9 +101,9 @@
</pre>
<p>
- (on unix systems you start the erlang shell by typing "erl" at the
+ (on unix systems you start the erlang shell by typing "erl" at the
command line. On Windows, open a command prompt window and
- type "werl", or find the Erlang icon in the programs menu).
+ type "werl", or find the Erlang icon in the programs menu).
To run the program from the Erlang shell:
</p>
@@ -119,7 +119,7 @@
To shut a system down cleanly, use <c>init:stop().</c>
</p><p>
- Some quick ways are evaluating <c>halt().</c> or
+ Some quick ways are evaluating <c>halt().</c> or
<c>Control+\</c>.
</p><p>
@@ -130,24 +130,24 @@
<section><title>Why does Erlang print "ok" after my program's output?</title>
<p>
- The Erlang shell works by <em>r</em>eading an
+ The Erlang shell works by <em>r</em>eading an
Erlang expression,
- <em>e</em>valuating it,
- <em>p</em>rinting the result and
+ <em>e</em>valuating it,
+ <em>p</em>rinting the result and
<em>l</em>ooping
for another expression, i.e. a REPL shell.
</p><p>
- The <c>io:fwrite()</c> function does two things.
- It prints out "hello world" and it returns the value
+ The <c>io:fwrite()</c> function does two things.
+ It prints out "hello world" and it returns the value
<c>ok</c>.
</p><p>
So, when you execute <c>io:fwrite("hello, world\n")
- </c> in the shell, the <c>fwrite</c>
- function prints the first line and the shell prints the return
- value, <c>ok</c>. This can be
- avoided by <seealso marker="how_do_i#noshell"> running
+ </c> in the shell, the <c>fwrite</c>
+ function prints the first line and the shell prints the return
+ value, <c>ok</c>. This can be
+ avoided by <seealso marker="how_do_i#noshell"> running
Erlang without a shell</seealso>.
</p>
</section>
View
106 how_do_i.xml
@@ -17,7 +17,7 @@
Erlang manuals, but sometimes we just want a quick answer...
</p><p>
- Keep in mind that the program fragments are intended to
+ Keep in mind that the program fragments are intended to
illustrate an idea, not serve as re-useable, robust modules!
</p>
@@ -25,7 +25,7 @@
<section><title>...compare numbers?</title>
<p>
- The operators for comparing numbers are <c> &gt;, &gt;=, &lt;,
+ The operators for comparing numbers are <c> &gt;, &gt;=, &lt;,
=&lt;, == and =/= </c>. Some of these are a little different
to C for historical reasons. Here are some examples:
</p>
@@ -34,7 +34,7 @@
Eshell V4.9.1 (abort with ^G)
1> 13 > 2.
true
- 2> 18.2 >= 19.
+ 2> 18.2 >= 19.
false
3> 3 == 3.
true
@@ -75,7 +75,7 @@
does prepending a character.
</p><p>
- The bit-syntax, which is described in <url
+ The bit-syntax, which is described in <url
href="http://www.erlang.org/doc/reference_manual/expressions.html#6.16">
the manual</url> provides an alternative, but somewhat
limited, way to represent strings compactly, for instance:
@@ -94,7 +94,7 @@
"ing"
]]></pre>
<p>
- This style of pattern-matching manipulation of strings
+ This style of pattern-matching manipulation of strings
provides O(1) equivalents of some string operations which are
O(N) when using the list representation. Some other operations
which are O(1) in the list representation become O(N) when
@@ -102,7 +102,7 @@
</p><p>
There are general ways to
- <seealso marker="academic#string-performance">improve
+ <seealso marker="academic#string-performance">improve
string performance.</seealso>
</p></section>
@@ -111,7 +111,7 @@
<pre>
1> string:to_lower("Five Boxing WIZARDS").
"five boxing wizards"
- 2> string:to_upper("jump QuickLY").
+ 2> string:to_upper("jump QuickLY").
"JUMP QUICKLY"
</pre>
@@ -135,7 +135,7 @@
<p>
See also <c>file:consult/1</c>
</p></section>
-
+
<section><title>...use unicode/UTF-8?</title>
<p>
@@ -146,7 +146,7 @@
</p><p>
In practice, supporting unicode means a bit more, for instance
- being able to read unicode from a file and being able to sort
+ being able to read unicode from a file and being able to sort
unicode strings.
</p><p>
@@ -168,11 +168,11 @@
<!-- REVISIT: I should read Joe's book and find a relevant passage there instead -->
</p><p>
- Having said that, there are common methods to achieve
+ Having said that, there are common methods to achieve
effects similar to destructive update: store the data
in a process (use messages to manipulate it), store the data
in ETS or use a data structure designed
- for relatively cheap updates (the <c>dict</c> library
+ for relatively cheap updates (the <c>dict</c> library
module is one common solution).
</p></section>
@@ -180,10 +180,10 @@
<marker id="noshell"/>
<title>...run an Erlang program directly from the unix shell?</title>
<p>
- As of Erlang/OTP R11B-4, you can run Erlang code without
+ As of Erlang/OTP R11B-4, you can run Erlang code without
compiling by using Escript. The <url href="http://www.erlang.org/doc/man/escript.html">manual page</url> has a
complete example showing how to do it.
-
+
</p><p>
Escript is intended for short, "script-like" programs. A more
general way to do it, which also works for older Erlang releases,
@@ -195,12 +195,12 @@
-module(hello).
-export([hello_world/0]).
- hello_world() ->
+ hello_world() ->
io:fwrite("hello, world\n").
</code>
<p>
- Save this as <c>hello.erl</c>, compile it and
+ Save this as <c>hello.erl</c>, compile it and
run it directly from the unix (or msdos) command line:
</p>
@@ -216,7 +216,7 @@
Erlang has several mechanisms for communicating with programs
written in other languages, each with different tradeoffs. The
- Erlang documentation includes a
+ Erlang documentation includes a
<url href=
"http://www.erlang.org/doc/tutorial/users_guide.html">
guide to interfacing with other languages</url> which describes
@@ -226,7 +226,7 @@
<list>
<item><p>Distributed Erlang</p></item>
<item><p>Ports and linked-in drivers</p></item>
- <item><p>EI (C interface to Erlang, replaces the
+ <item><p>EI (C interface to Erlang, replaces the
mostly deprecated erl_interface)</p></item>
<item><p>Jinterface (Java interface to Erlang)</p></item>
<item><p>IC (IDL compiler, used with C or Java)</p></item>
@@ -238,8 +238,8 @@
Some of the above methods are easier to use than others. Loosely
coupled approaches, such as using a custom protocol over a TCP socket,
are easier to debug than the more tightly coupled options such as
- linked-in drivers. The Erlang-questions mailing list archives
- contain many desperate cries for help with memory corruption problems
+ linked-in drivers. The Erlang-questions mailing list archives
+ contain many desperate cries for help with memory corruption problems
caused by using Erl Interface and linked-in drivers incorrectly...
</p><p>
There are a number of user-supported methods and tools, including
@@ -260,7 +260,7 @@
<section><title>...write a unix pipe program in Erlang?</title>
<p>
- Lots of useful utilities in unix can be chained together
+ Lots of useful utilities in unix can be chained together
by piping one program's output to another program's input.
Here's an example which rot-13 encodes standard input
and sends it to standard output:
@@ -291,7 +291,7 @@
<pre>
matthias> cat ~/.bashrc | erl -noshell -s rot13 rot13 | wc
</pre>
-
+
</section>
<section><title>...communicate with a DBMS?</title>
<p>
@@ -301,7 +301,7 @@
another system. The other way is for an Erlang program to
access a database. The former is a "research" topic. The
latter is easily accomplished by going via ODBC, which allows
- you to access almost any commercial DBMS. The
+ you to access almost any commercial DBMS. The
<url href=
"http://www.erlang.org/doc/apps/odbc/index.html">
OTP ODBC manual</url> explains how to do this.
@@ -331,7 +331,7 @@
<p>
Erlang crash dumps provide information about the state of the
- system when the emulator crashed. The
+ system when the emulator crashed. The
<url href="http://erlang.org/doc/apps/erts/crash_dump.html">manual explains</url> how to interpret them.
@@ -339,40 +339,40 @@
<section><title>...estimate performance of an Erlang system?</title>
<p>
- Mike Williams, one of Erlang's original developers, is fond
+ Mike Williams, one of Erlang's original developers, is fond
of saying
</p> <quote><p>"If you don't run experiments before
- you start designing a <em>new</em> system, your
+ you start designing a <em>new</em> system, your
<em>entire system</em> will be an experiment!"</p></quote>
<p>
This philosophy is widespread around Erlang projects, in part
because the Erlang development environment encourages development
- by prototyping. Such prototyping will also allow sensible
+ by prototyping. Such prototyping will also allow sensible
performance estimates to be made.
</p><p>
For those of you who want to leverage experience with C
and C++, some rough rules of thumb are:
</p>
-
+
<list>
<item><p>Code which involves mainly number crunching and
data processing will run about 10 times slower than
- an equivalent C program. This includes almost all
+ an equivalent C program. This includes almost all
"micro benchmarks"</p></item>
-
- <item><p>Large systems which spent most of their time
- communicating with other systems, recovering from faults and
- making complex decisions run at least as fast as equivalent
+
+ <item><p>Large systems which spent most of their time
+ communicating with other systems, recovering from faults and
+ making complex decisions run at least as fast as equivalent
C programs.</p></item>
</list>
<p>
Like in any other language or system, experienced developers
- develop a sense of which operations are expensive and which
+ develop a sense of which operations are expensive and which
are cheap. Erlang newcomers accustomed to the relatively slow
- interprocess communication facilities in other languages
+ interprocess communication facilities in other languages
tend to over-estimate the cost of creating Erlang processes and
passing messages between them.
@@ -385,12 +385,12 @@
</p>
<code>
- 7> timer:tc(lists, reverse, ["hello world"]).
+ 7> timer:tc(lists, reverse, ["hello world"]).
{27,"dlrow olleh"}
8> timer:tc(lists, reverse, ["hello world this is a longer string"]).
{34,"gnirts regnol a si siht dlrow olleh"}
</code>
-
+
<p>
The <c>eperf</c> library provides a way to profile
@@ -402,12 +402,12 @@
Memory consumption is a bit of a tricky issue in Erlang. Usually,
you don't need to worry about it because the garbage collector
- looks after memory management for you. But, when things go
- wrong, there are several sources of information. Starting
+ looks after memory management for you. But, when things go
+ wrong, there are several sources of information. Starting
from the most general:
</p><p>
Some operating systems provide detailed information
- about process memory use with tools like top,
+ about process memory use with tools like top,
ps or the linux /proc filesystem:
</p>
@@ -427,12 +427,12 @@
This gives you a rock-solid upper-bound on the amount of
memory the entire Erlang system is using.
</p><p>
- <c>erlang:system_info</c> reports
+ <c>erlang:system_info</c> reports
interesting things about some globally allocated structures in bytes:
</p>
<pre>
- 3> erlang:system_info(allocated_areas).
+ 3> erlang:system_info(allocated_areas).
[{static,390265},
{atom_space,65544,49097},
{binary,13866},
@@ -455,7 +455,7 @@
<p>
Information about individual processes can be obtained
- from <c>erlang:process_info/1</c> or
+ from <c>erlang:process_info/1</c> or
<c>erlang:process_info/2</c>:
</p>
<pre>
@@ -483,7 +483,7 @@
erlang process on the system. Out-of-control processes often have
enormous message queues. A common reason for Erlang processes to
get unexpectedly large is an endlessly looping function which isn't
- tail recursive.
+ tail recursive.
</p><p>
3. Check the amount of memory used for binaries (reported
by <c>system_info</c>). Normal data in Erlang is
@@ -507,12 +507,12 @@
A rough rule of thumb is that about the same number of lines
of code are produced per developer as in a C project.
A reasonably complex problem involving distribution and
- fault tolerance will be roughly five times shorter in
+ fault tolerance will be roughly five times shorter in
<em>Erlang</em> than in C.
</p><p>
The traditional ways of slowing down projects, like adding
- armies of consultants halfway through,
+ armies of consultants halfway through,
spending a year writing detailed design specifications
before any code is written, rigidly following a waterfall
model, spreading development across several countries and
@@ -527,7 +527,7 @@
(Solaris, Linux, MacOSX on PPC) had SMP support in earlier
versions.
</p><p>
- Given that Erlang programs are naturally written in a concurrent
+ Given that Erlang programs are naturally written in a concurrent
manner, most programs require no modification at all to take
advantage of SMP.
</p><p>
@@ -539,7 +539,7 @@
<p>
The simplest approach is to make an a-priori restriction to the
TCP ports distributed Erlang uses to communicate through by
- setting the (undocumented) kernel variables 'inet_dist_listen_min'
+ setting the (undocumented) kernel variables 'inet_dist_listen_min'
and 'inet_dist_listen_max'. Example:
</p>
@@ -596,14 +596,14 @@
The first is to use the <url href="http://www.erlang.org/doc/apps/debugger/">erlang debugger</url> to single-step
the program.
</p><p>
- Another option is to compile your code using the smart
- exceptions package, available from
+ Another option is to compile your code using the smart
+ exceptions package, available from
<url href='http://jungerl.cvs.sourceforge.net/jungerl/jungerl/lib/smart_exceptions/src/'>the jungerl</url>. Smart exceptions then provide line
number information:
</p>
<pre>
- 4> c(crash, [{parse_transform, smart_exceptions}]).
+ 4> c(crash, [{parse_transform, smart_exceptions}]).
{ok,crash}
5> crash:f().
** exited: {{crash,g,0},{line,9},match,[5]} **
@@ -623,17 +623,17 @@
indirectly via a packaging system such as Debian's or BSD's) is
the simplest option in many cases.
</p><p>
- A more modular alternative is to install the
+ A more modular alternative is to install the
<url href="http://cean.process-one.net/">CEAN</url>
runtime.
</p><p>
- A further alternative which has fallen into disuse is SAE:
+ A further alternative which has fallen into disuse is SAE:
stand-alone Erlang. SAE allows an Erlang program to be distributed
as just two files, totalling about 500k. SAE no longer works
on current Erlang releases, but for historical interest, there is
<url href="http://www.sics.se/~joe/sae.html">
a page about SAE</url> which shows you how to build a self-contained
- system for the (somewhat outdated) R9B Erlang release.
+ system for the (somewhat outdated) R9B Erlang release.
</p></section>
<section>
View
54 implementations.xml
@@ -15,7 +15,7 @@
<title>What Production-quality implementations of Erlang are there?</title>
<list>
- <item><p> <url href="http://www.erlang.org/"> Open Source
+ <item><p> <url href="http://www.erlang.org/"> Open Source
Erlang </url>
is the most popular implementation.
It is built from the same source tree as the commercial
@@ -27,7 +27,7 @@
<item><p> <url href="http://www.erlang.se/">
- Ericsson's Commercial Erlang</url>. This is essentially
+ Ericsson's Commercial Erlang</url>. This is essentially
the same as Open Source Erlang. The main differences are:
</p>
@@ -35,14 +35,14 @@
<item><p>Commercial Erlang comes with a support agreement
</p></item>
- <item><p>The OTP team go to greater lengths
- to test the commercial release, so you
+ <item><p>The OTP team go to greater lengths
+ to test the commercial release, so you
get a more stable product. Similarly, they
make the transition between versions smoother.
</p></item>
<item><p>The commercial version includes some
- encryption-related code which cannot be
+ encryption-related code which cannot be
provided in the open source release for legal reasons.
</p></item>
@@ -60,9 +60,9 @@
<list>
- <item><p><url
- href="http://www.it.uu.se/research/group/hipe">
- High Performance Erlang</url> (HiPE).
+ <item><p><url
+ href="http://www.it.uu.se/research/group/hipe">
+ High Performance Erlang</url> (HiPE).
HiPE is an in-progress project to create a faster Erlang
by compiling to native code. Since R8A, the HiPE compiler
is tightly integrated with the normal BEAM system; if
@@ -70,19 +70,19 @@
HiPE. A <url href="http://www.erlang.se/euc/01/kostis2001/sld001.htm">presentation at the EUC 2001</url> described how to use it.</p></item>
<item><p>
- <url href="http://www.iro.umontreal.ca/~etos/">
- Erlang to Scheme Compiler</url> (ETOS).
- ETOS is another research project to compile Erlang
+ <url href="http://www.iro.umontreal.ca/~etos/">
+ Erlang to Scheme Compiler</url> (ETOS).
+ ETOS is another research project to compile Erlang
programs to native code by first translating the
program into scheme. They have some impressive benchmarks.
ETOS is no longer under active development.</p></item>
<item><p>
- Geoff's Erlang (GERL) supported a subset of the Erlang
- language. GERL compiled to native code via C. GERL has
+ Geoff's Erlang (GERL) supported a subset of the Erlang
+ language. GERL compiled to native code via C. GERL has
fallen into disuse.</p></item>
- <item><p><url
+ <item><p><url
href="http://www.adfa.edu.au/~lpb/research/sserl/">
Safe Erlang</url>,
which is a prototype made by extending an older version
@@ -108,8 +108,8 @@
Eshell V5.7.1 (abort with ^G)
</pre>
- <p>
- From Erlang code, in recent releases,
+ <p>
+ From Erlang code, in recent releases,
call <c>erlang:system_info(otp_release)</c>
to find out which release you are running.
</p>
@@ -138,8 +138,8 @@
<section><title> What operating systems does Erlang run on?</title>
<p>
- Erlang runs on most unix and unix-like systems and on the
- currently popular flavours of windows. Ericsson
+ Erlang runs on most unix and unix-like systems and on the
+ currently popular flavours of windows. Ericsson
have compiled it for
</p>
@@ -155,7 +155,7 @@
<p>
- There are reports on the mailing list of other people
+ There are reports on the mailing list of other people
compiling it successfully IRIX, along with reports of
Erlang running on less usual systems such as iPhones, Xboxes
Tilera 64-core CPUs and many embedded systems.
@@ -202,7 +202,7 @@
at porting to QNX. If you're interested, ask on the
erlang mailing list.</p><p>
- <em>VxWorks</em>: VxWorks support is
+ <em>VxWorks</em>: VxWorks support is
included in the standard distribution. </p><p>
</p></section>
@@ -226,7 +226,7 @@
</p>
<p>
- Releases <em>prior</em> to R13B04 can also be cross-compiled
+ Releases <em>prior</em> to R13B04 can also be cross-compiled
with a moderate amount of effort. There's a fairly
<url href='http://www.trapexit.org/Cross_compiling'>
detailed writeup</url> on the trapexit wiki which covers
@@ -238,7 +238,7 @@
<p>
Various people on the erlang-questions mailing list have reported
- Erlang running on pocket PCs, including the
+ Erlang running on pocket PCs, including the
<url href="http://dynamism.com/sl-c3000/main.shtml">Sharp Zaurus</url>.
</p></section>
@@ -247,15 +247,15 @@
Rule of thumb: if the embedded system can run an
operating system like linux, then it is probably possible
- to get current implementations of Erlang running on it
- with a reasonable amount of effort.
+ to get current implementations of Erlang running on it
+ with a reasonable amount of effort.
Getting Erlang to run on, say, an 8 bit CPU with 32kByte of
RAM is not feasible.
People successfully run the Ericsson implementation of
- Erlang on systems with as little as 16MByte of RAM. It
- is reasonably straightforward to fit Erlang itself into
+ Erlang on systems with as little as 16MByte of RAM. It
+ is reasonably straightforward to fit Erlang itself into
2MByte of persistant storage (e.g. a flash disk).
</p><p>
@@ -272,7 +272,7 @@
<p>
This can be automated by editing otp.mk.in and adding
- <c>+compressed +no_debug_info</c>
+ <c>+compressed +no_debug_info</c>
to the erlang compiler options and then rebuilding all the libraries.
</p>
View
20 libraries.xml
@@ -13,7 +13,7 @@
<section><title> What's in the OTP libraries?</title>
<p>
The full library descriptions are included with the open-source
- distribution and also
+ distribution and also
<url href="http://www.erlang.org/doc/">
on line</url>. The highlights are:
</p>
@@ -36,7 +36,7 @@
</section><section>
<title>Database</title>
<p>
- Mnesia and Mnemosyne provide a real-time distributed
+ Mnesia and Mnemosyne provide a real-time distributed
database which can be both in-RAM and on-disk.
There is also a standard ODBC client driver.
</p>
@@ -50,15 +50,15 @@
<p>
A rich collection of modules provides
everything from string, list and regular expression
- manipulation to random number generation and calendar
+ manipulation to random number generation and calendar
lookups.
</p>
</section><section>
<title>Structural Components</title>
<p>
- gen_server, gen_fsm,
+ gen_server, gen_fsm,
and supervision trees provide standard ways of implementing
- client/server subsystems, state machines and
+ client/server subsystems, state machines and
supervised fault-tolerant systems.
</p>
</section><section>
@@ -118,7 +118,7 @@
<section><title>Is there a serial port driver for Erlang?</title>
<p>
Johan Bevemyr wrote one which works for unix machines. The
- code is freely available at
+ code is freely available at
<url href="http://www.erlang.org/user.html"> the contributions
area</url> as <em>serial-1.0</em>.
</p><p>
@@ -131,12 +131,12 @@
<section><title>Is there a toolkit for building GUIs?</title>
<p>
- There are several.
+ There are several.
</p><p>
The <url
href="http://www.erlang.org/doc/apps/wx/">wxErlang</url>
- application lets you make GUIs with
+ application lets you make GUIs with
<url href="http://www.wxwidgets.org">wxWidgets</url>, a
cross-platform toolkit. wxErlang is part of the OTP
distribution.
@@ -165,7 +165,7 @@
<p>
This takes more work and patience than most people
- have. Kent Boortz described many of the hurdles
+ have. Kent Boortz described many of the hurdles
<url href="http://erlang.org/pipermail/erlang-questions/2004-May/012329.html">on the mailing list</url>.
</p><p>
There are other ways to spread your code, including
@@ -173,5 +173,5 @@
the <url href="http://jungerl.sourceforge.net/">jungerl</url>.
</p>
-</section>
+</section>
</chapter>
View
50 mnesia.xml
@@ -13,14 +13,14 @@
<p>
Mnesia is the somewhat odd name for the real-time, distributed database which
-comes with Erlang.
+comes with Erlang.
</p>
<section><title>What is Mnesia good at?</title>
<section> <title>Locking and Transactions</title>
<p>
- If you need to keep a database that will be used by multiple
+ If you need to keep a database that will be used by multiple
processes and/or nodes, using Mnesia means you don't have
to write your own access controls.
</p></section>
@@ -29,22 +29,22 @@ comes with Erlang.
<p>
Tables can be replicated at many nodes, both for efficiency
- (database lookup is a local activity) and robustness
- (redundancy means if one node goes down, other nodes still
+ (database lookup is a local activity) and robustness
+ (redundancy means if one node goes down, other nodes still
have copies of the data.)
</p></section>
<section> <title>Non-fully-normalised data</title>
<p>
- Unlike most database systems, records can contain data
+ Unlike most database systems, records can contain data
of arbitrary size and structure.
</p></section>
<section><title>Monitoring</title>
<p>
- Monitoring - processes can subscribe to events which are
- sent when various operations on the data take place
- (update, delete, etc) The RDBMS package allows even
+ Monitoring - processes can subscribe to events which are
+ sent when various operations on the data take place
+ (update, delete, etc) The RDBMS package allows even
more fine-grained control.
</p></section>
@@ -63,35 +63,35 @@ comes with Erlang.
<p>
It depends. Erlang has no problem storing Erlang binary data
- types of arbritary size, however due to the in-memory-database
- design emphasis of mnesia, storing lots of binary
- data will eventually hit one of a number of limitations.
+ types of arbritary size, however due to the in-memory-database
+ design emphasis of mnesia, storing lots of binary
+ data will eventually hit one of a number of limitations.
These are driven by:
</p>
<list>
<item><p>
- Storage type - Both <c>ram_copies</c> and
- <c>disc_copies</c> tables
- rely on storing a full copy of the whole table and data
- in main memory. This will limit total blob storage to
+ Storage type - Both <c>ram_copies</c> and
+ <c>disc_copies</c> tables
+ rely on storing a full copy of the whole table and data
+ in main memory. This will limit total blob storage to
the size of available memory.
</p><p>
On the other hand <c>disc_only_copies</c>
- tables do not suffer
- from this limitation but they are slow (from disk) and
- the data is stored in dets tables which if not closed
- properly (e.g. after system crash) can take a long time
- to repair (this was improved in recent versions but is
+ tables do not suffer
+ from this limitation but they are slow (from disk) and
+ the data is stored in dets tables which if not closed
+ properly (e.g. after system crash) can take a long time
+ to repair (this was improved in recent versions but is
still not quick).
</p></item>
<item><p>
- Replication - if the table has a replica then updating
- an entry and rebuilding after a restart will copy the
- data over the network between the two machines. Depending
+ Replication - if the table has a replica then updating
+ an entry and rebuilding after a restart will copy the
+ data over the network between the two machines. Depending
on available bandwidth and the uptime requirements
this may or may not be acceptable.
</p></item>
@@ -99,7 +99,7 @@ comes with Erlang.
<p>
- As always, measurement of the different mechanisms for your
+ As always, measurement of the different mechanisms for your
specific application is recommended.
</p><p>
@@ -122,7 +122,7 @@ comes with Erlang.
<section><title>How much data can be stored in Mnesia?</title>
<p>
- Dets uses 32 bit integers for file offsets, so the
+ Dets uses 32 bit integers for file offsets, so the
largest possible mnesia table (for now) is 4Gb.
</p><p>
In practice your machine will slow to a crawl way before
View
114 obtaining.xml
@@ -13,8 +13,8 @@
<section><title>Where can I get Erlang/OTP?</title>
<p>
- Open Source Erlang/OTP can be downloaded from
- <url href="http://www.erlang.org/">the open source Erlang
+ Open Source Erlang/OTP can be downloaded from
+ <url href="http://www.erlang.org/">the open source Erlang
site</url>. The site provides full source code as well
as binaries for Windows machines. This is probably the best
place to go to make sure you're getting the latest version.
@@ -56,7 +56,7 @@
</p><p>
Components of Erlang have their own version numbers, for
instance the virtual machine in R7B-0 has version 5.0.1
- (yes, this is a bit confusing;
+ (yes, this is a bit confusing;
<seealso marker="implementations#version-table">
see also</seealso>).
</p>
@@ -65,14 +65,14 @@
<section><title> Which licence is Open Source Erlang shipped with?</title>
<p>
- The Open Source Erlang <url
+ The Open Source Erlang <url
href="http://www.erlang.org/EPLICENSE">Licence</url> is essentially
- the Mozilla (Netscape) Public Licence with a few modifications
+ the Mozilla (Netscape) Public Licence with a few modifications
to make it compatible with Swedish law.
</p><p>
- As far as I understand, this means you can obtain Erlang
- for free, use it to build cool systems and sell them
+ As far as I understand, this means you can obtain Erlang
+ for free, use it to build cool systems and sell them
without Ericsson coming around to charge you money.
For an authoritative statement, you'll need a lawyer.
</p>
@@ -81,7 +81,7 @@
<section><title> What documentation is there for Erlang?</title>
<p>
- The language itself is best described by the
+ The language itself is best described by the
<url href="http://www.erlang.org/doc/reference_manual/users_guide.html">
Language Reference Manual</url>.</p><p>
@@ -118,8 +118,8 @@
</p><p>
<em>Erlang Programmation</em>(Micka&euml;l R&eacute;mond)
- is an alternative if your French is up to it, it can be
- ordered
+ is an alternative if your French is up to it, it can be
+ ordered
<url href="http://www.eyrolles.com/Informatique/Livre/9782212110791/livre-erlang.php">from the publisher</url> or via
<url href="http://www.amazon.com/exec/obidos/tg/detail/-/2212110790/qid=1087192705/sr=1-3/ref=sr_1_3/102-4008653-6425766?v=glance%25s=books">
@@ -135,7 +135,7 @@
</p><p>
- Also only of historical interest: Maurice Castro's book, <url
+ Also only of historical interest: Maurice Castro's book, <url
href="http://www.castro.aus.net/~maurice/serc/erlbk/"
>Erlang in Real Time (1998)</url>.
</p>
@@ -145,16 +145,16 @@
<p>
The <url href="http://www.erlang.org/download/erl_spec47.ps.gz">
- Standard Erlang</url> spec aims to define the Erlang language.
+ Standard Erlang</url> spec aims to define the Erlang language.
There is currently no compiler which actually implements everything
exactly the way <em>Standard Erlang</em> specifies.
- This specification is quite precise; it's intended as a reference,
+ This specification is quite precise; it's intended as a reference,
not a bedtime read! Compiler and tool implementors will find
this useful, as will advanced Erlang programmers.
</p><p>
<url href="http://www.it.uu.se/research/group/hipe/cerl/">Core Erlang
- </url> is an effort to define an Erlang-like language which is
+ </url> is an effort to define an Erlang-like language which is
nicer to compilers and language tools and can be automatically
generated from Erlang. Erlang compilers from R10 onwards can
generate Core Erlang from normal Erlang code. They can also
@@ -162,15 +162,15 @@
</p><p>
<url href="http://forum.trapexit.org/viewtopic.php?p=44172#44172">
- The Erlang Rationale</url> is a short (13 page) discussion
+ The Erlang Rationale</url> is a short (13 page) discussion
written by one of the original authors of Erlang about why
some parts of Erlang became the way they are. It's a work
in progress.
</p><p>
The proceedings from the Erlang User Conferences contain
- many interesting articles. The
- <url href="http://www.erlang.se/euc/">
+ many interesting articles. The
+ <url href="http://www.erlang.se/euc/">
proceedings</url> for each of the yearly conferences since 1999
are online.
@@ -178,18 +178,18 @@
The internals of the BEAM file format are described on
<url href="http://www.erlang.se/~bjorn">
Bj&ouml;rn's homepage </url>. Eventually
- this will/might include a description of the
+ this will/might include a description of the
virtual machine's instructions. Bj&ouml;rn also includes some
benchmarks comparing different versions of the BEAM machine.
You may also want to take a look at the <c>beam_lib</c>
module.
</p><p>
- Joe Armstrong's Thesis,
+ Joe Armstrong's Thesis,
<url href="http://www.sics.se/~joe/thesis/armstrong_thesis_2003.pdf">
Making reliable distributed systems in the presence of software errors</url> contains a lot of interesting information, including a compact overview
- of the language, a number of case studies and some discussion of
- the language's evolution, somewhat similar to Bjarne
+ of the language, a number of case studies and some discussion of
+ the language's evolution, somewhat similar to Bjarne
Stroustrup's <em>Design and Evolution of C++</em>.
</p><p>
@@ -204,21 +204,21 @@
overview of Erlang's distribution mechanisms (Section 5).
</p><p>
- Mnesia's internals are described on
+ Mnesia's internals are described on
<!-- REVISIT: erlang projects was down at last viewing, 2009-05-15 -->
<url href="http://www.erlang-projects.org/Groups/erlang_frameworks/mnesia_internals_sli/block_11394822732946/file">
H&aring;kan's slides</url>
</p><p>
- The <url href="http://www.cs-lab.org/papers.html">
- (Ex-Ericsson) computer science laboratory</url> has a collection
+ The <url href="http://www.cs-lab.org/papers.html">
+ (Ex-Ericsson) computer science laboratory</url> has a collection
of papers about Erlang-related topics.
</p><p>
The source-code release includes a directory with some of the
internal build documentation in the subdirectory
<c>erts/emulator/internal_doc/
- </c>.
+ </c>.
</p><p>
<!-- REVISIT: erlang projects was down at last viewing, 2009-05-15 -->
@@ -240,9 +240,9 @@
The standard text about data structures in functional languages
is <em>Purely Functional Data Structures</em> by
Chris Okasaki. The parts about laziness (about half of the book)
- do not apply to Erlang, but are interesting nonetheless.
- An <url href="http://www-2.cs.cmu.edu/~rwh/theses/okasaki.pdf">early
- version of the book</url> is available online, the book itself is
+ do not apply to Erlang, but are interesting nonetheless.
+ An <url href="http://www-2.cs.cmu.edu/~rwh/theses/okasaki.pdf">early
+ version of the book</url> is available online, the book itself is
available from many online booksellers.
</p><p>
@@ -276,8 +276,8 @@
<section><title>How can I contribute to Erlang?</title>
<p>
-When you write Erlang code you want to share, there are quite a number of
-ways to share it. The place to announce such things is the Erlang Questions
+When you write Erlang code you want to share, there are quite a number of
+ways to share it. The place to announce such things is the Erlang Questions
mailing list, or, in the case of patches, the Erlang Patches mailing list.
Where you put the actual code is up to you.
@@ -287,12 +287,12 @@ wiki has <url
href='https://github.com/erlang/otp/wiki/submitting-patches'>instructions</url>.</p>
<p>
-If your code is a new application or library, some common ways of
+If your code is a new application or library, some common ways of
distributing it are:
</p>
<list>
- <item><p>Starting your own
+ <item><p>Starting your own
<url href="http://github.com/">github</url>
or <url href="http://code.google.com/projecthosting/">Google code</url>
or <url href="http://sourceforge.net/">sourceforge</url>
@@ -304,7 +304,7 @@ distributing it are:
</list>
</section>
<section>
- <marker id="eeps"/>
+ <marker id="eeps"/>
<title>How can I propose changes to the language itself?</title>
<p>
Even though Erlang is a fairly mature language with a large
@@ -325,17 +325,17 @@ distributing it are:
Every year (in September or October) there is an <em>
Erlang user conference</em>. The<url href="http://www.erlang.se/euc/">
- proceedings</url> are archived.
+ proceedings</url> are archived.
</p><p>
In June 2008 and April 2009, the first ever <em>commercial</em> Erlang
- conferences were held in London and San Francisco. This is now
+ conferences were held in London and San Francisco. This is now
a regular event with further <url href="http://www.erlang-exchange.com/">Erlang Exchange
</url> events planned.
-</p><p>
- Academic conferences about
+</p><p>
+ Academic conferences about
functional programming are also attended by a few Erlang users.
The <url href="http://pli2002.cs.brown.edu/">
- Principles, Logics, and Implementations of High-Level Programming Languages</url> usually includes an Erlang workshop. The
+ Principles, Logics, and Implementations of High-Level Programming Languages</url> usually includes an Erlang workshop. The
<url href="http://www.erlang.se/workshop/">ACM Sigplan</url>
Conference includes an Erlang workshop too.
</p>
@@ -361,7 +361,7 @@ distributing it are:
<p>
- There are several
+ There are several
<url href="http://www.erlang.org/static/doc/mailinglist.html">
mailing lists devoted to Erlang</url>:
</p>
@@ -369,10 +369,10 @@ distributing it are:
<section>
<title>erlang-questions</title><p>
- This is intended for general
+ This is intended for general
discussion about Erlang. Anyone can send
mail to <url href="mailto:erlang-questions@erlang.org">
- erlang-questions@erlang.org</url>, and anyone can
+ erlang-questions@erlang.org</url>, and anyone can
<url href="http://www.erlang.org/static/doc/mailinglist.html">
subscribe</url>.</p>
</section>
@@ -404,21 +404,21 @@ distributing it are:
The erlang-questions list is
<url href="http://www.erlang.org/pipermail/erlang-questions/">
- archived on the Erlang website</url>.
+ archived on the Erlang website</url>.
</p><p>
The GMANE news/mail gateway acts as both an archive and a
- forum-style way of using the mailing list. It has
+ forum-style way of using the mailing list. It has
<url href="http://news.gmane.org/gmane.comp.lang.erlang.general">
Erlang Questions</url> and
<url href="http://news.gmane.org/gmane.comp.lang.erlang.patches">
- Erlang Patches</url>.
+ Erlang Patches</url>.
</p><p>
The <url href="http://www.trapexit.org/">trapexit</url> site
also has a forum interface to the mailing list.
</p>
- </section>
+ </section>
<section>
@@ -437,24 +437,24 @@ distributing it are:
</p><p>
<url href="http://trapexit.org">trapexit</url> is a grab-bag
- of erlang news, erlang-related forums and a bidirectional
+ of erlang news, erlang-related forums and a bidirectional
forum/mailing list gateway.
-
+
</p><p>
<url href="http://planeterlang.org">planet erlang</url> aggregates
a couple of dozen erlang-related RSS feeds.
</p><p>
- The <url href="http://www.erlang.se">Ericsson site</url> for
+ The <url href="http://www.erlang.se">Ericsson site</url> for
all matters related to Ericsson-internal use of Erlang
also contains information about internal training and consulting.
-
+
</p><p>
- The mozilla dmoz has a
+ The mozilla dmoz has a
<url href="http://dmoz.org/Computers/Programming/Languages/Erlang/">
directory of Erlang links</url>.
</p>
- </section>
+ </section>
<section><title>Where can I find Erlang programmers/employers?</title>
<p>
@@ -473,19 +473,19 @@ distributing it are:
<item><url href="http://totally-erlang.com/">Totally Erlang
</url></item>
-
+
<item><url href="http://functionaljobs.com/">Functional Jobs
</url></item>
</list>
-
+
<p>
Several consultant groups have Erlang-certified people in
- Sweden, including
+ Sweden, including
<url href="http://www.enea.se/"> ENEA data</url> and
<url href="http://www.erlang-services.com/">Sj&ouml;land &amp; Thyselius</url>.
-
- <url href="http://www.erlang-solutions.com/">erlang-solutions.com
+
+ <url href="http://www.erlang-solutions.com/">erlang-solutions.com
</url> take assignments worldwide.
<url href="http://www.process-one.net/en/services/">
@@ -498,7 +498,7 @@ distributing it are:
</p><p>
Kontakten (Contact), an Ericsson-internal newspaper, may
- also be useful as it carries many job ads.
+ also be useful as it carries many job ads.
</p>
</section>
</chapter>
View
70 problems.xml
@@ -24,21 +24,21 @@
<p>
In Erlang, all variables must start with a capital letter,
- so you can write <c>A = 3.</c> but not
- <c>a = 3.</c> In the latter case Erlang
+ so you can write <c>A = 3.</c> but not
+ <c>a = 3.</c> In the latter case Erlang
complains that this is a "bad match".
</p><p>
In the second version, the 'a' is an atom while 3 is a number.
- 'a' cannot be <em>pattern matched</em> with 3. The use of
+ 'a' cannot be <em>pattern matched</em> with 3. The use of
capital letters for variables comes from Prolog.
</p><p>
If the terms <em>atom</em> and <em>pattern match </em> are new to you,
have a read of the first chapter or two of the
<url href="http://www.erlang.org/doc.html"> Erlang book</url>.
- (<em>Very</em> roughly, an atom corresponds to
- an enum in C and pattern matching in this case is like an
+ (<em>Very</em> roughly, an atom corresponds to
+ an enum in C and pattern matching in this case is like an
<c>assert</c> statement.
</p></section>
@@ -71,7 +71,7 @@
(This behaviour is called "single assignment", and it's
considered to be a feature, not a bug. Most functional
languages, including ML and Haskell, also behave this way.
- Among other things, It's nice being able to rely on a
+ Among other things, It's nice being able to rely on a
certain variable always having the same value.)
</p>
@@ -105,7 +105,7 @@
<p>
A similar problem occurs with <c>io:fwrite()</c>,
but in that case you can take direct control by specifying the
- appropriate formatting character. "~s" always prints the
+ appropriate formatting character. "~s" always prints the
argument as a string, "~w" always prints it as a list.
</p>
@@ -137,8 +137,8 @@
</code>
<p>
- The solution is usually to use <c>case</c>
- instead. Case is used much more frequently than
+ The solution is usually to use <c>case</c>
+ instead. Case is used much more frequently than
<c>if</c> in most Erlang programs:
</p>
@@ -164,9 +164,9 @@
</code>
<p>
- will return <c>yes</c> for
- <c>f(5)</c> as well as
- <c>f(blork)</c>. Similarly, the comma is
+ will return <c>yes</c> for
+ <c>f(5)</c> as well as
+ <c>f(blork)</c>. Similarly, the comma is
used for logical and:
</p>
@@ -178,8 +178,8 @@
<p>
Beware! The semicolon operator
doesn't mean exactly the same thing as 'or', for instance
- <c>f(hello)</c> returns <c>yes </c>, whereas evaluating
- <c>f(hello - 1) > 3 or atom(hello)</c>
+ <c>f(hello)</c> returns <c>yes </c>, whereas evaluating
+ <c>f(hello - 1) > 3 or atom(hello)</c>
returns a <c>badarith</c> error.
The first example, f(), is <em>defined</em>
as having the same effect as writing:
@@ -204,7 +204,7 @@
</code>
<p>
- But the parsing rules for Erlang are a bit unexpected here,
+ But the parsing rules for Erlang are a bit unexpected here,
catch binds less tightly than you might expect it to.
To make it parse the way you really want:
</p>
@@ -232,7 +232,7 @@
</code>
<p>
- The problem is that there already is a standard library module
+ The problem is that there already is a standard library module
called 'sets'. The Erlang runtime system is protecting
you.
@@ -245,29 +245,29 @@
</p></section>
<section><title>Why won't my distributed Erlang nodes communicate?</title><p>
- For Erlang nodes to be able to communicate, you need
+ For Erlang nodes to be able to communicate, you need
</p>
<list>
- <item><p>A working tcp network between the nodes.
- On unix systems you can check this by using telnet,
+ <item><p>A working tcp network between the nodes.
+ On unix systems you can check this by using telnet,
though a working telnet doesn't guarantee that
enough of your network is working, e.g. DNS problems
throw a spanner in Erlang's distribution mechanisms.
</p></item>
- <item><p>The nodes to use the same node naming scheme
- (you cannot have a system where some nodes use fully
+ <item><p>The nodes to use the same node naming scheme
+ (you cannot have a system where some nodes use fully
qualified names and others use short names).
</p></item>
- <item><p>The nodes must agree to use the same
+ <item><p>The nodes must agree to use the same
"magic security cookie".
</p></item>
</list>
<p>
- Here's an example of how to create two nodes on different machines
+ Here's an example of how to create two nodes on different machines
called <em>martell</em> and <em>grolsch</em>
and verify that they're connected. On one machine:
@@ -275,7 +275,7 @@
<code>
~ >rlogin martell
Last login: Sat Feb 5 20:40:52 from super
- ~ >erl -sname first_node
+ ~ >erl -sname first_node
Eshell V4.9.1.1 (abort with ^G)
(first_node@martell)1> erlang:set_cookie(first_node, nocookie).
true
@@ -299,10 +299,10 @@
</code>
<p>
- The <c>pong</c> tells us that the
+ The <c>pong</c> tells us that the
connection works, the result
of <c>net:ping()</c> is <c>pang </c> when the connection isn't working.
- The <c>rpc:call()</c> command illustrates
+ The <c>rpc:call()</c> command illustrates
executing a command on the other node.
</p>
@@ -326,12 +326,12 @@
R11B. </p><p>
Beyond that, you need to start digging. Erlang nodes communicate
- by connecting to the <c>epmd</c> daemon.
+ by connecting to the <c>epmd</c> daemon.
The daemon is started
automatically the first time you start a distributed node. For
debugging, it's useful to kill it by running <c>epmd -kill
</c>) and
- then restart it with the debugging flag. You can find
+ then restart it with the debugging flag. You can find
<c>epmd</c> in the same directory as the erlang binary:
</p>
@@ -353,10 +353,10 @@
</code>
<p>
- Similarly, when you use <c>net:ping</c> from a
+ Similarly, when you use <c>net:ping</c> from a
node on another
system, you should see some messages go by. If nothing seems
- to be happening on <c>epmd</c>,
+ to be happening on <c>epmd</c>,
it's useful to scan for
packets on the ethernet to see if the information is really
getting out on the net. On unix systems you can do this with
@@ -366,7 +366,7 @@
<code>
# /usr/local/sbin/tcpdump port 4369
tcpdump: listening on le0
- 21:10:17.349286 grolsch.37558 > martell.4369: S 747683789:747683789(0)
+ 21:10:17.349286 grolsch.37558 > martell.4369: S 747683789:747683789(0)
</code>
</section>
@@ -374,7 +374,7 @@
One fairly common obstacle to getting distribution to work is
a broken DNS setup. One way to avoid that, or test for it, is
- to start distributed Erlang with IP addresses instead of hostnames,
+ to start distributed Erlang with IP addresses instead of hostnames,
e.g. on one machine or window:
</p>
@@ -451,7 +451,7 @@ Why does my application die every second time I load new code into it?
Two mailing list discussions about the topic can be found
<url href="http://erlang.org/pipermail/erlang-questions/2004-January/011353.html">here</url> and
- <url
+ <url
href="http://erlang.org/pipermail/erlang-questions/2000-March/001050.html">
here</url>.
</p>
@@ -483,8 +483,8 @@ this code:
</title><p>
Consider using a binary release (Debian GNU/Linux includes them in the
- woody and potato releases, windows binaries are on the
- <url href="http://www.erlang.org/download.html">
+ woody and potato releases, windows binaries are on the
+ <url href="http://www.erlang.org/download.html">
download page </url>).
</p><p>
View
58 tools.xml
@@ -24,7 +24,7 @@
Erlang's libraries provide an Erlang equivalent for
<c>YACC</c> called <c>YECC</c>, but there is no equivalent
for <c>LEX</c>. Robert Virding wrote one called <c>LEEX</c>,
- which is available as a 'user contribution' on
+ which is available as a 'user contribution' on
<url href="http://forum.trapexit.org/viewforum.php?f=20">
trapexit</url>.
@@ -35,27 +35,27 @@
Not really, most people use general-purpose diagram
tools like <url href="http://wwwhome.cs.utwente.nl/~tcm/index.html">
tcm</url> or xfig. TCM, in particular, is highly recommended.
- Some people see
+ Some people see
<url href="http://www.sdl-forum.org/">SDL</url>
as the natural
way of expressing telecomms problems in diagrams,
- while Maurice Castro presented some interesting work on an
+ while Maurice Castro presented some interesting work on an
<url href="http://www.erlang.se/euc/99/Event.ps">
alternative notation</url> at the Erlang User Conference 1999.
</p><p>
The first thing many people say is "what about Rose".
An Ericsson project took a look at using
- Rose for Erlang projects, and concluded that it wasn't
+ Rose for Erlang projects, and concluded that it wasn't
worth using for a whole host of reasons (you can read
Ulf Wiger's post about an investigation into using
- Rose as much more than just a diagram tool
- in the <url
+ Rose as much more than just a diagram tool
+ in the <url
href="http://erlang.org/pipermail/erlang-questions/1999-March/000165.html">
mailing list archive.</url>
</p><p>
- The essential reason for Rose and such not looking
+ The essential reason for Rose and such not looking
promising for use with Erlang is that the way you model
a problem in Erlang is rather different to the way you
decompose a problem with OO. While you're worrying about