JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.68k stars 5.48k forks source link

move MersenneTwister out of Random #41272

Open StefanKarpinski opened 3 years ago

StefanKarpinski commented 3 years ago

We have to keep MersenneTwister around and thus keep dSFMT as a dependency of Julia itself even though we no longer use it as our default PRNG. For 2.0 we should move it out and consider exporting no specific PRNG type from Random, but rather have external packages that implement RNGs and either have a thin wrapper that re-exports whatever private specific PRNG is the default in the stdlib (currently Xoshiro), or perhaps cleaner, have a Xoshiro.jl package and vendor a copy of it as a stdlib. Or if we have a solution to upgrading stdlibs at that point we could make it a stdlib and have Random depend on it but not reexport the PRNG itself.

PallHaraldsson commented 1 year ago

Can at least the module DSFMT (and dSFMT_jll) be taken out of the sysimage (i.e. in a non-breaking way, still working, just to make it smaller)? I see DSFMT.jl is included in Random, so would it make using it (for the now-default RNG) slower? I see Kristoffer is trimming a lot from the sysimage, not sure this is large enough to bother.