リスプツアー

Exploring the Beauty and Joy of Lisps: A Journey through Guile, Common Lisp, Fennel, Clojure, and Emacs Lisp

Tags: Lisps, Programming Languages, Guile, Common Lisp, Fennel, Clojure, Emacs Lisp

Introduction

In 2023, I embarked on a journey to explore various Lisp languages, driven by my love for elegant and terse programming languages. This journey was sparked by my exposure to Elixir in 2022, which introduced me to the idea of debugging live systems and “staying in your program”. As a software developer, I wanted to find a language that not only satisfied my needs but also brought joy and matched my values. In this blog post, I will share my experiences with five Lisps: Guile, Common Lisp, Fennel, Clojure, and Emacs Lisp.

Guile: Scheme’s Cleanliness and Consistency

Guile, a GNU language, caught my attention with its cleanliness and consistency. It was installed by default on many systems, which added to its appeal. One feature that I fell in love with was Transducers, which I later ported to other Lisps. However, Guile had its limitations when it came to producing larger projects without using Guix-based dependency management.

Common Lisp: The Classic with Best-in-Class Debuggability

Common Lisp, often considered the classic Lisp, impressed me with its active ecosystem and enthusiastic community. It offered best-in-class debuggability and interactivity, allowing me to debug external library code while the program was running. This feature was invaluable, especially when working on production systems. Additionally, Common Lisp provided hotswapping capabilities similar to Erlang and a static type system for API-hardening and performance tuning. However, the historical warts and lack of a unified Common Lisp implementation posed challenges.

Fennel: Simplicity and Compatibility with Lua

Fennel, a Lisp dialect that compiles to Lua, stood out for its simplicity and clean syntax. It seamlessly integrated with Lua libraries and had native support in TIC-80 for retro game development. While Fennel lacked the debuggability of Common Lisp due to its dependency on Lua’s runtime, its tooling continued to improve, and it offered the option to produce static binaries.

Clojure: A Smart and Practical Lisp for Real-World Development

Clojure, created by Rich Hickey, impressed me with its practicality and thoughtful design. It was clear that Hickey had spent considerable time thinking about what a programming language needed to be to get work done in the real world. Clojure offered clean syntax, excellent ergonomics, and robust tooling. Its integration with the JVM, while a turn-off for some, provided access to a wide range of libraries. Additionally, the Clojure community was strong and self-funded many popular projects. However, Clojure was known for its poor error messages and lacked the Condition System present in Common Lisp.

Emacs Lisp: Always at Hand

Emacs Lisp, the configuration language of Emacs, had the advantage of always being readily available. Its integration with the editor provided excellent discoverability and made it easy to write and execute code samples. Emacs Lisp had an active ecosystem and community projects like Doom Emacs. However, being an older language, it had historical cruft and lacked modern features like first-class async.

Lessons Learned and Reflections

Through my exploration of Lisps, I learned several valuable lessons and gained insights into the beauty and joy of programming with Lisps.

Firstly, I realized that I had been overly obsessed with order and type systems. While type systems are beneficial for maintainability, I discovered the value of dynamic languages and the flexibility they offer. Starting dynamically and gradually adding typing mechanisms once the domain crystalizes proved to be a pragmatic approach.

Secondly, Lisps provided me with a whole new level of debugging capabilities. The tools available in Lisps like Common Lisp allowed me to be inside my program at all times, inspecting and debugging live code. This paradigm was a revelation compared to the traditional write-compile-run cycle in other languages.

Thirdly, I discovered that Lisps are not solely about writing macros. While macros are powerful, the heart of Lisp lies in its interactive REPL-based development. Modern setups enable seamless integration between the editor and the REPL, allowing for a smooth and efficient development experience.

Lastly, my exploration confirmed that Lisps are entirely usable in the modern day. Real, maintainable software

注意

  • この記事はAI(gpt-3.5-turbo)によって自動生成されたものです。
  • この記事はHackerNewsに掲載された下記の記事を元に作成されています。
    A Tour of Lisps
  • 自動生成された記事の内容に問題があると思われる場合にはコメント欄にてご連絡ください。

コメントする