~/talk

Adventures In Meta-programming Macros Vs Shapeless

Talkat Scala Italy 2017 · on Saturday, 2017-05-13· [scala]
slides:none on file

Compares two concrete solutions: a macro that rewrites calls to generate case class instances and a Shapeless-based type-class approach that derives instances via Generic HLists; both implement a Pure type class and handle an iceCream example (String, Int, Boolean). Macros win for small syntactic tasks like extracting a field name into a string, Shapeless wins for structural derivation across fields; shows a working checklist validator, mentions compile-time costs and debugging with cached implicits.

AI-written summary · about

  1. 0:00Introduction to metaprogramming
  2. 1:05Macros vs Shapeless overview
  3. 2:30Example one constructing values
  4. 6:45Macro limitations and solutions
  5. 11:43Shapeless solution for values
  6. 18:26Macros vs Shapeless comparison
  7. 20:11Example two validating data
  8. 21:57Macros for field validation
  9. 26:09Shapeless for field validation
  10. 28:42Key takeaways and recommendations
  11. 30:25Further reading and resources
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.