~/talk

Recursion schemes in OCaml: An experience report

Talkat OCaml 2024 · on Saturday, 2024-09-07· [software-architecture]
links:none on file
slides:none on file

A compiler for a Bloomberg DSL for bilateral financial contracts uses recursion schemes in OCaml to factor traversal code and add optimizations. Claims: recursion schemes in OCaml let programmers integrate hash-consing and memoization with only a few small changes (weak hash set reused, wrapper storing hash and tag), runtime performance is satisfactory, and developers accept the abstractions. Limits: operators are not data type generic and memoization breaks for higher‑order carrier types so custom variants are needed.

AI-written summary · about

  1. 0:00Introduction
  2. 0:23Bloomberg project context
  3. 1:49Motivation for recursion schemes
  4. 3:16Expression types limits
  5. 4:20Open recursive types and expr_node
  6. 5:03Category theory basics
  7. 6:07Catamorphisms and traversals
  8. 7:12Deriving catamorphism operator
  9. 8:14Variable substitution example
  10. 8:55Collecting free variables
  11. 9:37Hash consing optimization
  12. 11:21Hash consing implementation
  13. 12:05Memoization trade-offs
  14. 12:48Benefits of recursion schemes
  15. 13:52Challenges and limitations
  16. 15:21Q&A
~/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.