forked from matthiasl/Erlang-FAQ
-
Notifications
You must be signed in to change notification settings - Fork 1
/
libraries.xml
executable file
·196 lines (174 loc) · 6.08 KB
/
libraries.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE chapter SYSTEM "chapter.dtd">
<chapter>
<header>
<title>Erlang Libraries</title>
<prepared>Matthias Lang</prepared>
<docno></docno>
<date>2007-09-12</date>
<rev>1.0</rev>
<file>libraries.xml</file>
</header>
<section><title> What's in the OTP libraries?</title>
<p>
The full library descriptions are included with the open-source
distribution and also
<url href="http://www.erlang.org/doc/">
on line</url>. The highlights are:
</p>
<section>
<title>O&M Support</title>
<p>
SASL, EVA, INETS and SNMP provide
Operations- and maintenance-related functionality:
release handling, alarm and event handling,
administration via web browser and SNMP.
</p>
</section><section>
<title>CORBA</title>
<p>
ORBER, CosEvent, CosTransactions and IC
contain support for everything CORBA related.
</p>
</section><section>
<title>Database</title>
<p>
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>
</section><section>
<title>ASN.1</title>
<p>
There is an ASN.1 compiler which produces Erlang code.
</p>
</section><section>
<title>Standard Library</title>
<p>
A rich collection of modules provides
everything from string, list and regular expression
manipulation to random number generation and calendar
lookups.
</p>
</section><section>
<title>Structural Components</title>
<p>
gen_server, gen_fsm,
and supervision trees provide standard ways of implementing
client/server subsystems, state machines and
supervised fault-tolerant systems.
</p>
</section><section>
<title>GUI and Graphics</title>
<p>
wx, gs and webtool provide ways to build a gui.
</p>
</section>
<p>
Among other things, there are also HTTP, SSH and FTP servers.
</p></section>
<section><title> Is there a collection of data structures, e.g. balanced trees?</title>
<p>
Linked lists are a fundamental part of Erlang, as are tuples.
The other standard data structures are:
</p>
<table>
<row><cell>Module</cell><cell>Description</cell></row>
<row><cell>sets</cell>
<cell>sets, i.e. a collection of unique elements.</cell>
</row>
<row><cell>gb_sets</cell>
<cell>sets, but based on a general balanced data structure</cell>
</row>
<row><cell>gb_tree</cell>
<cell>a general balanced tree</cell>
</row>
<row><cell>dict</cell>
<cell>maps, also called associative arrays</cell>
</row>
<row><cell>ets</cell>
<cell>hash tables and ordered sets (trees)</cell>
</row>
<row><cell>dets</cell>
<cell>on-disk hash tables</cell>
</row>
<tcaption>Standard data structures</tcaption>
</table>
<p>
The <url href="http://www.erlang.org/user.html">
contributions area</url>
at the erlang.org site includes modules for
double-ended queues and balanced trees.
</p>
<p>
<c>ordset</c> and <c>orddict</c> are
not really suitable for large amounts of data: they are no
better that lists for many common operations, e.g.
inserting an element is O(n) for both. <c>dict</c>
and <c>sets</c> are usually preferred.
</p><p>
In practice, Erlang programs use lists (either natively or
via <c>dict</c>) for data structures involving
up to a few hundred elements and use <c>ETS</c>
(the Erlang Term Store) or mnesia
for anything larger. ETS uses hashing to allow near
constant-time access to almost arbitrarily large amounts of data.
</p><p>
For a collection of data consisting of a few (tens or
hundreds) items, lists often outperform both ETS and
trees. For large numbers of small items, ETS tends to
work best. For larger items, balanced trees can outperform
ETS because they avoid copying the data.
</p></section>
<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
<url href="http://www.erlang.org/user.html"> the contributions
area</url> as <em>serial-1.0</em>.
</p><p>
There have been discussions on the mailing list about writing
a more general driver which also works on windows machines.
Nothing much has come of this (lack of interest?).
</p></section>
<section><title>Is there a toolkit for building GUIs?</title>
<p>
There are several.
</p><p>
The <url
href="http://www.erlang.org/doc/apps/wx/">wxErlang</url>
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.
</p><p>
The older <url
href="http://www.erlang.org/doc/apps/gs/">gs</url> application
uses TK as a backend. Some people prefer to work with TK
through <url href="http://sourceforge.net/projects/erlgtk/">
etk</url>. ETK is a fairly direct binding to the TK toolkit.
</p><p>
Other graphics-related items on
<url href="http://jungerl.sourceforge.net/">sourceforge</url>
are gtkNode (a C node which gives access to a large subset of GTK2) and
gd1_drv (a driver which dynamically creates JPEG and PNG images).
There are a few projects involving experimental graphics
interfaces, including a binding to gtk (Ed: can someone
send me some more information about this!), an <url
href="http://www.wings3d.com/">OpenGL modeller</url>
and some <url href="http://www.sics.se/~joe/ex11/">
interesting work</url> to directly access the X protocol.
</p><p>
</p></section>
<section><title>I've written a library to handle XYZ. How do I get it into the standard Erlang distribution?</title>
<p>
This takes more work and patience than most people
have. Kent Boortz described many of the hurdles
<url href="http://erlang.org/pipermail/erlang-questions/2004-May/012327.html">on the mailing list</url>.
</p><p>
There are other ways to spread your code, including
distributing it from your own website or adding it to
the <url href="http://jungerl.sourceforge.net/">jungerl</url>.
</p>
</section>
</chapter>