Macro's are compile time, there is no runtime codegen.
The problem was overly-frequent inlining generating enormous expressions, causing a lot JIT phase and slow execution.
The problem was overly-frequent inlining generating enormous expressions, causing a lot JIT phase and slow execution.
Doing so is a feature of high-end VM runtimes like the state of the art JVMs or JS runtimes.
Look up the architecture of Catalyst + Tungsten
Scala 3's macros support staged compilation, so you can have macros which create code in later stages at runtime.
https://docs.scala-lang.org/scala3/reference/metaprogramming...