Has kotlin versions of Guardedby, Immutable, NotTh...
# coroutines
s
Has kotlin versions of Guardedby, Immutable, NotThreadSafe and ThreadSafe annotations been considered ? With associated compiler / ide support that is ?
e
What kind of compiler / ide support you are looking for? The last time I’ve checked it was an open (unsolved) research problem in computer science on how to integrate these kinds of things into compilers. There are a few research langs that attempt to “solve” it in some way, but with serious limitations
If there was any recent breakthough, we’d be more than happy to apply it
s
Heh. Not aware of any such breakthroughs 😉
But I assume it would not be difficult to issue warnings if private vals marked with GuardedBy are not wrapped in a call to withLock
Maybe I recall incorrectly but I think this exists for Java in IDEA
e
Maybe. Anyway, we are not in Java. With coroutines you have little need for synchronization of mutable state. You can share state by communicating, which is a much safer/saner approach to concurrency