https://kotlinlang.org logo
#announcements
Title
# announcements
r

Ruckus

05/03/2017, 4:05 PM
Why should there be an RNG in the standard library? All the platforms Kotlin targets have libraries for that, so you could use those, or we could have a pure Kotlin version in its own library. This is getting #random
m

mg6maciej

05/03/2017, 4:07 PM
ruckustboom: I'm not saying it should have complete implementation. For JVM
kotlin.Random
would be a
typealias
to
java.util.Random
.
k

kevinmost

05/03/2017, 4:09 PM
right, this is how
List
is handled, for example
kotlin.List
typealiases to
java.util.List
r

Ruckus

05/03/2017, 4:10 PM
That could work, but I'm still of the opinion RNGs aren't a standard library feature. Maybe I'm in the minority, but I prefer smaller standard libraries and having extra functionality be in separate libraries.
m

mg6maciej

05/03/2017, 4:10 PM
And even
kotlin.ArrayList
.
I see no problems in splitting it.
r

Ruckus

05/03/2017, 4:14 PM
What do you mean by splitting it? I like the idea of typealiasing to existing libraries on a given platform, but I don't think it should be
kotlin.Random
. Maybe something like
kotlinx.Random
or even a separate
kotlinx.random
library that can forward to
Random
,
SecureRandom
, etc.
m

mg6maciej

05/03/2017, 4:16 PM
Splitting standard library.
k

kevinmost

05/03/2017, 4:17 PM
I would be fine with a kotlinx with all of this stuff
4 Views