Top all-time · #4401
Roman Elizarov
Personal blog · elizarov.medium.comprogramming
Roman Elizarov's personal blog at elizarov.medium.com covers programming. Since 2020, 18 different Hacker News readers have linked it 23 times, most often “How do you color your function?”. The last post was in 2020, but the archive is still widely read.
Too few sampled comments (18) to say how often HN recommends it.?
Why HN links it
HN readers link Roman Elizarov's Medium posts, written by the Kotlin designer, on function colouring, structured concurrency and type placement when discussing async design and language features.
Summarised by Claude from a sample of 18 HN comments that link here. Each comment is marked recommending, critical or neutral (citing without judging); how this works.
Most-linked posts?
- How do you color your function?5 people · 8 mentions · first linked 2021-08-26
- /structured-concurrency-722d765aa9524 people · 4 mentions · first linked 2021-03-19
- Types Are Moving to the Right3 people · 3 mentions · first linked 2022-07-19
- /kotlin-and-exceptions-8062f589d072 people · 3 mentions · first linked 2022-08-10
What Hacker News says?
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-22...
Comment linking /types-are-moving-to-the-right-22c0ef31dd4a
on “Carbon Language: An experimental successor to C++”Submitted Programming Language Evolution as a story · 3 points
HN discussionKotlin'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://e…
Comment linking /immutability-we-can-afford-10c0dcb8351d
on “Goodbye, Rust. I wish you success but I'm back to C++ (sorry, it is a rant)”Submitted Types Are Moving to the Right as a story · 2 points
HN discussionIt'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-sch…
Comment linking /structured-concurrency-722d765aa952
on “JDK 19 Release Notes”Submitted How do you color your function? as a story · 2 points
HN discussionHere the Kotlin lead argued that it is not a "problem". https://elizarov.medium.com/how-do-you-color-your-functions-...
Comment linking /how-do-you-color-your-functions-a6bb423d936d
on “JEP proposed to target JDK 19: 425: Virtual Threads (Preview)”Submitted Types Are Moving to the Right as a story · 1 points
HN discussion> As I said, a bad reason to dislike compiler-enforced error handling. Especially since we're now discussing the small minority of places where you want to call a function that returns errors, but you believe those errors are not possible in your case. This comment thread is in response to an article in which it is (IMHO correctly) argued that "just let it crash/panic" is the correct response in many cases, so it's…
Comment linking /kotlin-and-exceptions-8062f589d07
on “Using unwrap() in Rust is okay”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+Concur... [3] https://elizarov.medium.com/st…
Comment linking /structured-concurrency-722d765aa952
on “Go Statement Considered Harmful (2018)”> 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-722d765aa...
Comment linking /structured-concurrency-722d765aa952
on “Notes on structured concurrency, or: Go statement considered harmful (2018)”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-...
Comment linking /how-do-you-color-your-functions-a6bb423d936d
on “On the proliferation of try, and soon, await (2020)”> 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 bein…
Comment linking /kotlin-and-exceptions-8062f589d07
on “The Reason Java Is Still Popular”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 conditi…
Comment linking /kotlin-and-exceptions-8062f589d07
on “Meta Joins Kotlin Foundation”Kotlin were the first to introduce the idea in my knowledge https://elizarov.medium.com/deep-recursion-with-coroutines-7...
Comment linking /deep-recursion-with-coroutines-7c53e15993e3
on “Stack safety for free?”Color is a feature in Kotlin: https://elizarov.medium.com/how-do-you-color-your-functions-...
Comment linking /how-do-you-color-your-functions-a6bb423d936d
on “JDK 21 Release Notes”https://elizarov.medium.com/how-do-you-color-your-functions-... That’s a feature, not a bug. > We could eliminate suspend modifiers from pure-Kotlin code, but should we? I’m inclining to answer no. Having to mark asynchronous functions with suspend modifier is a small price to pay, but in return you get better insight into your code. You immediately see which functions are allowed to perform potentially long communi…
Comment linking /how-do-you-color-your-functions-a6bb423d936d
on “Java 21: What’s New?”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…
Comment linking /how-do-you-color-your-functions-a6bb423d936d
on “The Rust I wanted had no future”That’s the idea behind suspend keyword in Kotlin: https://elizarov.medium.com/how-do-you-color-your-functions-...
Comment linking /how-do-you-color-your-functions-a6bb423d936d
on “Java 21 Released”> 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…
Comment linking /structured-concurrency-722d765aa952
on “Effection: For When Async/Await Is Not Enough”Function color is a feature: https://elizarov.medium.com/how-do-you-color-your-functions-...
Comment linking /how-do-you-color-your-functions-a6bb423d936d
on “Kotlin Coroutines vs. Threads Performance Benchmark”https://elizarov.medium.com/structured-concurrency-722d765aa... https://elizarov.medium.com/coroutine-context-and-scope-c8b2... https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-corout...
Comment linking /coroutine-context-and-scope-c8b255d59055
on “Structured Concurrency Definition”