Sitemap
Rustaceans

Insights and Expertise from Rustaceans

Member-only story

🦀 A Line Profiler for the Bruto Pascal IDE

9 min readOct 4, 2026

--

Borland shipped Turbo Profiler in 1990 as a separate product, and it was a revelation for anyone who had been guessing at hot spots by commenting out code. You loaded your program, ran it, and got a bar next to every source line showing how much of the run it had eaten. The Bruto IDE already had the editor, the build, the lldb debugger and the watch window of the Turbo Pascal experience. What it did not have was that bar.

This post is about adding it. The design borrows from line-profiler, a project that instruments Rust programs at the LLVM IR level, but Bruto is in a much better position than that tool ever was: it owns the compiler. There is no rustc to intercept and no text-level IR rewriting. The hooks go in at code generation time, the runtime is two hundred lines of C, and the whole thing costs normal builds nothing.

Press enter or click to view image in full size

Where the hooks go

A line profiler needs three events from the running program: a routine was entered, a routine returned, and execution reached a new statement. line-profiler gets them by asking rustc for textual IR, parsing it, and splicing call instructions in front of every instruction that carries a debug location, which is exactly as fragile as it…

--

--

Former Software Engineer at Google, still haven't found what I'm looking for. Retro computing, 6502 assembly, Rust. Full record: whois.enzolombardi.net