Catch Module Boundary Bugs with Racket Contracts
Use provide/contract to wrap Racket exports with runtime predicates and get precise blame errors when modules violate their agreements.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Use provide/contract to wrap Racket exports with runtime predicates and get precise blame errors when modules violate their agreements.
Goal Determine whether statistical CPU samples from racket/profile represent JIT-compiled trace execution comparably to interpreted code, and whether profiling interrupts influence trace selection. Constraints and uncertainty racket/profile samples the current continuation through periodic VM interrupts, while Racket's tracing JIT dynamically compiles hot pa
Racket's #lang lets you build a custom language that compiles to ordinary Racket, giving you domain‑specific syntax without runtime overhead. Learn how to create a minimal DSL, inspect its expansion, and weigh the trade‑offs.
Compare raco make, raco exe, raco distribute, and raco pkg when shipping Racket applications to users who may not have Racket installed.
Add static types to a dynamic Racket project step‑by‑step. Learn how Typed Racket’s gradual typing, the Any type, and unchecked modules let you migrate without rewriting everything at once.
Learn how to use Racket contracts at module boundaries to enforce API shapes, assign blame accurately, and build more reliable libraries using provide/contract.
Racket's #lang dialect declaration and module system enable language-oriented programming. This blog walks through picking a base dialect, writing hygienic macros, and verifying dialect resolution with a concrete DSL example.
Learn how to attach and enforce Racket contracts on functions, test valid and invalid calls, and recover from contract violations using handlers.
Contracts let you enforce function and module interfaces at runtime, catching bugs early in big Racket projects. This post explains how they work, shows a real‑world example, and weighs the performance trade‑offs so you can decide when to keep them enabled.