Biff is a new Clojure web framework designed for simplicity and productivity. It emphasizes a "batteries-included" approach, providing built-in features like routing, HTML templating, database access with HoneySQL, and user authentication. Biff leverages Jetty for its underlying server and Integrant for system configuration and lifecycle management. It aims to streamline web development by offering a cohesive set of tools and sensible defaults, allowing developers to focus on building their application logic rather than configuring disparate libraries. This makes Biff a suitable choice for both beginners and experienced Clojure developers seeking a pragmatic and efficient web framework.
The blog post introduces Biff, a new web framework for the Clojure programming language, emphasizing its "batteries-included" nature and aiming to streamline the process of building full-stack web applications. It argues that while Clojure offers many excellent libraries, integrating them into a cohesive project often requires significant developer effort. Biff addresses this by providing pre-configured solutions for common web development tasks, allowing developers to focus on building their application logic rather than wrestling with infrastructure concerns.
The post highlights several key features of Biff. Firstly, it embraces a "full-stack" approach, incorporating backend components like routing, middleware, and database integration with frontend tooling through a built-in reagent/re-frame setup. This integrated approach aims to simplify project setup and enhance developer experience by minimizing the need for tedious configuration and glue code between disparate libraries.
Biff promotes an asset pipeline managed through shadow-cljs, automating the process of compiling ClojureScript, managing dependencies, and optimizing assets for production. This simplifies frontend development by abstracting away much of the build process complexity.
Database interactions are facilitated by HoneySQL, providing a flexible and composable way to construct SQL queries. The post emphasizes the clarity and readability of HoneySQL, contrasting it with potentially cumbersome string concatenation or reliance on ORMs.
Biff incorporates a built-in migration system using Ragtime, which simplifies database schema evolution and management throughout the project lifecycle. This automated approach reduces manual intervention and the risk of errors during schema changes.
For handling HTTP requests, Biff utilizes a ring-based router, offering familiar conventions and middleware capabilities to developers experienced with the Clojure ecosystem. This leverages the mature and widely-used ring library.
The post emphasizes the importance of security best practices and notes Biff's inclusion of features like built-in CSRF protection and session management, aimed at mitigating common web vulnerabilities and simplifying their implementation for developers.
Finally, the post concludes by encouraging readers to explore Biff and provides links to documentation, tutorials, and the project's source code, inviting community engagement and contribution to the project. It suggests that Biff offers a compelling option for Clojure developers seeking a streamlined and integrated framework for building web applications.
Summary of Comments ( 21 )
https://news.ycombinator.com/item?id=44037426
HN users generally express interest in Biff, praising its simplicity, clear documentation, and "batteries included" approach which streamlines common web development tasks. Several commenters favorably compare it to other Clojure web frameworks like Ring, Pedestal, and Reitit, highlighting Biff's easier learning curve and faster development speed. Some express curiosity about its performance characteristics and real-world usage. A few raise concerns about the potential limitations of a "batteries included" framework and the implications of choosing a smaller, newer project. However, the overall sentiment leans towards cautious optimism and appreciation for a fresh take on Clojure web development.
The Hacker News thread for "Biff – a batteries-included web framework for Clojure" contains a moderate number of comments discussing various aspects of the framework and its place within the Clojure ecosystem.
Several commenters express interest in Biff and praise its apparent simplicity and ease of use. Some appreciate the "batteries-included" approach, highlighting the convenience of having built-in features like authentication and database integration. They see it as a potential solution to the perceived fragmentation and complexity within the Clojure web development landscape. One commenter specifically mentions how it feels refreshing compared to other frameworks that require a significant amount of configuration and boilerplate.
The discussion also touches upon Biff's use of Integrant for dependency injection. Commenters familiar with Integrant express positive opinions about this choice, seeing it as a robust and well-regarded library for managing application state.
However, some skepticism is also present. Some users question the long-term viability of yet another Clojure web framework, given the existing options. They wonder if Biff offers enough differentiation to justify its existence and whether it will gain sufficient community support to thrive. Concerns about the relatively young age of the project and the potential for breaking changes are also raised.
A few commenters delve into specific technical details, such as Biff's routing mechanism and its handling of asynchronous operations. One commenter mentions the similarity to Pedestal's interceptor pattern. Another points out the use of HoneySQL for database interactions.
There's a brief exchange about the choice of the name "Biff," with some users finding it amusing and others expressing mild disapproval.
Finally, some commenters request clarification on certain aspects of Biff's functionality, such as its approach to security and its integration with other Clojure libraries. The author of Biff actively participates in the thread, responding to questions and providing further insights into the framework's design and goals.