This repository is a collection of some useful resources on Scala Macros.
Getting started:
Companion material for the Underscore "Essential Scala Macros" course as well as for the author's talk, "Macros for the Rest of Us", presented at ScalaDays 2014.
Material from live coding session "Macrology 201" workshop at flatMap 2014.
Simple examples of scala macros for the two-part blog post at bbartosz.com.
Reflection:
- Overview - Reflection, Scala Documentation
- Environment, Universes, and Mirrors - Reflection, Scala Documentation
- Symbols, Trees, and Types - Reflection - Scala Documentation
- Scala Reflection Library 2.12.12 - scala.reflect.api.Universe
- Scala Reflection Library 2.12.12 - scala.reflect.api.Mirrors
- Scala Reflection Library 2.12.12 - scala.reflect.api.Types
- Scala Reflection Library 2.12.12 - scala.reflect.api.Symbols
- Scala Reflection Library 2.12.12 - scala.reflect.api.Trees
- Scala Reflection Library 2.12.12 - scala.reflect.api.Trees$Tree
Quasiquotes:
- Introduction - Quasiquotes, Scala Documentation
- Hygiene - Quasiquotes, Scala Documentation
- Syntax summary - Quasiquotes, Scala Documentation
- Expression details - Quasiquotes, Scala Documentation
Online AST explorer for Scala and other languages: https://astexplorer.net/. The Scala AST explorer is based on Scala Meta library, used to read, analyze, transform and generate Scala programs.
- “dynamically” creating case classes with macros
- Scala macro annotation - case class with type parameters
- Detect case class in scala macro
- Use Scala macros to generate methods
- Infer a type of a tree in a scala macro
- Scala macros: Derive type signature from a ValDef
- Proper way to pattern match the value of a TypeTree from a ValDef in Scala Macros?
- how to get method body tree in scala macros
- How to pattern match types in Scala macros?
- Exploring expression tree within scala macro
- String interpolation and macro: how to get the StringContext and expression locations
- Collecting all identifers in scope
- Is there an alternative to the deprecated enclosingClass method in Scala refelection library?
- constructing or modifying scala.reflect.api.Position
- How to run official reflection example
- Macros for Mortals - NE Scala 2016
- Magic at compile time. Metaprogramming in Scala by Bartosz Bąbol @ Functional Conf 2016
- Scala Macros: What Are They, How Do They Work, and Who Uses Them?
- Adventures in Metaprogramming: Macros versus Shapeless by Dave Gurnell
- Introduction to code generation with scalameta by Michael Pollmeier