Has kotlin versions of Guardedby, Immutable, NotThreadSafe and ThreadSafe annotations been considered ? With associated compiler / ide support that is ?
e
elizarov
09/28/2018, 9:39 AM
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
elizarov
09/28/2018, 9:40 AM
If there was any recent breakthough, we’d be more than happy to apply it
s
spand
09/28/2018, 9:47 AM
Heh. Not aware of any such breakthroughs 😉
spand
09/28/2018, 9:48 AM
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
spand
09/28/2018, 9:49 AM
Maybe I recall incorrectly but I think this exists for Java in IDEA
e
elizarov
09/28/2018, 9:51 AM
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