Mersenne Twister in Other Languages and OS
Return to Versions of MT
The BeOS Random Number Library
GNU Octave is a
GNU Project's Matlab-alike language for numerical work.
Dirk Eddelbuettel kindly gives us
GNU Octave code
for random sources with uniform and normal distribution
based on MT19937.
Arno Wagner at University of Trier
ported the Mersenne Twister to
SmallEiffel (a free Eiffel compiler).
The code is available from
his Eiffel page.
a Matlab mex file (gzipped tar file) coded by
Drittes Physikalisches Institut
"I took the optimized version of Shawn Cokus and wrote a Matlab
mex file called mtrand, which can be used quite analog to
Matlab built-in function rand to generate random numbers in
the range [0,1)."
an alternative Python module for using your MT PRNG, because
"I had problems [Compiling with scxx and maybe the design for the MS plattform.]
with the version by Darrell Gallion. My version only needs the gcc from GNU."
Currently there is only the original algorithm implemented (not the speedup
changes by Cokus).
the souce code,
and here is
the test program.
implemented Mersenne Twister in the functional programming
language erlang (www.erlang.org). He also wrote an erlang-c interface to
the implementation by Cokus. Both of these can be found at
in the file
'erlmt.tar.gz'. (This implementation is out of link now, see
the implementation of Tim Bates.)
used mt19937-1.c to write a Perl module, Math::Random::Mersenne.
Check Math-Random-MT in
Comprehensive Perl Archive Network
Python extension module
random-number generators, one of which is MT19937. The module is
written in C, to be called from Python code.
An Ada implimentation of MT19937ar (new initialization, 2002/1/26)
is written by
This version has many other features: see the page of
A verilog implementation of mt19937
(not mt19937ar) by David Ljung Madison. (Notified on 2004/3/14)
Michael Kuyumcu has translated the C code into Mops,
which is an object-oriented programming language exclusively on the Macintosh.
Nick Lewycky has translated the C++ code into SML/NJ,
which is a functional programming language. (2006/1/8)
implemented MT19937 in the Linoleum programming
language (an Assembler-like very fast programming language.)
He made his implementation public domain, and
here it is.
(2006/5/30) (2007/6/18 address changed)
- Tim Bates made a erlang version of Mersenne Twister,
and posted it to the
erlang-questions mailing list. (Kenji Rikitake informed us).
Sean D. Stuber kindly wrote a PL/SQL version of Mersenne Twister,
Kingfisher kindly wrote a PHP version of Mersenne Twister,
The Mersenne Twister, in PHP.
- Réza Samadi kindly wrote a Python interface of 64-bit
version Mersenne Twister, pymt64.zip. Documentation updated (2013/1/7)
- Stefano Barbato kindly wrote a Go Language version of
Mersenne Twister, main.go. (2016/5/29)