Why I still reach for Lisp and Scheme instead of Haskell
A seasoned developer makes a compelling case for choosing Lisp and Scheme over Haskell, despite admiring Haskell's functional elegance and innovative type system. The author highlights Haskell's friction points for rapid prototyping and pragmatic development, contrasting them with Scheme's flexible, hacker-friendly approach and powerful meta-programming capabilities. This piece provides a detailed technical comparison, focusing on developer experience and productivity, a perennial and engaging topic for the HN audience.
The Lowdown
The author presents a personal journey through various programming languages, ultimately advocating for Lisp and Scheme as pragmatic choices over Haskell for everyday development. While deeply appreciating Haskell's theoretical beauty and contributions to functional programming, the author finds it often clashes with the need for quick prototyping and practical problem-solving.
- Haskell's Brilliance and Burden: Haskell is lauded for its advanced type system and for popularizing concepts like algebraic data types, monads, and functors. However, its strict purity and the "abstraction tax" of monads make simple impure tasks, like file I/O or debugging with print statements, cumbersome and add significant cognitive load for quick hacking.
- Scheme's Pragmatic Flexibility: Scheme (and Lisp) prioritizes minimalist flexibility, allowing for simpler expression of complex systems. Its practicality shines in prototyping, where direct interaction and side effects are easily managed without the rigid constraints of Haskell's type system.
- Meta-programming Mastery: The article contrasts Lisp's effortless macro system for language extension and domain-specific language (DSL) creation with Haskell's reliance on often disparate and complex DSLs and extensions like Template Haskell. Lisp's approach offers consistent flexibility, while Haskell's DSLs can introduce significant learning curves.
- REPL-Driven Development: A key advantage of Lisp is its powerful, integrated REPL (Read-Eval-Print Loop). This enables an interactive workflow, offering incremental development, potent live debugging, and fast prototyping by eliminating the traditional edit-compile-run cycle and seamlessly integrating with editors like Emacs.
The author concludes that while Haskell embodies a "platonic ideal" of a programming language, Lisp and Scheme provide a better "sweet spot" for practical, joyful, and productive development. The choice ultimately depends on the job, but for hands-on hacking, the author consistently reaches for the flexible power of Lisp.