You're not writing the number crunching code in Erlang, in this example. You're using Erlang to coordinate that number crunching via NIFs (C programs, managed and read from by Erlang). Dirty scheduling enables NIFs that run for longer than 10ms.
You're right. Please never implement your number-crunching in Erlang. It will be slow.
You're right. Please never implement your number-crunching in Erlang. It will be slow.