Why Frameworks Are Evil: A Case for Libraries

2025-04-17
Why Frameworks Are Evil: A Case for Libraries

This article delves into functional library design principles, focusing on composability and avoiding callbacks. The author argues that frameworks are difficult to compose, explore, and test, and restrict code structure. In contrast, libraries offer greater developer control, encourage interactive exploration, and support multiple layers of abstraction. Using a game engine example, the article demonstrates how asynchronous workflows and event-based programming can mitigate the drawbacks of callbacks. Examples like FsLab illustrate the composability of libraries. Ultimately, the author advocates for building composable, easily explorable libraries instead of rigid frameworks.