~/talk

Inlining anonymous functions with macros

Talkat Pacific Northwest Scala 2013 · on Sunday, 2013-10-27· [javascript]
links:none on file
slides:none on file

Claim: compile‑time macros rewrite anonymous function literals into direct code so the JVM can optimize tight loops. Tooling: Scala macros with quasiquotes (Macro Paradise), a Transformer that substitutes parameters and removes tuples. Measured effect: typical cases show about 2x slowdown without inlining, a constructed case hits ~5x. Built artifact: a macro that generates inlined methods and anonymous instances, mostly working but not yet production (careful owners/side‑effects and generated bytecode size).

AI-written summary · about

  1. 0:00Intro
  2. 0:29Inlining anonymous functions with macros
  3. 1:31Purpose of this talk
  4. 3:50What are macros?
  5. 4:29What are anonymous functions?
  6. 5:05What was different?
  7. 5:43Doesn't the JVM already do this?
  8. 7:44So what's the "inlining problem" problem?
  9. 9:46Oxur programs are 10x slower!!??
  10. 11:13Is it worth it?
  11. 11:44Using macros to inline functions
  12. 12:59Why do we need literal functions?
  13. 13:42What does a macro look like?
  14. 14:44What does an Expr (AST) look like?
  15. 17:11So what does an inlining transformation look like?
  16. 19:36How do you build a tree?
  17. 20:36How do the AST transformations work?
  18. 26:07What's an example of generating anonymous classes?
  19. 31:57What are the advantages?
  20. 33:30What are some problems?
  21. 37:07The End. Questions?
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 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
?
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.