HeadlinesBriefing favicon HeadlinesBriefing.com

biff.core simplifies Clojure web system composition

Hacker News •
×

Creator of the Biff ecosystem has finished a rough draft of twelve split libraries and is now polishing them for release. The first package, biff.core, provides system composition and interfaces that glue the remaining modules together. By extracting the boilerplate that assembles module maps into a single system map, the library promises a cleaner entry point for new Clojure web projects for Clojure developers worldwide.

Previous Biff versions required each application namespace to expose a “module” map, then manually merge routes and API routes into a :biff/handler entry. Init functions introduced in biff.core accept a collection of modules and return a map that merges directly into the system, eliminating the need to paste boilerplate into the main namespace. The design also preserves Ring handler late‑binding via vars at runtime, allowing code changes without server restarts.

Because init functions operate on a var holding the module vector, any component that must stay current can be expressed as a function rather than a static value. This approach yields a minimal main namespace: developers add modules and components, and the system assembles them automatically. The author notes that keeping a separate components vector simplifies ordering and debugging, reinforcing Biff’s philosophy of functional pipelines.