Nian implemented in Erlang.