4 ms·
Yeah but what happens in rust if your match doesn't match the pattern? The compiler won't let you. In erlang, it throws an error, which you can let the runtim
by dnautics 6y ago
Yeah but what happens in rust if your match doesn't match the pattern? The compiler won't let you. In erlang, it throws an error, which you can let the runtime eat up. This can be a strategy for extremely lazy error handling.
- adwn 6y agoI'm not sure what you mean. In Rust, you can write: match msg { pattern1 => action1, pattern2 => action2, _ => {} // silently ignore }
- satvikpendem 6y agoI know about Erlang's let it fail philosophy but why would you want something to be caught at runtime when it could be caught at compile time? It doesn't seem to have any valid reasons.
- dnautics 6y agoNetsplits, for example. You don't want to keep track of every service that needs to be taken down with the dropped connection and notify them something bad has happened. Log, crash, cleanup the failure domain, restart, back off, reconnect later. Zero lines of code in erlang.