Resources & Further Reading
A curated collection of external references that complement the Hearth documentation.
Derivation Theory
- Sanely Automatic Derivation — blog post explaining why macro-internal recursion produces better error messages, handles recursive types out of the box, and simplifies the user-facing API compared to traditional semi-automatic or fully-automatic approaches.
- Kindlings - repository which puts derivation theory into practice by implementing several derivation macros for Scala.
JVM & Runtime
- JVM Scala Book — comprehensive reference covering JVM internals relevant to Scala developers, including class loading, bytecode, and runtime behavior that affects macro-generated code. (Disclaimer: I've written it.)
Official Scala Documentation
- Scala Overviews — the index of official Scala documentation covering compiler options, reflection, collections, and more.
- Library Author Guide — official guidance on publishing Scala libraries, including binary compatibility, versioning, and cross-building considerations.
-
- Additionally I suggest opening code in a browser API directory and keeping the tab open (might be a good idea since in my IDE sources are NOT imported so I see no documentation)
-
- Additionally I suggest opening code in a browser API directory and keeping the tab open (might be a good idea since in my IDE sources are NOT imported so I see no documentation)
Cross-Building Background
- The State of TASTy Reader — an article examining the current capabilities and limitations of Scala 3's TASTy reader when consuming Scala 2.13 artifacts, and what it means for cross-compilation strategies.
EPFL Papers
- C. Hofer et al. Polymorphic Embedding of DSLs, GPCE, 2008 - theoretical background on using traits with abstract types and methods, and mix-ins with implementation to define DSLs and "interpret" them at runtime.
- Scala Macros, a Technical Report (Scala 2 macros)
- Quasiquotes for Scala (Scala 2 macros)
- Scalable Metaprogramming in Scala 3 (Scala 3 macros)
- potentially all the other EPFL papers
Related Projects
For the story of how the Scala macro ecosystem evolved and which projects influenced Hearth's design, see Prior Art & Influences.