JavaScript Support
JetBrains
- Transpile to JavaScript
- Use node.js, CommonJS and AMD
- Import TypeScript
- Use other libs
Coroutines
Technically, coroutines are light-weight means of cooperative multi-tasking (very similar to fibers). In other words, they are just much better threads: almost free to start and keep around, extremely cheap to suspend (suspension is for coroutines what blocking is for threads), very easy to compose and customize.
We designed coroutines for maximum flexibility: very little is fixed in the language, and very much can be done as a library. The kotlinx.coroutines project features libraries on top of Rx, CompletableFuture, NIO, JavaFx and Swing. Similar libraries can be written for Android and JavaScript. Even many built-in constructs available in other languages can now be expressed as Kotlin libraries. This includes generators/yield from Python, channels/select from Go and async/await from C#
JetBrains
Comments
Post a Comment