Learning OTP

12 views
Skip to first unread message

Tim McNamara

unread,
Mar 7, 2012, 6:08:24 PM3/7/12
to erlounge-...@googlegroups.com
Hey all,

I have spent the last several months dipping my toes into Erlang. I think I understand enough of the syntax, etc but I am struggling to identify how OTP works.

Some general questions I have:

 - what is an application?
 - how do applications talk to each other?

I am specifically interested in creating an interactive application for collaboratively filtering huge volumes of information in disasters. I'm thinking about using Chicago Boss and Backbone.js, using Socket.IO as a transport mechanism. How do I glue libraries together?

Dave Cottlehuber

unread,
Mar 8, 2012, 4:55:00 AM3/8/12
to erlounge-...@googlegroups.com
> --
> You received this message because you are subscribed to the Google Groups
> "Erlounge Wellington" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/erlounge-wellington/-/7CVeSePpVpMJ.
> To post to this group, send email to erlounge-...@googlegroups.com.
> To unsubscribe from this group, send email to
> erlounge-wellin...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/erlounge-wellington?hl=en.

Hi Tim,

A good overview is http://www.trapexit.org/Building_An_OTP_Application

Usually an application is a self contained "OTP release" which is all
the required dependencies for the app to function, along with its own
beam and header files, and some stuff that tells ERTS the erlang
runtime how to start/stop it. They are usually supervision trees
underneath that, generally apps talk to each other via their
-export([func/arity]) interfaces. I think that you can simply include
applications together to make a release, I've not done this directly.
rebar if you haven't run into it yet enforces/provides a lot of this
for you already https://github.com/basho/rebar/wiki

I strongly recommend working through:
- http://learnyousomeerlang.com/ which has some new chapters around this
and to cover a fair bit of OTP trickery, buying:
- http://www.manning.com/logan/
I also bought the http://shop.oreilly.com/product/9780596518189.do but
LYSE covers a lot of this ground too.

And specifically on OTP apps in case you didn't find them
http://erldocs.com/R15B/kernel/application.html
http://www.erlang.org/doc/design_principles/applications.html

BTW While I recently moved from Wellington back to Vienna Austria, I
would be interested in working on this with you I'm also very
interested in CouchDB and in particular its replication functionality
would be great to being able to have data collection and filtering
that is not necessarily reliant on an active DB connection, nor a
single point of failure. We will be working on integrating the
clustered BigCouch back into CouchDB this year so its ability to
manage large data is going to get even better. But thats more of a
different discussion, maybe offline.

A+
Dave

lenz

unread,
Mar 8, 2012, 6:31:50 PM3/8/12
to erlounge-...@googlegroups.com
hi,


On Thu, Mar 8, 2012 at 12:08 PM, Tim McNamara <mcnama...@gmail.com> wrote:

> I have spent the last several months dipping my toes into Erlang. I think I
> understand enough of the syntax, etc but I am struggling to identify how OTP
> works.

i absolutely love the "Erlang and OTP in Action" book
(http://manning.com/logan/) - i think it is the single most valuable
erlang book so far (and i have read them all i think :-)

> I am specifically interested in creating an interactive application for
> collaboratively filtering huge volumes of information in disasters. I'm
> thinking about using Chicago Boss and Backbone.js, using Socket.IO as a
> transport mechanism. How do I glue libraries together?

I am in touch with the socket.io guys (they are customers of ours) to
get the erlang server implementation
up to date. I hope to have some more details on this soon.

In terms of gluing stuff together in erlang world, read the rebar
docs, have a look at some rebar built projects and you'll see that it
is just plain message passing. every library normally has a public API
section on top of the module and all you need to do is using those
calls it in your code. then put everything in the right place (that is
what rebar does for you) and generate a release.

we should do some sort of OTP (or erlang in general) hack day
somewhen. is there interest for something like that?

cheers
lenz
--
twitter: @norbu09
current project: iWantMyName.com

manu

unread,
Mar 12, 2012, 7:18:36 PM3/12/12
to Erlounge Wellington
+1 OTP book, I'm halfway through it now and it really helps (the
official docs is pretty dry when it comes to OTP)

+1 LYSE is really good too and covers some OTP stuff too (as well as
Erlang, the language)

Manu


On Mar 9, 12:31 pm, lenz <norb...@googlemail.com> wrote:
> hi,
>

Tim McNamara

unread,
Mar 12, 2012, 9:10:06 PM3/12/12
to erlounge-...@googlegroups.com
Thanks everyone, I should be able to get a demo out shortly.
Reply all
Reply to author
Forward
0 new messages