/ tags/ metaprogramming
Scala 3 Mirrors give you a type's shape, but not its custom field names, default values, or annotations, and they refuse value classes outright. M&DE derives an enriched mirror that carries all of…
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…
A walking tour of context parameters, KProperty0, definitely-non-null types, contracts, sealed scopes, explicit backing fields, fun interface, inline+reified and KSP — by building a multiplatform…
How to debug Scala 3 macros: profiling the compiler, print-debug helpers for types and ASTs, and attaching a JVM debugger to the compiler from Mill, sbt, scala-cli, VS Code or IntelliJ.
How to extract method parameter defaults at compile time in Scala 3 using macros, the Selectable trait, and computed field names for full type safety.
How to work around the JVM 64KB method size limit when generating code with Scala 3 macros, using local method chunking to split large generated methods.