[erlang-questions] 'reply-to' header in this mailing list

109 views
Skip to first unread message

Alexander Krasnukhin

unread,
May 17, 2011, 7:04:58 AM5/17/11
to erlang-q...@erlang.org
Hej,

Why this mailing list doesn't add itself to the 'reply-to' header? I see it isn't uncommon for subscribers to send message to the author directly instead of the list.

I wonder why?

--
Regards,
Alexander

Mazen Harake

unread,
May 17, 2011, 7:24:29 AM5/17/11
to Alexander Krasnukhin, erlang-q...@erlang.org
This has been debated for as long as mailing lists have been used. This is a philosophical question.

To shortcut the discussion which will probably develop now: Use "reply all".

Everyone should learn this. The other way is simply a hack.

See: http://www.metasystema.net/essays/reply-to.html

/M


_______________________________________________
erlang-questions mailing list
erlang-q...@erlang.org
http://erlang.org/mailman/listinfo/erlang-questions


Mazen Harake

unread,
May 17, 2011, 7:29:25 AM5/17/11
to Alexander Krasnukhin, erlang-q...@erlang.org
To clarify. The link is FOR when you suggest, not against. I was sending it as an example of the philosophical discussion people have about it.

Alexander Krasnukhin

unread,
May 17, 2011, 7:50:24 AM5/17/11
to Mazen Harake, erlang-q...@erlang.org
I don't want to discuss this. Just wanted to ask why because it is unusual these days.
--
Regards,
Alexander

Mazen Harake

unread,
May 17, 2011, 7:58:47 AM5/17/11
to Alexander Krasnukhin, erlang-q...@erlang.org

Alexander Krasnukhin

unread,
May 17, 2011, 8:03:18 AM5/17/11
to erlang-q...@erlang.org
Yeah, yeah. I've got this. It is some kind of local joke. Don't have anything to ask? Why not just ask why the hell "reply-to" isn't the mailing list address itself?
--
Regards,
Alexander

Raimo Niskanen

unread,
May 17, 2011, 10:28:48 AM5/17/11
to erlang-q...@erlang.org
Search the archives. Do not waste bandwidth.

The same bottom line as the last time still applies:
http://erlang.org/pipermail/erlang-questions/2010-December/055017.html

/ Raimo Niskanen, mailing list maintainer at erlang dot org


--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

Alexander Krasnukhin

unread,
May 17, 2011, 11:07:50 AM5/17/11
to erlang-q...@erlang.org
Yes, yes. I've got this. People from telecom will always rely on standards instead of people expectations. Good. Right. Understandable.
--
Regards,
Alexander

Richard O'Keefe

unread,
May 17, 2011, 7:45:25 PM5/17/11
to Alexander Krasnukhin, erlang-q...@erlang.org

On 18/05/2011, at 3:07 AM, Alexander Krasnukhin wrote:

> Yes, yes. I've got this. People from telecom will always rely on standards instead of people expectations. Good. Right. Understandable.

That sounds a bit sarcastic.
The thing is that the Erlang mailing list behaves *EXACTLY* the way I expect
a mailing list to work.
I expect "Reply All" to reply to everyone on the list.
I expect "Reply" to go just to the author.
I expect it to work the way mailing lists always used to work.

The standard in this case is not arbitrary, but part of a coherent
design to ensure a straightforward user experience.

Todd

unread,
May 17, 2011, 8:25:35 PM5/17/11
to erlang-q...@erlang.org
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?

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.

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...

literally something like: "pmap(myfun, mylist);"

4. Along that note, does anyone have any ideas as to how to tackle the
Typesafe 'getting started tutorial?'

http://typesafe.com/resources/getting-started/tutorials/getting-started-first-scala.html

(Typesafe is the funded version of Jonas Bonér's Akka combined with Scala)

4b. Side note: is anyone concerned about Akka/Typesafe stealing mindshare?

And lastly, the most burning of questions:

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?

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?

Dukes of Erl project (Paul Mineiro):
https://code.google.com/p/erlrc/

Paul Mineiro's Erlang factory 2009 presentation:
http://www.erlang-factory.com/conference/SFBayAreaErlangFactory2009/speakers/PaulMineiro

7. Does anyone use dynamic load balancing of demand across a cluster
(e.g. spinning up erlang processes to meet the demand curve?)

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.

Also, I've continued to peck away at various newbie tutorials. Any
comments/suggestions/corrections are welcome.

https://github.com/ToddG/experimental/tree/master/erlang/wilderness

-Todd

Mike Oxford

unread,
May 17, 2011, 8:41:19 PM5/17/11
to Todd, erlang-q...@erlang.org
On Tue, May 17, 2011 at 5:25 PM, Todd <t.green...@gmail.com> 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.

4. Along that note, does anyone have any ideas as to how to tackle the Typesafe 'getting started tutorial?'

 
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

Frédéric Trottier-Hébert

unread,
May 17, 2011, 8:59:21 PM5/17/11
to Todd, erlang-q...@erlang.org
On 2011-05-17, at 20:25 PM, Todd 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?
>

In my opinion, learning the OTP behaviour modules brought me a lot in term of Erlang programming efficiency, and also taught me a lot in terms of writing abstractions. They're pretty useful regarding that. Add the sys module to the mix; it's pretty good as far as being able to debug gen_* behaviour goes.

For external libraries, I'd say gproc, ibrowse, proper and meck are pretty neat. The riak_core stuff is also impressive.

> 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.
>

Not really. You have erlware, as you mentioned, but I personally tend to use agner (http://erlagner.org/).

> 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...
>
> literally something like: "pmap(myfun, mylist);"

In my own use cases, I tend to write Erlang for multi-user stuff, server-side software. In these cases, parallelism on things like mapping over a list is rather useless. By this, I mean that if you only map over one list at a time, then breaking it in N processes might win you some time (assuming the function you apply takes more time to run than spawning and communicating data), but if you have N lists for N users each having their own process, then the system is already processes a lot of data in parallel, probably more than what could be useful if you had M processes per list on top of the N users -- at this point you get to play with the scheduler and processes might fight for CPU time.

This is pretty complex but my point is that if you're writing server software where concurrency units are already large, but there are many of them, low-level parallelism as in a pmap function isn't the most useful enhancement. Smart application architecture design might play a lot more in the long run.

In any case, if you really want a pmap, there's rpc:pmap/3 (http://erldocs.com/R14B02/kernel/rpc.html?i=0&search=pmap#pmap/4) and conc lists (http://dustin.github.com/2010/03/04/erlang-conc.html, also on agner). Measure and see what fits.


>
> 4. Along that note, does anyone have any ideas as to how to tackle the Typesafe 'getting started tutorial?'
>
> http://typesafe.com/resources/getting-started/tutorials/getting-started-first-scala.html
>
> (Typesafe is the funded version of Jonas Bonér's Akka combined with Scala)

This is a tough one. There are plenty of guides to get started with Erlang. You have 2-3 versions of them in the official documentation, there are screencasts over at pragmatic programmers, I write http://learnyousomeerlang.com and you have plenty of blog posts around the web doing a good, short job of introducing users to the language. The latest one doing that is from IBM (http://www.ibm.com/developerworks/xml/library/os-erlang1/index.html?ca=drs-)

For the part about getting an executable running fast, things in Erlang are a bit complex. The standard way to get an application running has to do with OTP Applications and OTP Releases; this is complex, requires you to learn the whole framework and can't be explained fast. You could probably do something basic with erl -run and -noshell options, but I'd also like to see one or two tutorials focusing on Escripts as a quick jumpstart option.

>
> 4b. Side note: is anyone concerned about Akka/Typesafe stealing mindshare?

Not really. I don't think many established Erlangers are going to leave for Scala/Akka. I think many Java people who were somewhat interested but hesitating about Erlang might study Scala/Akka first. If they like it, I wouldn't be surprised to see them trying Erlang at some point, given Akka is heavily inspired by its design choices.

The more languages try to borrow Erlang idioms, the better (although I'd like it if they focused more on fault-tolerance)

>
> And lastly, the most burning of questions:
>
> 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?

You can have many design options. Using OTP applications, you can specify a takeover/failover mechanism, but not something that would be instantly started on all nodes. To do something like that, the simplest thing I can think of is to simply start your application on each node. You could add some kind of 'sync' function to ask each node to synchronises itself with the rest of the cluster (this is what the global module does as far as I know) or try to work some mechanism that does it automatically.

Generally, distributed applications where they all run at the same time and need to share some state is a harder problem than just having independent components distributed across a cluster. Things will be very application specific. Is the state shared or independent? Can one of the nodes disappear without impacting the rest of the application? What do you do in cases of netsplits when you can't know if a node is down or the connection broken? There are many questions like this that will drive your design. You can possibly look at riak_core for some design decisions, then at the global module for an entirely different (and smaller scale) approach.

>
> 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?
>
> Dukes of Erl project (Paul Mineiro):
> https://code.google.com/p/erlrc/
>
> Paul Mineiro's Erlang factory 2009 presentation:
> http://www.erlang-factory.com/conference/SFBayAreaErlangFactory2009/speakers/PaulMineiro

Releases have mechanisms in place to handle this. The basic idea is that every gen_* behaviour implements callbacks from the sys module. These callbacks allow various operations such as suspending a behaviour (switching it into a 'I only accept sys messages' mode), calling for the code change functions, then resuming it. This generally allows safe code updates, but always remember to test things before deploying them (and test the deploying itself).


>
> 7. Does anyone use dynamic load balancing of demand across a cluster (e.g. spinning up erlang processes to meet the demand curve?)
>

I'll leave this to be answered by people with more production experience than I have, but I generally write my programs so that each concurrent (independent) unit of computation has its own process. By this I mean that in the case of a web server, I'll usually create one process per query rather than one process for the data fetching, then one for the templating, etc. Some things are sequential and should remain that way in the code.

The VM also does a lot of heavy lifting for me with regards to that approach, distributing processes in ways that makes things reasonably balanced.

> 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, Port Drivers, C Nodes and NIFs are all standard ways to communicate with the outside world. There are also interfaces to Java and communication layers to PHP, Ruby, Python, etc. You can also add BERT-RPC as a protocol that can be used with Erlang, among others.


>
> Also, I've continued to peck away at various newbie tutorials. Any comments/suggestions/corrections are welcome.
>
> https://github.com/ToddG/experimental/tree/master/erlang/wilderness
>
> -Todd
> _______________________________________________
> erlang-questions mailing list
> erlang-q...@erlang.org
> http://erlang.org/mailman/listinfo/erlang-questions

Hopefully, this is helpful :)

--
Fred Hébert
http://www.erlang-solutions.com

Jared Morrow

unread,
May 17, 2011, 10:50:05 PM5/17/11
to Todd, erlang-q...@erlang.org


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?

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?

Lots of folks do it different ways.   Two good talks that will aid you in deployment are Dizzy Smith's talk about rebar and Joe Williams talk about deployment and hot code upgrades, both at EF San Fran 2011.

 

Michael Turner

unread,
May 18, 2011, 1:35:52 AM5/18/11
to erlang-q...@erlang.org
Does anyone have any statistics on this question? That is, what percentage of mailing lists "do it wrong"? It's counterintuitive to me that  a "reply" on this mailing list is only to the individual. "Reply" is "Reply to the list" on every other mailing list I'm currently on, and on almost every mailing list I can remember being on. But perhaps my lifetime mailing list membership doesn't approach statistical significance.

Although it may get me accused of "blindly following the herd," let me assert it anyway: arguments from "intuition" in commonly used software interfaces only work when you have statistically significant user support for them, not some purely formal, rule-based argument for your *personal* intuition. What's "intuitive" to one person may be counterintuitive to many. As pointed out long ago, "intuitive equals familiar":


And, as pointed out even longer ago, "a foolish consistency is the hobgoblin of small minds." (Emerson.)

Perhaps to some people, a mailing list is like a noticeboard in a mostly-empty hallway. My mental model of a mailing list corresponds more closely to a conversation in a classroom. When you reply to an open question or comment in such a context, you cannot help but be heard by more than one person; most likely you'll be heard by everyone in the room. You actually have to make a special effort (i.e., lean over and whisper in an ear, or pass a note) to be sure that your reply is private. I think this corresponds pretty closely to the intuition of the average mailing list user. But erlangeurs may be different, I don't know.

-michael turner

Bengt Kleberg

unread,
May 18, 2011, 2:14:37 AM5/18/11
to erlang-q...@erlang.org
Greetings,

Another possible take on what the proper behaviour should be, is perhaps
found when thinking about the question:

Which rule minimises the amount of damage if I misunderstand it?

Say that I want to reply to one person only and use Reply-to when the
rule is to send to the whole list. It is a possible misunderstanding and
would be damaging if the email goes out to everybody.

On the other hand, I want to reply to all and use Reply-to when the rule
is to send to the author only. It is a possible misunderstanding and
only one person gets the email. I will notice this when it never reaches
the list. I can then resend it to everybody. More work, but no damage.


bengt

Pierpaolo Bernardi

unread,
May 18, 2011, 3:38:21 AM5/18/11
to Michael Turner, erlang-q...@erlang.org
On Wed, May 18, 2011 at 07:35, Michael Turner
<michael.eu...@gmail.com> wrote:
> Does anyone have any statistics on this question? That is, what percentage
> of mailing lists "do it wrong"? It's counterintuitive to me that  a "reply"
> on this mailing list is only to the individual. "Reply" is "Reply to the
> list" on every other mailing list I'm currently on, and on almost every
> mailing list I can remember being on. But perhaps my lifetime mailing list
> membership doesn't approach statistical significance.
> Although it may get me accused of "blindly following the herd," let me
> assert it anyway: arguments from "intuition" in commonly used software
> interfaces only work when you have statistically significant user support
> for them, not some purely formal, rule-based argument for your *personal*
> intuition. What's "intuitive" to one person may be counterintuitive to many.

According to your intuition, what should be the difference between
an action called "Reply" and another called "Reply to all"?

Michael Turner

unread,
May 18, 2011, 4:36:43 AM5/18/11
to Pierpaolo Bernardi, erlang-q...@erlang.org
Pierpalo asks: "According to your intuition, what should be the difference between

an action called "Reply" and another called "Reply to all"?"

My intuitions about what ANY response should be to ANY request for action depend on my personal experience and on the circumstances of the request. And I'm hardly alone in that. In user interface design, this is called "The Principle of Least Astonishment."


On a mailing list, I'm slightly astonished ("dismayed" would be a better word) when I reply to the list (or so I think) and discover later (IF I ever do) that the reply went to an individual instead. Here, I would expect "Reply" and "Reply to all" to do the same thing. That's redundant, you say? Well, so what? Life is redundant. Then you die.

I understand the argument from risk: Yes, every so often, somebody thinks they are replying to an individual when in fact they are replying to the list. I've done this mysefl, and suffered embarrassment.

But risk correlates with reward, as with anything in life, and a mailing list is *always* a balance between individual risks of embarrassment ("Will I seem stupid to some people? Will the answer to my question come to me a second after I hit Send? Was there an embarrassing typo in what I wrote?") and collective reward: everybody gets to see the answers; the only people who lose are those who find the answer--or the inbox clutter--annoying. (Presumably, the signal averages out to be positive for most; and for those for whom it doesn't, unsubscribing is always an option.) 

So, in this case, doing the more expected, less astonishing thing is quite aligned with the spirit of mailing lists, even if it's in violation of the letter of IETF law. Sometimes, the most rational thing to do is not the purely logical thing to do. In those cases, I side with rationality. But look: there's cultural variation. Maybe most people in the Erlang world have different expectations or thresholds of "astonishment". So the most rational thing would probably be to put it to a vote, on the list. After all, the issue's just going to come up again, chewing up yet more of that "bandwidth" that Raimo's so worried about conserving. So why not just find out what most people want and do that?

-michael turner

Ladislav Lenart

unread,
May 18, 2011, 4:51:11 AM5/18/11
to Pierpaolo Bernardi, erlang-q...@erlang.org
Hello.

On 18.5.2011 09:38, Pierpaolo Bernardi wrote:
> On Wed, May 18, 2011 at 07:35, Michael Turner
> <michael.eu...@gmail.com> wrote:
>> Does anyone have any statistics on this question? That is, what percentage
>> of mailing lists "do it wrong"? It's counterintuitive to me that a "reply"
>> on this mailing list is only to the individual. "Reply" is "Reply to the
>> list" on every other mailing list I'm currently on, and on almost every
>> mailing list I can remember being on. But perhaps my lifetime mailing list
>> membership doesn't approach statistical significance.
>> Although it may get me accused of "blindly following the herd," let me
>> assert it anyway: arguments from "intuition" in commonly used software
>> interfaces only work when you have statistically significant user support
>> for them, not some purely formal, rule-based argument for your *personal*
>> intuition. What's "intuitive" to one person may be counterintuitive to many.
>
> According to your intuition, what should be the difference between
> an action called "Reply" and another called "Reply to all"?

But this does not take into account that most users of this mailing
list are already familiar with the way other mailing lists work. They
already know (perhaps by trial and error from a long ago) that "Reply"
replies to all the list members. And in this situation this mailing
list is the one that breaks their "intuition" (habit, familiarity).

Your question works only for a first time mailing list user with
no previous exposure to any mailing list. In such a situation the
labels "Reply" and "Reply to all" will be all the information she
has to decide.


Ladislav Lenart

PS: I am not biased to any side on this one.

Pierpaolo Bernardi

unread,
May 18, 2011, 4:54:53 AM5/18/11
to Alex Shneyderman, erlang-q...@erlang.org
On Wed, May 18, 2011 at 10:28, Alex Shneyderman <a.shne...@gmail.com> wrote:
>> According to your intuition, what should be the difference between
>> an action called "Reply" and another called "Reply to all"?
>
> In the case of this list (or any mailing list) I would expect reply to
> go to the list
> because I am aware of the fact that the discussion is to be conducted on
> that list. If I want to make sure that the email goes to the original author I
> will take extra care/effort to send the reply to that one person.
>
> And it is not just his intuition - my intuition tells me the same
> thing as his :-)

OK. That would be my intuition, too, if there was only one action
available for replying to messages. But in every modern mail client
there are two possibilities, usually labeled something like "reply"
and "reply to all", so my question still stands unanswered.

The people who complain about the correct behaviour could easily
obtain their desired behaviour if they just *don't* use the "reply"
command (Never. Not only for messages coming from properly
configured mailing lists), and *always* use "reply to all" (Always.
Not only for for messages coming for properly configured mailing lists).

I would like to understand *why* you don't judge this very simple
solution to your problem as adeguate. Really. Mine is not a
rethorical question.

P.

Ivan Uemlianin

unread,
May 18, 2011, 4:55:19 AM5/18/11
to erlang-q...@erlang.org
Thunderbird has a "reply list" option in the GUI, so this issue must
have been sufficiently annoying to the hackers at the Mozilla Foundation.

Ivan


--
============================================================
Ivan A. Uemlianin
Speech Technology Research and Development

iv...@llaisdy.com
www.llaisdy.com
llaisdy.wordpress.com
www.linkedin.com/in/ivanuemlianin

"Froh, froh! Wie seine Sonnen, seine Sonnen fliegen"
(Schiller, Beethoven)
============================================================

Michael Turner

unread,
May 18, 2011, 6:00:40 AM5/18/11
to Pierpaolo Bernardi, erlang-q...@erlang.org, Alex Shneyderman
"I would like to understand *why* you don't  judge this very simple solution to your problem as adeguate."

It's not just about me. It's about people who have never encountered this controversy before, because they're on normal mailing lists, and who write their first-ever message (and many more afterward) to *this* list. People who haven't even subscribed yet.

So, what do you propose?  Something like this, perhaps: In the sign-on message for new subscribers to the Erlang mailing list, we include a message saying, "Get in the habit of always using 'Reply all' instead of 'Reply', for *all* of your e-mail correspondence, and after a while, you won't find it annoying in the least that this mailing list has 'Reply-to' set only to the address of the message sender, unlike other mailing lists you're on."

Or, if not that, then exactly *how* do you propose to change the world's habits? (Venture Capitalists have a term for this, when they encounter a business plan that's predicated on people giving up habits: "Boiling the ocean.")

When it's "purely logical versus human nature", human nature always wins.

-michael turner

Robert Virding

unread,
May 18, 2011, 6:15:43 AM5/18/11
to Michael Turner, erlang-q...@erlang.org, Alex Shneyderman
I have so far studiously avoided getting in any of these discussions. I personally think that the current way is what best corresponds to my view of a mailing-list, it is a list mail addresses. When I post to the list I am really just sending to all the people on the list, it is a practical and simple way of keeping track of to whom I am sending. So a reply is a reply to the sender. This maybe a slightly naïve way of viewing a list but to me this is what a mailing-list is.

If it were a forum, which I think it should be, then it would be a different matter.

Robert

Raimo Niskanen

unread,
May 18, 2011, 6:25:44 AM5/18/11
to erlang-q...@erlang.org
On Wed, May 18, 2011 at 05:36:43PM +0900, Michael Turner wrote:
:

> thing would probably be to put it to a vote, on the list. After all, the
> issue's just going to come up again, chewing up yet more of that "bandwidth"
> that Raimo's so worried about conserving. So why not just find out what most

That was an expression that means mine and others mental bandwidth.

> people want and do that?
>
> -michael turner

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

Pierpaolo Bernardi

unread,
May 18, 2011, 6:32:10 AM5/18/11
to Michael Turner, erlang-q...@erlang.org, Alex Shneyderman
On Wed, May 18, 2011 at 12:00, Michael Turner
<michael.eu...@gmail.com> wrote:

> So, what do you propose?

I propose doing nothing. 8^)

Cheers

Frédéric Trottier-Hébert

unread,
May 18, 2011, 7:55:14 AM5/18/11
to Erlang Questions
I personally see a practical side to the current list functionality. Get it wrong and you can re-send your e-mail to the list without any embarrassment. Get it wrong in a list where 'Reply' emails to the list and you might be disclosing personal or private information to the public, only for it to later be indexed by search engines.

One clearly has worse non-reversible consequences than the other. My vote is to keep things the way they are right now.

Raimo Niskanen

unread,
May 18, 2011, 8:21:03 AM5/18/11
to erlang-q...@erlang.org
On Tue, May 17, 2011 at 01:04:58PM +0200, Alexander Krasnukhin wrote:
> Hej,
>
> Why this mailing list doesn't add itself to the 'reply-to' header? I see it
> isn't uncommon for subscribers to send message to the author directly
> instead of the list.
>
> I wonder why?

1) This is an old mailing list. It has been around since 1997,
which is long before Google et.al started to violate then
already accepted mailing list behaviours probably with the
intention to unify forum like behaviour with mailing lists.
It has always been like this, expect for a short while when
I changed mailing list software and accidentally configured
the behaviour you ask and the list exploded with dislike.
The existing subscribers expect this behaviour.

2) It is according to Internet standards.

3) It lowers the probability of sending privately intended mails
to the list.

One might argue that it is not proven that the majority of
the currently existing subscribers actually want it this way.
That is correct, but it is just a few new subscribers asking
this question getting little positive response from the
existing subscribers. And we all have other things to do than
to dig up already worn out arguments in this futile debate.

If a large number of old reliable subscribers start voicing
the opinion that this Reply-To setting is now a bad idea
we might change the setting. Such a controversial change
would require a _large_ majority.

I anyone tries to start a flamewar about changing the Reply-To
setting it will be regarded as off-topic and nonproductive
and they will end up ignored or banned.

>
> --
> Regards,
> Alexander

> _______________________________________________
> erlang-questions mailing list
> erlang-q...@erlang.org
> http://erlang.org/mailman/listinfo/erlang-questions


--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

Raimo Niskanen

unread,
May 18, 2011, 8:30:26 AM5/18/11
to erlang-q...@erlang.org
On Tue, May 17, 2011 at 05:07:50PM +0200, Alexander Krasnukhin wrote:
> Yes, yes. I've got this. People from telecom will always rely on standards
> instead of people expectations. Good. Right. Understandable.

There are standards and often conflicting standards. We have already
made a delibirate choiche of which standards we believe in.

There are different people expecting different things.
Newcomers to a list should not expect that all oldtimers
expect the same as themselves.

If this list behaviour feels differently than other list it
depends which lists you regard as the other. Many lists
today are really Google groups, and they seem to have chosen
to violate Internet standards since they are more like a
forum, and in forums private messages do not exist.

The default setting for both Majordomo and Mailman is to
not munge Reply-To, and their documentation discourages
changing this. All mailing lists at e.g openbsd.org
do not munge Reply-To.

Dmitrii Dimandt

unread,
May 18, 2011, 8:36:49 AM5/18/11
to Erlang Questions

I'd disagree with you on that. I receive an email from the list. I send my emails to the list. It's one sender and one recepient. So I expect Reply-To to send my email back to the list.

Moreover, if you hit "Reply All", you'll end up sending multiple emails to seemingly random people:

Right now this email will be sent To: Richard O'Keefe, CC: Alexandr Krasnukhin, Erlang Questions. Both you and Alexandr will end up with two copies of my letter (one sent directly from me and one sent from the mailing list). This is clearly not the behaviour I'd want when I want to reply to a message from the mailing list.

The number of recepients varies depending on which email you reply to, but the idea is the same. Instead of sending one email to one recepient (the list) I end up spamming people :)

So what do I have do now? I have to delete all the extra emails and move Erlang Questions to the "To:" field. This way I increase the chance that the recepient(s) will also reply to the list and not to me directly.

Alexander Krasnukhin

unread,
May 18, 2011, 8:43:54 AM5/18/11
to erlang-q...@erlang.org
Seriously, I do understand your point. It wasn't a sarcasm or a joke. 
--
Regards,
Alexander

Robert Virding

unread,
May 18, 2011, 10:06:37 AM5/18/11
to Alexander Krasnukhin, erlang-q...@erlang.org
How about we completely side-step the whole issue and re-structure the various erlang mailing lists a forum instead? And by choosing one of the common and free forum packages we will automatically get a standard (in the sense of being common and much used) behaviour.

This is also a serious suggestion.

Robert

Jack Moffitt

unread,
May 18, 2011, 10:11:17 AM5/18/11
to Robert Virding, erlang-q...@erlang.org
> How about we completely side-step the whole issue and re-structure the
> various erlang mailing lists a forum instead? And by choosing one of the
> common and free forum packages we will automatically get a standard (in the
> sense of being common and much used) behaviour.

I really dislike forums. it's very easy for me to rapidly read and
reply to any topics on a mailing list, but with a forum I have to 1)
visit a particular page 2) manually click around. I much prefer having
things in an email client which is optimized for the job.

The only advantage to forums in my opinion is that the archives tend
to be much better than mailing list archives.

jack.

Ivan Uemlianin

unread,
May 18, 2011, 10:18:01 AM5/18/11
to erlang-q...@erlang.org
On 18/05/2011 15:11, Jack Moffitt wrote:
> I really dislike forums. it's very easy for me to rapidly read and
> reply to any topics on a mailing list, but with a forum I have to 1)
> visit a particular page 2) manually click around. I much prefer having
> things in an email client which is optimized for the job.

+1

--
============================================================
Ivan A. Uemlianin
Speech Technology Research and Development

iv...@llaisdy.com
www.llaisdy.com
llaisdy.wordpress.com
www.linkedin.com/in/ivanuemlianin

"Froh, froh! Wie seine Sonnen, seine Sonnen fliegen"
(Schiller, Beethoven)
============================================================

Parnell Springmeyer

unread,
May 18, 2011, 11:05:20 AM5/18/11
to Michael Turner, erlang-q...@erlang.org
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Um, isn't it client specific and not list specific? Every list I've been
a part of has a broad reply. So if I send a reply to
erlang-q...@erlang.org with the "Re: [erlang-questions] 'reply-to'
header in this mailing list" subject it goes to everyone on that list.

If I do a wide reply (Emacs: Shft-f) it will send the reply message to
the specific person I'm replying to /and/ it will send it to the list
(as is happening with this email).

I can also send just the reply to the list, or just a reply to the
specific person. They are just different commands.

As it stands, the mailing list does exactly what I expect it to. Maybe
your software is what's not living up to your familiarity/intuitive
standards?

Michael Turner <michael.eu...@gmail.com> writes:

- --
Parnell "ixmatus" Springmeyer (http://ixmat.us)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
Comment: GPGTools - http://gpgtools.org

iQEcBAEBAgAGBQJN0+AwAAoJEPvtlbpI1POL1XsIAKqeSs9CILOT9zgaV74S89Ij
kWSsf70Kh+MQeG0Q0L84YO1YvZ9vKcPiN3sShzGuVHddIPDJESOSJT5v0wNb9T6I
LUU1cY+QMkoOBE8NUCQV6xcS6go5SjF0/gWbdWTH/uvRy0LVRIBnsbM+nFCPmLCr
cAlNB7ZOi8T1VGZk0jIGoknolzrAL8BuHua5KpZcJns5D8xn0sBOiZZEJzIZTGRG
MJ1FYPDp4V61QI+vrUlZxb2OqHej60yhG9kzcyzlAd3Np6vCscFB0hZ0iQzAVcVi
ruT+Z5xD8+F3YcxhafIENGJTWetsNzgVO6khVkdVBaw5AYc97/yquNqLOfLokME=
=4PpW
-----END PGP SIGNATURE-----

Pierpaolo Bernardi

unread,
May 18, 2011, 11:32:21 AM5/18/11
to Ivan Uemlianin, erlang-q...@erlang.org
On Wed, May 18, 2011 at 16:18, Ivan Uemlianin <iv...@llaisdy.com> wrote:
> On 18/05/2011 15:11, Jack Moffitt wrote:
>>
>> I really dislike forums. it's very easy for me to rapidly read and
>> reply to any topics on a mailing list, but with a forum I have to 1)
>> visit a particular page 2) manually click around. I much prefer having
>> things in an email client which is optimized for the job.
>
> +1

+1

Raimo Niskanen

unread,
May 19, 2011, 5:03:16 AM5/19/11
to erlang-q...@erlang.org
On Wed, May 18, 2011 at 08:11:17AM -0600, Jack Moffitt wrote:
> > How about we completely side-step the whole issue and re-structure the
> > various erlang mailing lists a forum instead? And by choosing one of the
> > common and free forum packages we will automatically get a standard (in the
> > sense of being common and much used) behaviour.
>
> I really dislike forums. it's very easy for me to rapidly read and
> reply to any topics on a mailing list, but with a forum I have to 1)
> visit a particular page 2) manually click around. I much prefer having
> things in an email client which is optimized for the job.
>
> The only advantage to forums in my opinion is that the archives tend
> to be much better than mailing list archives.

The archive is a plus for a forum.

There does not seem to be any religious user fractions disaggreing on
how forums should behave. That is also a plus.

Free forum packages often means PHP, MySQL or other sysadm hazzles.
They are more complicated than a mailing list. That is a minus for a forum
(from my point of view). There is of course other party forum hosting,
but they we loose control of the forum archives...

>
> jack.
> _______________________________________________
> erlang-questions mailing list
> erlang-q...@erlang.org
> http://erlang.org/mailman/listinfo/erlang-questions

--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

Jeff Schultz

unread,
May 19, 2011, 11:15:36 AM5/19/11
to erlang-q...@erlang.org
On Wed, May 18, 2011 at 02:06:37PM +0000, Robert Virding wrote:
> How about we completely side-step the whole issue and re-structure
> the various erlang mailing lists a forum instead? And by choosing one
> of the common and free forum packages we will automatically get a
> standard (in the sense of being common and much used) behaviour.

> This is also a serious suggestion.

-1. The mailing list works well the way it is.

(As far as my, personal, workflow is concerned, forum software makes
it hard work for me to collect the material I will want to look at
again and catalogue it to suit my needs. I suppose businesses like
Google prefer that because they can serve me new ads each time I look
for something I remember seeing last year that might be helpful to me
right now. I see that as their problem, not mine.)


Jeff Schultz

David Mercer

unread,
May 19, 2011, 12:35:14 PM5/19/11
to Robert Virding, Alexander Krasnukhin, erlang-q...@erlang.org

My comments in-line with reply below.

 

From: erlang-quest...@erlang.org [mailto:erlang-quest...@erlang.org] On Behalf Of Robert Virding
Sent: Wednesday, May 18, 2011 9:07 AM
To: Alexander Krasnukhin
Cc: erlang-q...@erlang.org
Subject: Re: [erlang-questions] 'reply-to' header in this mailing list

 

How about we completely side-step the whole issue and re-structure the various erlang mailing lists a forum instead? And by choosing one of the common and free forum packages we will automatically get a standard (in the sense of being common and much used) behaviour.

This is also a serious suggestion.

 

[DBM] What’s the difference between a forum and a mailing list?  I tend to think of forums as being something like Usenet, but I haven’t used that in years.  Some people seem to think they’re like Google Groups, which I don’t really use that much.  Can someone please elucidate the distinction between a mailing list and a forum?

 

Thanks.

 

DBM

Vance Shipley

unread,
May 19, 2011, 12:57:16 PM5/19/11
to David Mercer, erlang-q...@erlang.org
On Thu, May 19, 2011 at 11:35:14AM -0500, David Mercer wrote:
} Can someone please elucidate the distinction between a mailing
} list and a forum?

I have come to the conclusion that what is beneath these sort
of debates amounts to a generational gap. Those who grew up
with a mouse in their hands have different expectations than
those of us who grew up with our hands planted on the keyboard
looking at a command prompt. As one of the later my view is
that the distinction is:

mailing list: push
forum: pull

--
-Vance

OvermindDL1

unread,
May 19, 2011, 8:01:31 PM5/19/11
to erlang-q...@erlang.org, Robert Virding, Alexander Krasnukhin, David Mercer, Vance Shipley

Why can it not just be configurable on a person by person basis by editing their own user preferences on the mailing list server?

Certainly the mailing list software is not so poorly designed so as to require such a person specific option to be set only globally.  ;-)

Richard O'Keefe

unread,
May 19, 2011, 11:01:20 PM5/19/11
to erlang-questions Questions
I should like to point out that the *proposal* to change the
currently very sensible behaviour of this list has *already*
cost me far more time than any change would credibly save me.
When you add up all the other people who've been following
it, the waste of time is quite scary.

IF YOU DON'T LIKE IT, LEARN TO USE THE "REPLY ALL" BUTTON
ALL THE TIME.

Richard O'Keefe

unread,
May 20, 2011, 2:10:48 AM5/20/11
to Mike Oxford, erlang-q...@erlang.org
> On Tue, May 17, 2011 at 5:25 PM, Todd <t.green...@gmail.com> wrote:
> 4b. Side note: is anyone concerned about Akka/Typesafe stealing mindshare?

Having read Williamson's "Legion of Space" series, I would feel rather
unhappy using AKKA (:-).

Mazen Harake

unread,
May 20, 2011, 2:35:28 AM5/20/11
to erlang-questions Questions
First thing I said heh. no one listened... :(

Looking forward to having the same discussion in a few months time again :P

Michael Truog

unread,
May 20, 2011, 2:59:16 AM5/20/11
to Mike Oxford, erlang-q...@erlang.org
On 05/19/2011 11:10 PM, Richard O'Keefe wrote:
>> On Tue, May 17, 2011 at 5:25 PM, Todd <t.green...@gmail.com> wrote:
>> 4b. Side note: is anyone concerned about Akka/Typesafe stealing mindshare?
> Having read Williamson's "Legion of Space" series, I would feel rather
> unhappy using AKKA (:-).

Not sure if you saw it, but there now is pykka (for python, at https://github.com/jodal/pykka ).

Even if these and other libraries (jetlang is the basis for akka, kilim which came before it, in the Java world, etc.) support message passing based scheduling of light-weight processes in a way that facilitates creating Actors, the libraries are unlikely to perform as well as Erlang because:
- The amount of research/development that has gone into Erlang
- The process-based garbage collection which can not be found through a message passing library

Ok, even if the message based scheduling of light-weight processes is as efficient (comparable) to Erlang (ignoring garbage collection problems), a library will not give you code-level fault-tolerance (unless you go through a lot of painful development with custom code that lacks testing and increases the complexity of your codebase). So, I do not think there will be an Erlang replacement anytime soon.

Raimo Niskanen

unread,
May 20, 2011, 4:05:24 AM5/20/11
to erlang-q...@erlang.org

Oh yes it is, I hope "poorly designed" was the reason for the ";-)".

I have run some mailing lists and only looked at running forums,
but they are different software packages. Popular mailing list
softwares are e.g "Mailman" or "Majordomo", forums "phpBB",
"UseBB", "WWWBoard", "YaBB", etc.

A mailing list is centered around the mails. Users posts by sending
a mail to the list, the software distributes the mail to all
subscirbers and possibly keeps an archive of all posts.
Often the origin address of the mail is used to verify that
a mail is valid to post. And that is about it.

A forum is centered about the archive/bulletin board. Users have
to log on, there has to be a web server handling the user session,
the post is written through a web interface, users have more
settings e.g an Avatar and there has to be permission handling
of which user is allowed to post to which forum section.
There has to be moderators that can completely delete threads
that are inappropriate (in mailing lists changing the archive
is rare done since all subscribers know all posts anyway).
You can often get a mail when a thread you are "watching" is
updated but you are supposed to read through the web interface.
Forums can have mailing list extensions so you can post
by sending a mail, possibly also get the posts as mails.
I have been on forums where this appeared to be upcoming
features but were not enabled...

So, mailing list software is designed so that the forum model
is not on the map at all except keeping an archive. Forum software
may be designed to act as mailing lists, but I do not know how well
they do it.

> _______________________________________________
> erlang-questions mailing list
> erlang-q...@erlang.org
> http://erlang.org/mailman/listinfo/erlang-questions


--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

Raimo Niskanen

unread,
May 20, 2011, 4:11:19 AM5/20/11
to erlang-q...@erlang.org
On Fri, May 20, 2011 at 08:35:28AM +0200, Mazen Harake wrote:
> First thing I said heh. no one listened... :(
>
> Looking forward to having the same discussion in a few months time again :P

Oh yes. Made me even consider putting 'reply-to' in the spam filter ;-)

>
> On 20 May 2011 05:01, Richard O'Keefe <o...@cs.otago.ac.nz> wrote:
>
> > I should like to point out that the *proposal* to change the
> > currently very sensible behaviour of this list has *already*
> > cost me far more time than any change would credibly save me.
> > When you add up all the other people who've been following
> > it, the waste of time is quite scary.
> >
> > IF YOU DON'T LIKE IT, LEARN TO USE THE "REPLY ALL" BUTTON
> > ALL THE TIME.
> >
> >
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-q...@erlang.org
> > http://erlang.org/mailman/listinfo/erlang-questions
> >

> _______________________________________________
> erlang-questions mailing list
> erlang-q...@erlang.org
> http://erlang.org/mailman/listinfo/erlang-questions


--

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

Max Schubert

unread,
May 20, 2011, 7:53:01 AM5/20/11
to erlang-q...@erlang.org
The Ruby on Rails lists have both a web-based forum and forum-to-email
gateway - users can choose to use either interface to create and
respond to questions and responses made using either interface are
seen on both interfaces as well.

Max

Andy Kriger

unread,
May 20, 2011, 1:29:58 PM5/20/11
to Michael Truog, erlang-q...@erlang.org

If anything Akka will expose more Java folks to Erlang concepts and
potentially draw people looking for a way out of neo-COBOL.

Jesper Louis Andersen

unread,
May 20, 2011, 2:56:15 PM5/20/11
to Todd, erlang-q...@erlang.org
On Wed, May 18, 2011 at 02:25, Todd <t.green...@gmail.com> wrote:

Let me be quite blunt here...

> 1. In general, what are the most valuable libraries to learn, both within
> the Erlang dist and external?
>
> 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.

I think this approach to Erlang is wrong. Rather than ask for a set of
"standard" modules to look into you should attack it on a on-demand
basis when you find a need for a specific library. Personally, I
really like the Agner system which aims to be a system listing
available software so you can use it. It intermingles with the Rebar
build system in a neat way.

Erlang seeks to provide tools, not solutions. As such, you will find a
lot of tools in the OTP distribution and elsewhere which will give you
stuff to write your own solutions. But you won't find any prebaked
solutions which magically solves the problem you are looking at.

> 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...

There is no easy way to multi-thread an app so it gives good speedup
when adding more cores. There are some general guidelines you can
follow when writing the program, but they do not always yield a
speedup. Here is a simple module:

-module(foo).
-compile(export_all).

m(X) ->
X*2.

test_input() ->
lists:seq(1, 10000).

t1(L) ->
timer:tc(fun() ->
[m(X) || X <- L]
end).

t2(L) ->
timer:tc(rpc, pmap, [{foo, m}, [], L]).

where t1/1 and t2/1 are our tests. t1 uses a list comprehension and t2
uses the pmap function of the rpc module to execute in parallel on my
two cores. A simple experiment in the shell:

Eshell V5.8.4 (abort with ^G)
1> c(foo).
{ok,foo}
2> L = test_input().
** exception error: undefined shell command test_input/0
3> L = foo:test_input().
[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|...]
4> X = foo:t1(L).
{2491,
[2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,
44,46,48,50,52,54|...]}
5> Y = foo:t2(L).
{65111,
[2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,
44,46,48,50,52,54|...]}
6>

shows how t1 is much much faster than t2. You need to know a lot about
the problem at hand to make it faster. If your m/1 function is altered
to this:

m(X) ->
timer:sleep(3),
X*2.

so we in the parallel example can do other work in between, then the
numbers are different:

3> X1 = foo:t1(L).
{40112834,
[2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,
44,46,48,50,52,54|...]}
4> X2 = foo:t2(L).
{105134,
[2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,
44,46,48,50,52,54|...]}

in much in favor of t2. Hopefully this shows you need to know about
your problem to make it go faster. There is no magical solution.

It is also important to note that in Erlang, concurrency was added to
build fault tolerant programs. Not to make programs run faster. It is
neat that it is often the case that it helps on multi-core machines,
but it was not the initial goal.

> 4. Along that note, does anyone have any ideas as to how to tackle the
> Typesafe 'getting started tutorial?'
>
> http://typesafe.com/resources/getting-started/tutorials/getting-started-first-scala.html

Yikes! All that code in Erlang is:

calc_pi_worker({Start, N}) ->
lists:sum(
[4.0 * (1 - (I rem 2) * 2) / (2 * I + 1) ||
I <- lists:seq(Start, Start+N-1)]).

calc_pi() ->
K = 10000,
lists:sum([calc_pi_worker({I*K, K}) || I <- lists:seq(0,K-1)]).

if we run it sequentially it gives the correct result, but is fairly
slow since we generate a lot of data that subsequently becomes
garbage. calc_pi_worker/1 can be optimized by moving stuff out of the
main loop and not building the list with lists:seq/2 each time around.
calc_pi/0 can be optimized by using the plists library
(https://github.com/eveel/plists). So while we are at it, let us
parallelize. And let us not create all that boiler plate while doing
it! Here is the code:

-module(foo).
-compile(export_all).

calc_pi_worker({Start, N}) ->
calc_pi_worker(Start, N, 0).

calc_pi_worker(_I, 0, Acc) -> Acc;
calc_pi_worker(I, K, Acc) ->
S = (1 - (I rem 2) * 2) / (2 * I + 1),
calc_pi_worker(I+1, K-1, Acc + S).

calc_pi() ->
K = 10000,
4.0 * lists:sum(plists:map(fun foo:calc_pi_worker/1,
[{I*K, K} || I <- lists:seq(0, K-1)])).

Yes, we don't have to change anything else. This is parallel using as
many cores as you have. It can be tuned some more, but for a start it
is magnificent, even though it is slower than the Akka-version.

> 4b. Side note: is anyone concerned about Akka/Typesafe stealing mindshare?

Well, if you want to write all the boiler plate code they have to
write, then go ahead. I'd rather not :)

Seriously though, the mindshare we will steal are from Non-concurrent
languages, be it Python, Ruby, Java, C# or ... -- We are in the same
boat as Scala/Akka, Go and so on. The influx of interested programmers
will be large, so we don't have to worry too much about who steals
from whom. Erlang has the distinct advantage of being old, tried,
battle-hardened and extremely robust. It has a main focus on fault
tolerance, which gives it some unique capabilities. Also, its focus on
using functional programming is a robustness advantage. You can't just
copy part of Erlang to obtain what it provides. You have to have all
of it and then some.

> 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?

Essentially this is handled by the application if it is written to
adhere to some rules of Erlang and if you write application such that
it does not assume all of it is present locally on a single VM, but is
distributed across multiple. There is no automatic solution here
either. For each application you will need to define what to do. For
some applications a 'takeover' is enough. There is one running and if
the node it runs on crashes, then another node will take over the job
and arrange that requests are now redirected to the new node. For
other systems, like Riak, all nodes are simultaneously runing and the
application on each node talks to the same application on other nodes
to internally manage state.

Yes, it is a hard problem. But Erlang provides you with the tools to solve 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?

I don't. The projects I am working on has the virtue that we can do
rolling upgrades by closing down machines and restart them. You will
have to ask someone else :)

> 7. Does anyone use dynamic load balancing of demand across a cluster (e.g.
> spinning up erlang processes to meet the demand curve?)

I am sure there are people who does this. But I'll let them answer the
question. It is not that hard to pull off.

> 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.

Integration is perhaps Erlangs strength. NIFs are for writing small
hotspots in your code in C for speed. The calc_pi_worker/1 from above
comes to mind for instance. Ports are used for several things. They
are a representation in the Erlang VM of something external. It can be
another process, where we have a pipe for communication. It can be a
file on disk. It can be a network socket. Or it can be a linked in
driver. Another option is to make a node in another language that
talks the Erlang distribution protocol. Yet another option is to use a
message queue like ZeroMQ or AQMP for communication. Finally, you can
do like my own project and simply implement the foreign protocol in
Erlang - BitTorrent in my case. Erlang rocks for implementing foreign
protocols.

> Also, I've continued to peck away at various newbie tutorials. Any
> comments/suggestions/corrections are welcome.

You never go wrong with Fred Herbert:

http://learnyousomeerlang.com/ - witty, informative, awesome -- even
if the octopus has too few tentacles.


--
J.

Todd Greenwood

unread,
May 21, 2011, 1:44:33 AM5/21/11
to Jesper Louis Andersen, erlang-q...@erlang.org
Jesper, thanks for the response. I've been a bit remiss in thanking
folks for their responses to my lengthy questions...I'm a bit pressed
for time as I'm packing in preparation for moving.

More inline:

On 5/20/11 11:56 AM, Jesper Louis Andersen wrote:
> On Wed, May 18, 2011 at 02:25, Todd<t.green...@gmail.com> wrote:
>
> Let me be quite blunt here...
>
>> 1. In general, what are the most valuable libraries to learn, both within
>> the Erlang dist and external?
>>
>> 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.
>
> I think this approach to Erlang is wrong. Rather than ask for a set of
> "standard" modules to look into you should attack it on a on-demand
> basis when you find a need for a specific library. Personally, I
> really like the Agner system which aims to be a system listing
> available software so you can use it. It intermingles with the Rebar
> build system in a neat way.

Thanks for mentioning Agner, that looks cool. I'll noodle around and
figure out how it links with rebar.

For those of you that have been programming in erlang for some time, it
would be useful for those of us, newer to erlang, to understand what
libraries are your bread-and-butter, as opposed to domain specific
libraries. As an example, if someone were to ask me this about Java, I'd
suggest...understand threading semantics, java.util.collections,
immutable collections (guava), IOC...and JUnit. The rest would be
specific to the problem domain (e.g. Spring Framework, hibernate|JDBC,
EJB3, and other more specific libraries. )

I'm pretty familiar with this sort of thing in other languages, but it's
nice to see such a clear example. For me, the missing piece was the rpc
module that contains the pmap function. I'll have to look closely at
that module.

Wow. That's impressive. I'll take a closer look at the plists module,
too. In a way, that's what I was talking about earlier in this email w/
respect to bread-and-butter libs. You pulled plists out of your back
pocket...what else have you got there?

I have to admit, this is something that really intrigues me... creating
an app that can move around in a cluster as nodes go up or down...as
well as responding to load and spinning up new processes on nodes to
handle the load. One thought I've had is to use erlang to manage os
processes to spin up new erlang nodes on remote machines. Or to have
erlang spin up an external resource, like a database or message queue
and link to 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?
>
> I don't. The projects I am working on has the virtue that we can do
> rolling upgrades by closing down machines and restart them. You will
> have to ask someone else :)

How do you insure that, as you roll a cluster from v1 to v2, the new v2
nodes don't corrupt the data that v1 is using?

On all the large projects I've been involved with
(java,jdbc,mysql,etc.), there are typically service level changes that
are tightly coupled to sql ddl changes... thereby requiring downing the
entire cluster, applying the ddl deltas to the dbs, and subsequently
restarting the service instances.

So, what is it about your strategy that allows you to do rolling upgrades?


>
>> 7. Does anyone use dynamic load balancing of demand across a cluster (e.g.
>> spinning up erlang processes to meet the demand curve?)
>
> I am sure there are people who does this. But I'll let them answer the
> question. It is not that hard to pull off.
>
>> 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.
>
> Integration is perhaps Erlangs strength. NIFs are for writing small
> hotspots in your code in C for speed. The calc_pi_worker/1 from above
> comes to mind for instance. Ports are used for several things. They
> are a representation in the Erlang VM of something external. It can be
> another process, where we have a pipe for communication.

> It can be a file on disk.

Is inotify the standard way to monitor file changes on disk from erlang?

http://www.trapexit.org/forum/viewtopic.php?p=44414

It can be a network socket. Or it can be a linked in
> driver. Another option is to make a node in another language that
> talks the Erlang distribution protocol. Yet another option is to use a
> message queue like ZeroMQ or AQMP for communication.

ZeroMQ is definitely interesting, provided you can accept message losses.

Finally, you can
> do like my own project and simply implement the foreign protocol in
> Erlang - BitTorrent in my case. Erlang rocks for implementing foreign
> protocols.
>

Ah, that's a great idea. I really hadn't thought of integrating at the
protocol layer.

>> Also, I've continued to peck away at various newbie tutorials. Any
>> comments/suggestions/corrections are welcome.
>
> You never go wrong with Fred Herbert:
>
> http://learnyousomeerlang.com/ - witty, informative, awesome -- even
> if the octopus has too few tentacles.
>
>

Yeah, that's a great site. I've also read all three books, several times
actually. For me, erlang has been quite a different learning curve from
other languages.

Thanks for your detailed responses. This has been really informative,
especially the calc_pi() example.

-Todd

Reply all
Reply to author
Forward
0 new messages