Must-have Warning: long
Per Einar Strömme
p-news@REDACTED
Fri Jul 4 03:29:03 CEST 2003
Hej !
I'll just have to by joining the choir:
Welcome back online, Erlang.org !
Warning: long...
I'm a bit curious about how You work developing various types of
ERLANG programs for different applications.
I'm not at all interested in a description of the p r o c e s s
but more in what tools you use when, why and how.
All the steps below all have their own quirks, tips, tricks and
considerations which I (after reading the list) can see people
having some solution for or way around.
It would be interesting to gather some of them. How is a process
I guess.
Some answers are already there in the OTP documentation, somethimes
the answers are a bit confusing, resulting in "still confused but
on a higher level".
Please note that I'm not whineing, trying to be constructive.
Maybe a division of the problem into something like the following
will explain what I'm after and might serve as a startingpoint
for a discussion:
HW-Platform
|
|
| Embedded---->
+-----+---...---+--------+------+--------+---------+-----...
Intel SUN Intel Mot Mot Hitachi NEC
X86 Sparc StrongARM 68XXX PowerPC SH3 MIPS
|
|
OS
|
|
+------+------+-----+-------+-----...
| | | |
| | | |
*NIX WIN VxWorks OSE
| |
| +-----...
|
|
+------+-------+-------+-------+--.......lots and lots
Solaris Linux NetBSD FreeBSD OpenBSD
|
|
+-------+
|
|
Distribution
|
|
+------+------+--------....and so on
Red Hat SuSE Debian
|
|
|
--------------
Since you already have a clue, you have chosen some sort of
development environment including some sort of
revision handling of code (CVS,...)
Some graphical frontend for it (I.E. CVS)
Some storing environment (sourceforge.net,
freshmeat.net, home,... )
Build support (make, erlmake, .... ?)
--------------
|
|
|
--------------
You worry a bit over:
Erlang packages
Erlang applications
--------------
|
|
|
--------------
The text is stolen from SYSTEM PRINCIPLES,
you thinker a little bit around:
* Starting the system
* Re-starting and stopping the system
* Command line arguments
* The boot file
* Code loading strategies
* Making a boot file
* Starting the system with a boot file
* Code loading strategy
* Making an embedded system
* The primitive loader.
--------------
|
|
|
--------------
And then you think about the development of your
application using some combination of ERLANG and
some other language probably depending on application.
--------------
|
|
|
--------------
Erlang and world out there:
Erlang to the world UBF
Something happend to this adress:
http://www.sics.se/~joe/index.html
Erlang to a port erlang:*port*(...)
Erlang to C Erl_Interface library (part of OTP)
Erlang to C Erlang Driver Tool Kit (EDTK)
(http://www.snookles.com/erlang/edtk)
Erlang to C IG - The Interface Generator
(http://www.bluetail.com/~tobbe/ig/doc.new/)
Erlang to C++/C#/aso. ??
Erlang to Java Jinterface Application (part of OTP)
IDL to CORBA erl_corba IC Application (part of OTP)
IDL to plain Erlang erl_plain
IDL to Erlang gen_server erl_genserv
IDL to C client c_client
IDL to C server c_server
IDL to Java java
Erlang to SQL-databases ODBC Application
Erlang to SNMP SNMP Application
Erlang to Asn1 Asn1 application
--------------
|
|
|
--------------
Maybe there is some higher level interfacing:
Erlang to The internet Inets application
Erlang distribution using SSL SSL application
Erlang to anyone using CRYPTO Crypto application
Erlang to the Megaco/H.248
protocol Megaco application
--------------
|
|
|
--------------
And pherhaps interfacing the other way around:
Other languade to
the Mnesia DBMS Mnesia_Session application
--------------
|
|
\|/
.
A.s.o.
===========================
A PRACTICAL EXAMPLE:
--------------
A practical example, which coincide with my special interest
at the moment.
You and I and some of our friends want to interface a PCI-buss
board of some sort added to your Intel based NNAP PC
(no name, assembled parts, PC) running Linux from a SuSE
distribution.
--------------
|
|
|
--------------
Buy a PCI-buss board which is supported by a Linux driver.
Interface Erlang to the driver using the "Erl_Interface library"
or what else ??
Well, everyone in this tiny group wants to get their hands dirty.
Do we start using
CVS through some graphical frontend XX at greatsourcemeat.net
building everything localy using YYmake.
--------------
|
|
|
--------------
We partition the design into a number of modules in packages
(see http://www.erlang.se/publications/packages.html or
http://www.it.uu.se/research/reports/2000-001/ )
creating some applications.
Design Principles:
http://www.erlang.org/doc/r9b/doc/design_principles/part_frame.html
Lots of tedious work to do...
--------------
|
|
|
--------------
We try to create some start,
stop and loading of the design
Have a look in System Principles:
http://www.erlang.org/doc/r9b/doc/system_principles/part_frame.html
The INTEROPERABILITY TUTORIAL
describes how to "integrating a program written in Erlang with
a program written in another programming language, from the
Erlang programmer's point of view."
http://www.erlang.org/doc/r9b/doc/tutorial/part_frame.html
Ahaa, in the ERTS USER'S GUIDE
http://www.erlang.org/doc/r9b/erts-5.2/doc/html/part_frame.html
a friendly description on:
"How to implement a driver"
There are som additional hints in chapter:
3.2 The driver
Also check in the ERTS REFERENCE MANUAL
the Module erl_driver and Module driver_entry
http://www.erlang.org/doc/r9b/erts-5.2/doc/html/application_frame.html
--------------
|
|
|
--------------
Then we are in some trouble.
We need to debugg the c-environment part. The PCI-buss board
driver need to be investigated.
The C to Erlang interface need some debugging.
There are a number of debuggers around some included in emacs,
which ones do we choose and when do we use them.
The loading and start of the Erlang node need som investigation.
This is an interresting situation, how do we do ?
We find erlang:display(Term)
In the ERTS USER'S GUIDE
http://www.erlang.org/doc/r9b/erts-5.2/doc/html/part_frame.html
"How to interpret the Erlang crash dumps"
--------------
|
|
|
--------------
Puuh, now things are looking better, now we need to debugg the
erlang part of the design. There is a number of debugging
tools available, which one do we use when ?
The Application Monitor, Appmon
Debugger is a graphical tool
Sequential tracing Module seq_trace
We find some other functions in the module erlang:
erlang:trace()
erlang:trace_pattern()
The OBSERVER application contains tools for tracing
and investigation of distributed systems.
The Event Tracer (ET) uses the built-in trace mechanism
in Erlang and provides tools for collection and graphical
viewing of trace data.
The process manager PMAN is a graphical tool used to
inspect the Erlang processes executing either locally
or on remote nodes.
In GETTING STARTED WITH ERLANG there is a chapter on
the use of PMAN.
DBG, the Text Based Trace Facility in the Runtime_Tools Module-
--------------
|
|
|
--------------
Now, at last, the thing is working. #¤%&-- there seems to be
some sort of degradation. Maybe we need to profile our baby.
How and using what ?
Aahaa, the Efficiency Guide
http://www.erlang.org/doc/r9b/doc/efficiency_guide/part_frame.html
Ahh we got
THE TOOLS APPLICATION contains a number of stand-alone tools,
which are useful when developing Erlang programs.
The operating system monitor OS_Mon monitors operating system
disk and memory usage etc.
In the User's Guide for THE ERLANG RUNTIME SYSTEM APPLICATION ERTS
we find this description
"Match specifications in Erlang" which is used as parameters to
a function as used in the erlang:trace_pattern/2
This is realy heavy stuff.
--------------
|
|
|
--------------
Hopefully something works here.
Else try the mailing list :-)
--------------
|
|
|
--------------
Finished...
Since they aparently are muddling around at SICS with Joe Armstrongs
WEB-pages I hav'nt been able to refer to any tutourials or info on UBF,
written by Joe and stored at:
http://www.sics.se/~joe
The above is not a straight forward question but developing software
is not straight forward either (yet). Hoping to hear from you !
Rgrds Per Einar
--------------------------------------------------------------------------------
Per Einar Strömme
p-news@REDACTED
--------------------------------------------------------------------------------
More information about the erlang-questions
mailing list