This is the public announcement of maintenance termination of sfmt-erlang and tinymt-erlang software.
I, Kenji Rikitake, will no longer maintain sfmt-erlang and tinymt-erlang pseudo-random number generators (PRNGs) for Erlang.
PRNG algorithms of SFMT and TinyMT had their advantage in 2010 when I first started implementing them to Erlang/OTP as alternative modules of the random module (deprecated since OTP 18). After the emergence of xorshift, xoroshiro, and xoshiro algorithms by Sebastiano Vigna, however, the advantage of SFMT and TinyMT has been mostly eradicated. Please refer to the following paper preprint by Sebastiano Vigna for the further explanation of the known issues of SFMT and TinyMT:
Sebastiano Vigna, “It is high time we let go of the Mersenne Twister”, arXiv, 2019, eprint: 1910.06437, [1910.06437] It is high time we let go of the Mersenne Twister
Fortunately, the rand module, current PRNG of Erlang/OTP, has already employed variations of xorshift and xoroshiro algorithms called exsss and exro928ss, with the help of Sebastiano Vigna and the effort of Raimo Niskanen and other people in the OTP Team. So the general alternative solution is to use the rand module functions.
sfmt-erlang has the NIFs to generate many random numbers at once. For writing PRNG NIFs, the following repository will be helpful:
- Vigna has provided CC0-licensed reference implementations in C at his website: https://prng.di.unimi.it
- An MIT-licensed C++ header implementation set of Vigna’s algorithms is available here: GitHub - Reputeless/Xoshiro-cpp: Header-only Xoshiro/Xoroshiro PRNG wrapper library for modern C++ (C++17/C++20)
However, it would help if you remembered that Erlang/OTP rand module uses the 58-bit specialized version of Vigna’s PRNG algorithms, so the C and C++ implementations which are shown above are not a direct replacement of the rand module functions.
The following related repositories are in archive mode.
- sfmt-erlang: GitHub - jj1bdx/sfmt-erlang: sfmt-erlang: SIMD-oriented Fast Mersenne Twister (SFMT) for Erlang
- tinymt-erlang: GitHub - jj1bdx/tinymt-erlang: This software is no longer maintained. For archive/reference use only. -- Tiny Mersenne Twister (TinyMT) for Erlang
- tinymtdc-longbatch: GitHub - jj1bdx/tinymtdc-longbatch: TinyMT pre-calculated parameter list. See https://zenodo.org/record/5834954 for an alternative archive.