<@U092308M7>: &gt;but basically it’s along C#’s a...
# announcements
g
@orangy:
but basically it’s along C#’s async/await state machine, with strong emphasis on libraries to provide actual processing of steps. Compiler only transforms co-routine into something suspendable and gives control to library functions.
This sounds pretty good to me. I'm really interested in seeing seeing kotlin solve one of the problems brought up by Deprecating the Observer Pattern with Scala.React, which is that issue of congruity of listeners. I'm pretty sure that by combining
javafx.Toolkit#enterNestedEventLoop()
with the appropriate listener co-routine front end, kotlin can take this:
Copy code
// scala
val path: Signal[Path] = Signal.flow(new Path) { self =>
  val down = self await mouseDown
  self()= self.previous.moveTo(down.position)
  self.loopUntil(mouseUp) {
    val e = self awaitNext mouseMove
    self()= self.previous.lineTo(e.position)
  }
  self()= self.previous.close()
}
and turn it into this:
Copy code
//kotlin
val path: Signal[Path] = Signal.flow(new Path) { self =>
  val down = self await mouseDown
  self()= self.previous.moveTo(down.position)
  self.loopUntil(mouseUp) //co-routine method that enters nested event loop.
  val e = self awaitNext mouseMove
  self() = self.previous.lineTo(e.position)
  self() = self.previous.close()
}
--the actual code is kind've garbage with all of that assignment-to-self nonsense but the point is valid: we've flattened one (or many) levels of nesting-- and I would be a very happy man if I could stop writing schizophrenic UI handlers simple smile