Hacker News new | past | comments | ask | show | jobs | submit login

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.



I'm not sure what you mean. In Rust, you can write:

    match msg {
        pattern1 => action1,
        pattern2 => action2,
        _ => {}  // silently ignore
    }


I 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.


Netsplits, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: