4 ms·
I'm not an expert either, but I think it basically comes down to 3 things: 1. typing messages - this is basically trivial, you can either create a specific ADT
by tomp 6y ago
I'm not an expert either, but I think it basically comes down to 3 things:
1. typing messages - this is basically trivial, you can either create a specific ADT for all the acceptable messages, or you can type messages in a "general" way as `(string, list[any])` or similar (provided that your language supports `any`)
2. typing of acceptable messages - that's way harder, as you need to model state in the typesystem - imagine "does this variable represent an open or closed file handle" and then updating that as the code calls `open`, `read` and `close` appropriately... Rust's borrowing is a simple example of that as well
3. regardless of (2), you need to figure out what to do with unacceptable messages - in a dynamically typed language like Erlang, I imagine those can happen anytime - but then even dynamic languages need to deal with "this process doesn't accept this message" so ...
this is the only mention that I found in Hamler's documentation about messages, so I'm guessing they're using the ADT approach mentioned in (1)
https://github.com/hamler-lang/documentation/blob/master/guides/01_WhyHamler.md#erlang-and-concurrency https://github.com/hamler-lang/documentation/blob/master/gui...
- tutfbhuf 6y ago> 2. typing of acceptable messages - that's way harder, as you need to model state in the typesystem - imagine "does this variable represent an open or closed file handle" and then updating that as the code calls `open`, `read` and `close` appropriately... I think that would be a good use case for Dependent Types.