I’ve read on this forum a couple times that Philip Wadler attempted to add static types to Erlang and stumbled on messages and pids/self. However, I know there are statically typed languages out there that have an actor library. (Rust, C#, Scala, Haskell, etc)
So, my question is, how do they implement the actor pattern and handle those issues?
Actix is Rust’s version of it, it uses the interface to ‘constrain’ a PID to accept certain message types down (though it can accept more) or you can go through a dynamic call (basically black-boxing the message like all messages on the BEAM are), which is less instantly efficient but can pass anything anywhere.
Akka for Java is Java’s implementation of it, it has the pure dynamic interface only, however it recently (couple years ago) got a typed layer on it, a summary of how to use it: https://akka.io/blog/2017/05/05/typed-intro