Live data from Hacker News

Erlang and First-Person Shooters (2011) [pdf]

erlang-factory.com

41–44 of 44 posts

Re: Erlang and First-Person Shooters (2011) [pdf]

#41
Since some people were asking on how to get started with Erlang, some time ago this MOOC was posted on HN for an intro to learning Erlang/functional programming.

What I liked about it is that it assumes you have an imperative programming background so it isn't entirely like learning at a very slow pace (which leads me to lose interest): https://www.futurelearn.com/courses/functional-programming-e...

The next course after this is on the concurrency part of Erlang which is also on FutureLearn that I'm currently taking. It has video clips from Joe Armstrong teaching concurrency (one of the creators of the language).

Re: Erlang and First-Person Shooters (2011) [pdf]

#42
post #14
post #11

Earlier quoted context omitted.

Everything I've ever heard on that front is that Erlang should be considered a control layer which has any CPU-bound tasks run in C. Actors/message passing is a good synchronization primitive but there is apparently a whole host of issues with memory leaks regarding it in the "Erlang in Anger" e-book. I personally lost interest in Erlang because of it only supporting actors as a concurrency mechanism. They're good fo…

Well short answer long term it's the only viable model you are not going to use locking and STW gc on 500+ core system with few TBs of RAM.

Lock based concurrency is perfectly fine on 800 core systems with a pauseless gc and many TiB heaps. See Azul for an example using the JVM.

Re: Erlang and First-Person Shooters (2011) [pdf]

#43
post #33
post #25

Earlier quoted context omitted.

The Cowboy webserver is fairly easy to get started with and I really recommend checking it out, since a web server feels like a "very Erlang problem" to me. To answer your question though, I got started by playing with TCP and building a basic chat server. I spawned a new Erlang process for each user, used Erlang's internal messaging to share messages between processes, and then passed those messages along to TCP to…

Got a good book or website recommendation for learning Erlang? How does it compare/contrast with something like Akka (which I've got rudimentary experience with in Scala)?

Akka was basically the Scala implementation of Erlang's actor model.

The key differences are, for me, Erlang is easier to reason about (this is mostly how my mind works; Akka it felt like everything was reactive, that nothing is doing any work until it gets a message; Erlang it felt like the opposite, that every process is doing work until it decides it needs a message, and then it can check its mailbox, and optionally block until something ends up in it), and because of its functional nature, things that require special keywords in Akka, just fall out 'for free' in Erlang. For instance, 'become'. 'Become' is just calling another function in Erlang, that has different behavior. Erlang also has more reliability characteritics (not as efficient, but, no stop the world garbage collection, shared nothing, so the only way an exception in one actor can affect another is via an OOM, or specifically hooking up links/monitors such that it causes it to affect the other actor). Akka, however, gives you the speed of the JVM (which -is- better, in pure number cruncing, than Erlang), more libraries (though Erlang is no slouch there, and they all kind of fit the Erlang model), and OOness, if that's your thing.

Re: Erlang and First-Person Shooters (2011) [pdf]

#44
post #9

From a gamers perspective, the peer-to-peer lobby system used in the CoD series is one of the worst things about it. I can remember constantly having to migrate hosts, getting owned by the host because everyone else has a ping much higher than zero, and horrible lag when the host it chose had a bad connection. Cool technology, but at the cost of fun.

It should probably be mentioned that I am in Australia, where the majority of people have less than 12Mbps down, and even more likely less than 1Mbps up
Post reply on HN