News for hackers. Stuff that matters.
Re:What's all this fuss about Erlang? (2007) by lngnmn on Tuesday January 24, 2017 @03:58PM (#13475378)
A practical language based on well-researched first principles. Details in the armstrong_thesis_2003.pdf

   * java is unsuitable
   * no pthreads, please (wrong concept)
   * immutable data (no locks - no problem)
   * isolated lightweight processes (share nothing)
   * communication by message-passing (grom Kay's OOP)
   * dynamic typing (good-enough, quick prototyping)
   * pattern matching (on receive)
   * supervision hierarchies (fault tolerance)
   * reusable components for server development
I probably forgot something
Re:What's all this fuss about Erlang? (2007) by XorNot on Tuesday January 24, 2017 @05:13PM (#13476190)
I've not found immutable data to be the big win people tout it as. In most of what I do acting on stale data is just as bad, which means I wind up needing a lock anyway.

Doing a < b and taking an action based on that result is as harmful with stale data.

Re:What's all this fuss about Erlang? (2007) by kqr on Wednesday January 25, 2017 @12:58AM (#13479015)
I'd like to tell you that stale data will always be a thing in any serious application because light only travels so fast. Therefore, you'll need to have sensible logic in the face of stale data either way, so it's not so bad as you think.

...and while that's true, I'd still like to hear the opinion of someone more knowledgeable because it's an issue that's been bugging me too.

Re:What's all this fuss about Erlang? (2007) by omgwtfpmr on Wednesday January 25, 2017 @04:06PM (#13486094)
This is a fair point: immutable data is just part of the solution. To get the win, you need to toss out all references to the old data when you update it: then you ensure that you can't access "stale" data. This requires some discipline, either manual (e.g., reusing the same variable name for the old and new bindings to ensure the stale binding is shadowed) or automatic (e.g., linear types).
Re:What's all this fuss about Erlang? (2007) by gardenhead on Tuesday January 24, 2017 @05:32PM (#13476383)
But the data can't be stale, because `a` and `b` are immutable
Re:What's all this fuss about Erlang? (2007) by ww520 on Tuesday January 24, 2017 @06:22PM (#13476762)
In the case of Erlang, how would immutable data help? The code all run in single thread execution path in each process; there's no need for lock anyway. Each process can't access data of another process.
Re:What's all this fuss about Erlang? (2007) by toast0 on Tuesday January 24, 2017 @09:27PM (#13477904)
Immutable data (along with per process heaps) makes the garbage collection very simple.
Re:What's all this fuss about Erlang? (2007) by jack9 on Wednesday January 25, 2017 @02:57AM (#13479591)
Isn't one of pony's strengths, that it's doing GC better?
Re:What's all this fuss about Erlang? (2007) by ww520 on Tuesday January 24, 2017 @11:29PM (#13478523)
As a developer writing code, I don't particularly care whether GC is simple or complicate, as long as it works correctly. That's the compiler writer's job.
Re:What's all this fuss about Erlang? (2007) by toast0 on Wednesday January 25, 2017 @12:02AM (#13478681)
A fundamental strength of Erlang is that as many things as possible are simple, which makes it easy to know that it works correctly and under what conditions it doesn't work so well [1]. The compiler writer isn't necessarily the GC writer either; although, it's probably the same couple of people in Erlang.

[1] If you touch a lot of ref counted binaries, without generating enough garbage on the process heap to trigger GC. GC time scales with process heap, if you get a large enough backlog in your mailbox, GC may reduce the throughput to the point where you can't recover, although doing selective receives if you don't trigger the optimization for new references[2] is much more painful than GC scaling.

[2] http://erlang.org/pipermail/erlang-questions/2010-June/05175...

EDIT: from slides about r19 GC [3], it seems that both of the GC issues I mentioned have had targeted changes: for refcounted binary issues, there's now a 'virtual binary heap' to help trigger GC; for GC with a big mailbox, there are different allocation strategies available which may help.

[3] https://www.erlang-solutions.com/blog/erlang-19-0-garbage-co...