Roman Elizarov

elizarov.medium.com · Personal blog · on HN since 2020

Roman Elizarov, a Kotlin designer, writes about coroutines, structured concurrency, exceptions, and programming language evolution.

What HN saysHN commenters cite his structured concurrency post as making concurrent code easier to reason about, and discuss his post on types moving to the right.
18HN people shared it
14linked it in comments
4stories submitted
8story points
1 year agolast shared
2020people per year2026

Most-shared posts

  1. 1
    How do you color your function?
    5 people · 2 points · first shared 2021 · discussion on HN
  2. 2
    Structured concurrency 722d765aa952
    5 people · first shared 2021
  3. 3
    Types Are Moving to the Right
    3 people · 3 points · first shared 2022 · discussion on HN
  4. 4
    Kotlin and exceptions 8062f589d07
    2 people · first shared 2022
  5. 5
    Programming Language Evolution
    1 people · 3 points · first shared 2020 · discussion on HN
  6. 6
    Immutability we can afford 10c0dcb8351d
    1 people · first shared 2024
  7. 7
    Coroutine context and scope c8b255d59055
    1 people · first shared 2023
  8. 8
    Deep recursion with coroutines 7c53e15993e3
    1 people · first shared 2021

What HN people wrote when they linked it

LennyWhiteJr · 2022-09-22
> Checked exceptions are optional. But they're one of the BEST features in Java. No > So much code fails unexpectedly. When you want to build a professional application you need to handle every error. Yes > Checked exceptions help you avoid that nonsense. Wrong > People hate checked exceptions because of laziness. Java guards you against yourself. Wrong Java checked exceptions are almost universally regarded as being a mistake because they don't actually solve the problem they were meant to solve, and they make the code extremely hard to work with. See this post from Roman Elizarov: https://elizarov.medium.com/kotlin-and-exceptions-8062f589d07
dangets · 2022-07-19
A blog post by Roman Elizarov (Kotlin designer) on the observation of types following the variable name [1]. It mostly states that having consistent length prefixes (fn, val/var) makes the code more readable than arbitrarily long type identifiers (in the eye of the beholder). Not scientific, but interesting. [1] https://elizarov.medium.com/types-are-moving-to-the-right-22c0ef31dd4a
ignoramous · 2022-07-02
> I personally love the concept and I hope it takes off I have used structured concurrency with Kotlin and you are right, it is absolutely easier to reason about concurrent code that way. https://elizarov.medium.com/structured-concurrency-722d765aa952
cowboyd · 2021-11-23
> I'm not sure I buy the premise for the library's existence, at least with how the author describes it. Just do a google search for "structured concurrency". These ideas did not come out of a vacuum, but instead from years of research in language communities ranging from C/C++ to Java, Swift, and Python. Effection is just these same ideas projected into the world of JavaScript. You may find the following resources are helpful - https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statemen… - https://elizarov.medium.com/structured-concurrency-722d765aa952 - https://openjdk.java.net/jeps/8277129 - https://www.wwdcnotes.com/notes/wwdc21/10134/
gtani · 2024-11-30
Kotlin's ex-lead posted a nice graph of prog languages, the axes being immutable encouraged vs not and 20th vs 21st century. Unfortunately paywalled but the cluster in lower right, immutable by default/21st century (swift, rust, scala, kotlin, f#), is a really nice group of languages. Come to think of it, the 21st century/mutable by default is a nice group also: groovy, C#, golang, TS, Dart and Bright's D. https://elizarov.medium.com/immutability-we-can-afford-10c0dcb8351d blurred scan: https://www.joyk.com/dig/detail/1595957460688776
ackfoobar · 2022-05-02
Here the Kotlin lead argued that it is not a "problem". https://elizarov.medium.com/how-do-you-color-your-functions-a6bb423d93…
The_rationalist · 2021-12-06
Kotlin were the first to introduce the idea in my knowledge https://elizarov.medium.com/deep-recursion-with-coroutines-7c53e15993e…
bluquark · 2021-08-26
Kotlin is used to write UI code, and potentially-yielding methods are called with ordinary function call syntax. Kotlin does not have the "await" keyword, but it does have an analogue to the "async" keyword, called "suspend". Here is a post from Kotlin's language designer on their philosophy: https://elizarov.medium.com/how-do-you-color-your-functions-a6bb423d93…
kasperni · 2021-03-19
The wikipedia entry for structured concurrency provides a good intro into the subject [1]. Java in process of adding support for it as part of project Loom[2]. Kotlin has already based their coroutine support on it [3]. It is also on the roadmap of Swift [4]. [1] https://en.wikipedia.org/wiki/Structured_concurrency [2] https://wiki.openjdk.java.net/display/loom/Structured+Concurrency [3] https://elizarov.medium.com/structured-concurrency-722d765aa952 [4] https://forums.swift.org/t/swift-concurrency-roadmap/41611
Tainnor · 2025-07-02
Checked errors are not categorically better than runtime exceptions. There are lots of things that should never be checked exceptions: division by zero, illegal array access, OOM, and everything that can't be (at least not locally) recovered from. That's why Kotlin's philosophy is and has for a long time been "use values for expected and recoverable errors, runtime exceptions for unexpected and unrecoverable conditions", see: https://elizarov.medium.com/kotlin-and-exceptions-8062f589d07 > Except for the whole Kotlin standard library. I'm not sure what you mean. Most kotlin stdlib functions that can fail have some sort of "...orNull" variant to be used when you're not sure you're going to get something back, and there's "runCatching" which will wrap any exceptions in a Result type. Result is part of the stdlib, so you don't have to use any library, although some people (me included) prefer Either. If/when they introduce Rich Errors, it's going to be semantically almost equivalent to Either, except you get somewhat improved ergonomics, so it's not really a paradigm shift. > Ultimately, there is no difference because Result<T, Error> and T func() throws Exception. One is not superior to the other. What it comes down to for me is whether a language has support for checked errors or not, and Kotlin does not. I don't understand how those two sentences don't contradict each other. Kotlin has support for Result<T> (stdlib) or Either<E, T> (from libraries like Arrow). Since…
ohgodplsno · 2023-06-05
Not knowing about function coloring is a stupid dream and has terrible implications on the performance of your code, which is infinitely more important than you losing 2 minutes having to figure out that you really want to `runBlocking { callThatBlocksForADamnLongTime() }`. The insight that function coloring gives you is terribly important. Roman Elizarov (of Jetbrains, author of Kotlin and lead on Kotlin Coroutines) agrees too: https://elizarov.medium.com/how-do-you-color-your-functions-a6bb423d93… async functions without coloring means that the only warning you'll ever get that `calculate2Plus2()` actually ends up running a distributed BigQuery and writing the end result to disk, printing it to stdout() and parsing that result to give it back to you is... hopefully, documentation is up to date and you read it? Async function coloring is not a problem. Async function coloring is a solution to "software developers are awful and will do awful things without any warning". If `calculate2Plus2` did not exhibit the write to disk behaviour in v1.0.0, but bumping to v1.0.1 does, I'd really want a warning that it does at least, and ideally a compiler error. The proper solution to function coloring is to have a pleasant API to interop between both worlds so that, at worst it's just a dozen characters more to say "yep, I really want to block here".
didibus · 2022-09-21
It's not about the exception, it's about the exception handling. If 4 tasks are started asynchronously and one of them throws? What do you want to happen to the other 3? In structured concurency you could say, if any of them fails then cancel all others, and retry them all. Or for example, if one task is waiting on another and that first task throws an exception, you might want to say, ok, retry the first and re-schedule the other one to wait on that retried task. These are all things you can handle yourself as well, but structured concurency is just trying to make that less effort and automatic. So if you define a supervision scope, everything inside it no matter how complex the async graph is, it'll all cancel/retry appropriately at that scope. The scope will also guarantee that when we leave the scope, all concurent tasks are done, nothing is left running, either because it's all cancelled or the scope waits for all tasks to complete. Here's some good articles that explains the motivation for it: https://elizarov.medium.com/structured-concurrency-722d765aa952 https://github.com/apple/swift-evolution/blob/main/proposals/0304-stru…

Keyboard shortcuts

/Search
j kNext / previous blog
EnterOpen selected blog
vVisit the blog site
fFollow / unfollow
lSwitch grid / list view
dSwitch dark mode
g hHome
g pTop posts
g tTopics
g fFollowing
g lLiked
g yHistory
g qFAQ
EscBack / close