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

vaskir

06/13/2017, 6:36 PM
extension functions in Kotlin are the nicest I've seen
r

radityagumay

06/13/2017, 6:46 PM
vaskir: yes, they is
v

vaskir

06/13/2017, 6:47 PM
very lightweight syntax plus they can be defined locally. super nice.
and implicit
this
🙂
r

radityagumay

06/13/2017, 6:50 PM
even further you can wrap Realm.transaction for extension function
i did something like this
inline fun Realm.transaction(body: Realm.() -> Unit) { beginTransaction() use { body() commitTransaction() } }
v

vaskir

06/13/2017, 6:53 PM
yeah, inline functions are a bit like template functions in, say, D.
r

radityagumay

06/13/2017, 6:53 PM
fun insert(obj: MessageObject){ val realm = Realm.getInstance() realm.transaction { insertOrUpdate(obj) } }
👍
v

vaskir

06/13/2017, 6:54 PM
but the killer thing for me is coroutines. mind blown stuff. the best approach I've see.
r

radityagumay

06/13/2017, 6:58 PM
Couroutine just like c# did
v

vaskir

06/13/2017, 6:58 PM
nooo.
r

radityagumay

06/13/2017, 6:59 PM
I have experience in that field. C# have await async
And kotlin trying to mimic that, but in different flavors
v

vaskir

06/13/2017, 7:00 PM
in C# async/await is a lang feature, working only for asyncs. coroutines - general purpose feature, like computation expressions in F#, but integrated more seamlessly with the the rest of lang.
r

radityagumay

06/13/2017, 7:01 PM
Yes, absolutely true
v

vaskir

06/13/2017, 7:01 PM
and the whole story with synchronous channels are just awesome.
r

radityagumay

06/13/2017, 7:01 PM
Yes
Python, Golang also couroutine
v

vaskir

06/13/2017, 7:02 PM
I even wrote a small blog post on it today 🙂 https://vasily-kirichenko.github.io/fsharpblog/actors
👏 1
r

radityagumay

06/13/2017, 7:02 PM
But, kotlin couroutine much concise
Thanks for sharing
v

vaskir

06/13/2017, 7:03 PM
🙂
I've just impressed. We have such stuff in F#, but it's cryptic. Really cryptic and hard to write. Kotlin looks 10x lighter and as powerful.
r

radityagumay

06/13/2017, 7:05 PM
Yes, kotlin is the most mature language I ever seen after C#
Anyway, kindly follow me on medium
3 Views