3 ms·
Pony actors are not really Erlang-like. In Erlang the scheduler is able to switch between processes at any point during execution (preemptive scheduler) and is
by amiramix 9y ago
Pony actors are not really Erlang-like. In Erlang the scheduler is able to switch between processes at any point during execution (preemptive scheduler) and is also able to garbage collect unused memory in the process at any point during execution.
In Pony developers must write behaviours in a way that allows the scheduler to give CPU to other behaviours and to run GC periodically to collect unused memory. Otherwise other behaviours won't be able to run or will consume too much memory.
https://tutorial.ponylang.org/gotchas/ https://tutorial.ponylang.org/gotchas/
Erlang processes are also much smarter. They can be linked to each other to be notified when their linked counterparts die. This allows to create a well structured hierarchy of processes, each one with a different role to fulfil in the application.
http://erlang.org/doc/design_principles/des_princ.html http://erlang.org/doc/design_principles/des_princ.html
A completely separate issue is their different approach to handling errors. Pony, similarly to Rust, tries to prevent the developer from crashing the application. Usually they do a decent job, but situation where the actor will need to crash or will never return are inevitable (see gotchas above, also imagine some dodgy code executed through FFI, etc).
Erlang takes a "let it crash" approach to managing those situations. Its BEAM (runtime, or VM in which the processes run) is the core that executes all processes. The core is not supposed to crash under normal circumstances but the processes are expected to crash as soon as they can't recover from an error.
http://lists.ponylang.org/pipermail/ponydev/2016-February/000291.html http://lists.ponylang.org/pipermail/ponydev/2016-February/00...