[erlang-questions] What are the "Most valuable libraries?"...and a few other questions
Mike Oxford
moxford@REDACTED
Wed May 18 02:41:19 CEST 2011
On Tue, May 17, 2011 at 5:25 PM, Todd <t.greenwoodgeer@REDACTED> wrote:
> The whole "reply-all" debate has stirred me to ask some festering
> questions...
>
> 1. In general, what are the most valuable libraries to learn, both within
> the Erlang dist and external?
>
OTP, gproc to start
>
> 2. Is there a consolidated/curated repository of libraries that is industry
> standard? I know the erlware folks have a repo...is that both a complete and
> accepted authoritative repo? From reading the list, it sounds like there's
> also a fair bit of stuff scattered about in github, too.
>
OTP is the industry standard
> 3. How does one easily multithread an app? For instance, there's pmap in
> clojure and something similar in akka that lets you map a function across a
> list, and it allocates threads accordingly...
>
You spawn more processes. Erlang handles the SMP portion for you. There is
some parallelization stuff available for Erlang as well, or roll your own.
http://99-bottles-of-beer.net/language-erlang-1482.html
>
> 4. Along that note, does anyone have any ideas as to how to tackle the
> Typesafe 'getting started tutorial?'
>
http://learnyousomeerlang.com/
> 4b. Side note: is anyone concerned about Akka/Typesafe stealing mindshare?
>
Dif'rnt stroke fer dif'rnt folks.
> 5. How does one push an app such that it self instantiates it's processes
> across the cluster? I can see how OTP is great at managing an app on a
> single node, but how do you say something like: "create one of these
> processes on each node in the cluster, and restart 1-for-1 if they die"...
> or something similar. I see mention of gproc, but honestly, I don't see how
> to use it. Likewise, if nodes are added to the cluster, how would you ensure
> that the necessary processes are pushed to the new node after it joins the
> cluster?
>
Use spawn_link/2
spawn_link(Node, Fun) -> pid()
If you have the Pid for your remote supervisor you can just use
supervisor:start_link and give it the remote Pid, or Pid ! <msg> it.
> 6. How do you deploy and live code upgrade in real life? I've been looking
> at some of the work by the 'Dukes of Erl' ... is erlrc what folks commononly
> use?
>
>
No idea, I haven't gotten that far yet. :)
> 7. Does anyone use dynamic load balancing of demand across a cluster (e.g.
> spinning up erlang processes to meet the demand curve?)
>
We do, to some extent. We start with a pool and if we exceed that we go
dynamic. Might be better to just go dynamic and save the shared-state
munging....
> 8. What's the best way to integrate w/ other code bases. In akka, you'd use
> camel as an integration bus. What are the common ways to integrate with
> erlang? Is that what ports and nifs are for? Forgive my ignorance, but I
> always considered those as simply ways to write code in a different, perhaps
> more comfortable language...not as integration mechanisms.
>
Ports and NIFs, yes. Whether the integration is for performance,
functionality or preferences it's all the same: something external.
Also, I've continued to peck away at various newbie tutorials. Any
> comments/suggestions/corrections are welcome.
>
See #4.
G'luck!
-mox
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20110517/b8128500/attachment.htm>
More information about the erlang-questions
mailing list