|
Direct-Style Deep Recursive Functions in Scala 3
Kotlin's DeepRecursiveFunction turns deep recursion into a heap-allocated trampoline while keeping direct-style code, built on suspend functions. This post explains why that works, then builds a Scala 3 macro that gets the same trick with no coroutines, no Project Loom, by rewriting a recursive method into a TailRec state machine at compile time. Bartłomiej Kozak |
|
Pre-SIP: A New Type for Optionals and Error Handling
When it comes to optionals and error handling, do you prefer safety or convenience? You should not have to choose. After all, that’s Scala’s motto – combining safety and convenience in one package. And yet, in this particular area there are real tradeoffs between the two, and they will only get worse. Martin Odersky (@Odersky) |