$ show JuliaDebug/Infiltrator.jl
Infiltrator.jl is a Julia package that provides an interactive debugging macro, @infiltrate, which acts as a breakpoint with negligible runtime overhead. When triggered, it opens a custom REPL (infil>) allowing developers to inspect local variables, stack frames, module bindings, and evaluate arbitrary expressions. It supports conditional breakpoints, toggling infiltration points on/off, exfiltration of variable values to a store, and integration with Revise.jl for live code updates. The package is designed for development-time debugging and enforces that @infiltrate fails at compile time in package code to prevent accidental commits. It relies heavily on Julia internals (REPL, Core.Compiler, Base.@locals) and maintains compatibility across Julia versions 1.6 through 1.13 via version-adaptive code paths and extensive golden-file test outputs. This is a pure developer tool with no data analysis or research orientation.
The LLM identified 2 files worth highlighting for reuse:
The main module implements a custom REPL command loop that parses user input (e.g., @trace, @locals, @exfiltrate) by matching first characters and dispatching to handler functions. This pattern of building a simple text-based command interface for an interactive debugger is self-contained and could be extracted to create similar REPL-based tools for other contexts. The dispatch logic is clean and isolated from the rest of the package, relying only on basic string operations and standard Julia functions.
The `show_locals` function uses `Base.@locals` to retrieve all local variables, filters out internal names (like `#self#`), and formats each with `one_line_show` which truncates values to fit terminal width. This utility is a reusable component for any debugging or introspection tool that needs to display local state in a concise, terminal-friendly manner. It does not depend on other Infiltrator internals and could be extracted as a standalone helper.