I've been playing with both Kotlin and Go recently and while I'm generally happier with Kotlin wrt syntax consistency, refactorability and familiarity (from Java), there's one thing Go has that's a really big advantage to me; Channels and Go routines.
These make async programming so much nicer and obviate all manner of common synchronization issues. If Kotlin supported equivalent functionality in as neat a syntax, it would make it a no brainer as to which laguage I’d want to use.
While supporting Go routines is syntactically easy (they are functions you can fire off asynchronously), the sort of syntax I’m talking about is stuff like:
channel <- input
output <- channel
And the rather neat ‘swtich’ statement that blocks for channels:
// data is the input channel for data
// stop is a channel that receives an input when it’s time to terminate
case value := <- data
// do some processing
case <- stop
You can also use channels with fixed buffer size as semaphones (they block on input as well).
I am sure someone could do all this in a library perfectly well, but it’s the super consise syntax that’s so appealing in Go.
Perhaps a ‘blocking assignment’ operator (Kotlin equivalent of ‘<-’) that would work with any Channel interface/class for example. Obviously when used in some contexts (e.g. switch) it needs to be possible to combine several pending assignments and block only until the next is available.
Then again, perhaps Kotlin has other ways up its sleve to deal with async programming that I’ve not come across yet …