3 ms·
It's not that simple. What if the sending process is a human operator trying to introspect your system with a remote console, and a slightly misspelled token i
by dnautics 7y ago
It's not that simple. What if the sending process is a human operator trying to introspect your system with a remote console, and a slightly misspelled token is sent? What is the right thing to do? Drop the message? Crash?
Sometimes one thing is the right thing to do and sometimes the other. But messages are such a low level concept in erlang... It's really hard to make a strongly typed system that doesn't pick one over the other, which is going to be the wrong answer half the time.
I'm not saying it can't be done, but many have tried and no one has succeeded yet.
- zachrose 7y agoI believe the right thing to do is to parse the response “into” an error and pass it to the error-handling branch that your compiler required when the handler was written. Or at least, that’s how it works in the statically typed language Elm, which guarantees that your compiled code will not throw any runtime errors.
- marci 7y agoFor those who want Elm + Erlang/Elixir, there's Elchemy http://elchemy.neontree.pl/new http://elchemy.neontree.pl/new