BorrowScope Logo

Technical White Papers & Documentation

BorrowScope is a personal project I'm building to deepen my understanding of Rust's ownership and borrowing system. The goal is to instrument Rust code and visualize what actually happens at runtime — when values are created, cloned, borrowed, moved, and dropped. It spans multiple crates: a runtime library for event-sourced ownership tracking, a proc macro for automatic instrumentation, a static analyzer that extracts type information using rust-analyzer's semantic APIs, and planned components for graph visualization, memory layout analysis, a CLI, and a web interface. None of this is production-ready — it's a learning and development journal in code form, exploring how far you can push Rust's compile-time and runtime introspection capabilities.

borrowscope-runtime

Runtime ownership tracking library for Rust. Provides event-sourced architecture, zero-cost abstractions, and ownership graph construction.

v0.1.2

borrowscope-macro

Procedural macro crate providing the #[trace_borrow] attribute for automatic instrumentation of Rust code to track ownership and borrowing operations at runtime.

Under Development

borrowscope-analyzer

Static pre-build analysis tool that uses rust-analyzer's semantic APIs to extract full type information for every variable binding, bridging the type information gap that procedural macros cannot cross.

Under Development

borrowscope-graph

Graph data structures and algorithms for ownership visualization. Includes conflict detection, query builders, D3.js export, and timeline-based analysis of borrow relationships.

Future Roadmap

No articles yet

borrowscope-memory

Memory layout analysis and allocation tracking. Bridges logical ownership with physical memory usage—stack vs heap visualization, cache line analysis, and fragmentation detection.

Future Roadmap

No articles yet

borrowscope-cli

Command-line interface for analyzing and visualizing Rust ownership. Includes Cargo integration, Graphviz exports, and an embedded web server for interactive exploration.

Future Roadmap

No articles yet

borrowscope-web

Web application and REST API for interactive ownership graph exploration. Built with Actix-web, featuring Swagger UI, real-time updates, and rich visualization components.

Future Roadmap

No articles yet