Started to learn kotlin for Jvm and native and I g...
# language-proposals
a
Started to learn kotlin for Jvm and native and I got few suggestions for language improvement (few methods that will make the life easier) https://gist.github.com/d8c5d702e7e23e05a55b5ec9376383be Thank you for an amazing language that keeps growing Alon Regev
👍 2
😁 2
youtrack 1
g
Looks more like #stdlib Also random() eventually will be added to stdlib-common, there is proposal about this
2
a
OK thanks, but is it possible to implement the other functions that I mentioned
g
Console clear sound like something platform-specific There are different console terminals with different API. Does C# supports all the consoles? Maybe make sense just to have a separate library for that.
I didn’t get how Readline should work
a
Like instead of of readline return only string, make readline functions for all data types, like the math functions which has math.something for all data types
g
oh, I got what you mean, like
Scanner
from java. I remember some discussion about this. My opinion that it shouldn’t be in stdlib. It’s pretty easy to write and maybe make sense to have a separate common library for such command line utilities
a
About console clear, c# is available for Mac so I guess it supports
But how can it support native
So I should write a console utility lib in kotlin? And use the java codebase
And should I use the scanner object or write my own class
g
Yes, it’s possible to write common library that compiled to java/js/native
Really, not sure about the best way to implement this (maybe use some platform specific API like Java Scanner, maybe write everything from the scratch)
I just think that multiplatform kotlin library for console api would be more flexible solution than a couple additional functions in stdlib
a
Wow sounds like a big project, where do I start, and do I need to write the algorithms in kotlin?
I first need to figure out how scanner works, in the asm level, pretty hard without the Java src (open JDK?) Then I need to use bitwise options or something (exists in kotlin)
g
You can find sources of scanner in open jdk, also you can navigate to it from Idea
Bitwise option?
Anyway, you always can open an issue on Kotlin tracker with proposal about such functions or about kotlinx library. But if you really need such feature it's good to do yourself and contribute, maybe someone could help you
s
@gildor could you share the proposal for random?
k