[erlang-questions] Erlang beginner questions
Wed Apr 13 20:36:47 CEST 2011
"Let it crash" is the Erlang way of doing things, but it does NOT mean,
let the VM crash, but Erlang processes.
The VM is the saint cow in this context that absolutely must not crash.
> Are you saying that a
> linked-in driver is stable as long as there are no bugs in the native
> library, ie if the native library has been tested, then it should be fine
> and run with no issues?
You mean library = driver I guess. Yes, when it is as stable as Erlang
> Or, if say my physics library gets a billion things
> all at once and decides to implode, so it crashes - does the whole computer
> running this process crash as well?
No but the Erlang VM, if it's linked-in. Which is something you could
otherwise almost completely rely upon to keep running and keep
restarting and redoing whatever the uncompleted tasks had been when an
Erlang-process crashed (which, again, is a different level of crashing).
> Is there a better way to keep latency extremely low, sending and receiving
> millions of variables on the same machine many times per second?
It is. Not quite as fast as a function call but close.
> thinking of it like a box - the Physics box gets the current state &
> velocities, figures out the new state, and returns the state back to Erlang,
> which then takes things from there and delivers them to the appropriate
> I understand and will be implementing things in Erlang at the start for
> testing purposes, however I want to make my physics system modular and use a
> library that can be installed both on the server and on the client, so what
> is ultimately used for the various math-intensive things will need to be
> written in a language like C++. I've been planing on using Box2d and
> Bullet, which can both be implemented on iOS, Android, Mac & PC, as well as
> server-side. Am I approaching this correctly?
You have to figure out how many calls / messages are needed.
But in general it sounds very much like what you want is NOT a linked-in
driver but a port to a separate Erlang VM, that resides on the same
I think this is an example of how you'd want to do it:
Just you wouldn't embed Lua but your physics.
More information about the erlang-questions