~/talk

Require Hooks: Filling the Gap in Ruby's Extensibility

Talkat RubyKaigi 2026 · 2026-04-22..04-24· [ruby]
slides:none on file

Provides a concrete API called require_hooks that adds three hook types (around_load, source_transform, a full hijack_load) and runs on MRI and JRuby by choosing one of three injection strategies (kernel patch, undocumented load_is callback, or bootstrap-style hook). Runtime use in RubyNext, Friez, and Tapioca proves it works, but kernel-patch slows large boots (noticeable at ~12,000 files; JRuby shows regressions around 200 files). Also ships require_profiler to export SpeedScope flamegraphs and proposes core APIs for a proper loader namespace and loaded_features object.

AI-written summary · about

  1. 0:00Introduction and motivation
  2. 3:00Ruby's flexibility and limitations
  3. 6:35Use cases for require hooks
  4. 10:30Code loading in other languages
  5. 14:05Introducing require hooks gem
  6. 15:29Implementation challenges
  7. 19:50Performance impact of hooks
  8. 23:46Proposed Ruby core improvements
  9. 26:15Future of Ruby's extensibility
  10. 27:38Require profiler demo
~/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.