In the presentation Developer Ergonomics with VS Code, Clojure, and ClojureScript, Peter Strömberg shares his enthusiasm for the Clojure programming language and its practicality, interactive capabilities, and functional, immutable nature. He discusses the data-oriented approach of Clojure and its unique properties, such as its homoiconic nature and structural editing features. Peter also introduces Calva, an editor extension for Clojure and ClojureScript development in Visual Studio Code, which supports interactive programming and structural editing. The presentation covers various evaluation commands in Calva and working with Clojure’s lazy sequences and debugger. Additionally, Peter demonstrates the benefits of hot reloading and state management in a ClojureScript application using VS Code and the shadow-cljs library. Throughout the presentation, Strömberg emphasizes the ergonomics of using Clojure and its tools for efficient development.
Developer Ergonomics with VS Code, Clojure, and ClojureScript: A comprehensive overview
Clojure’s data-oriented nature
A significant portion of Peter’s talk revolves around how Clojure allows developers to work with data in an elegant, bottom-up manner. Unlike other languages where null values pose constant risks, Clojure introduces nil safety, enabling more predictable and stable code. Peter shared his experiences from past jobs where teams would start from basic data structures, continually transforming and building on them — a practice that suits Clojure’s data-first approach well.
Clojure’s library ecosystem also received praise. Many libraries in Clojure reach a “done state” and remain stable, as developers in the community aim to avoid unnecessary churn. This stability provides a solid foundation, enabling devs to focus on building rather than constantly updating or troubleshooting libraries.
Homoiconicity and meta-programming
Peter also delved into Clojure’s homoiconic property, where the code itself is data. This feature allows for powerful meta-programming, with macros providing a way to extend the language in ways that often feel like native syntax. According to Peter, this capability opens up new doors for customization and flexibility that aren’t always possible in other programming languages.
Clojure’s structural nature, akin to XML, facilitates structural editing. The Calva extension, developed by Peter and his colleague Brandon Rince, embraces this to the fullest, ensuring that developers can modify their applications in real-time. This allows for smoother transitions during the development process without the risk of breaking underlying structures—a testament to Clojure’s robust design.
Calva: Enhancing development with ClojureScript and VS Code
Perhaps the highlight of the presentation was Peter’s introduction to Calva, the Visual Studio Code extension that provides an interactive development environment for Clojure and ClojureScript. Peter has been instrumental in its development, working to make it an indispensable tool for the Clojure community.
Calva supports interactive programming and structural editing, making it easier for developers to iterate on their code. Peter demonstrated various key features of Calva, such as evaluating expressions directly in the editor and receiving immediate feedback. This kind of rapid development process has a significant impact on productivity, particularly in complex applications where developers need to experiment and iterate quickly.
Interactive programming and debugging
Throughout the talk, Peter gave examples of interactive programming using Calva. He showed how to evaluate expressions on the fly, create functions with documentation strings, and use comments and print statements for side effects—all without leaving the VS Code environment.
Debugging with Clojure’s lazy sequences was another standout. Peter explained how sequences can be manipulated using various functions and macros. This flexibility, combined with Clojure’s structural editing features, means that even complex sequences can be handled with relative ease.
Hot reloading and state management
Hot reloading is a crucial feature for developers building interactive applications, and Peter demonstrated this with a ClojureScript app connected to the editor through the shadow-cljs library. He illustrated how developers can modify app states directly from the editor, seeing changes instantly without needing to refresh the entire application. This improves both ergonomics and efficiency, as developers don’t need to manually input data to reflect changes.
Using the reframe framework, Peter also explained how state management becomes more intuitive in ClojureScript apps, as developers can work with subscriptions and events to keep their applications responsive and up-to-date.
Live coding, challenges, and community support
Not everything went smoothly during Peter’s live demo. He encountered a few issues, including a crash while trying to implement a Fibonacci number generator. However, these challenges provided valuable teaching moments. Peter reassured the audience that live coding often involves hiccups, and troubleshooting is just part of the process.
What stood out during this section was the role of community support. The audience, including Peter’s peers, jumped in to help solve issues in real-time, showcasing the collaborative nature of the Clojure community. This sense of togetherness is one of the key strengths of open-source ecosystems like Clojure, where both individuals and businesses support ongoing development.
Final thoughts
Peter Strömberg’s talk on developer ergonomics with VS Code, Clojure, and ClojureScript offers a window into the powerful capabilities of these tools. With Clojure’s data-centric approach, rich ecosystem, and community-driven development, it’s no surprise that Peter is such a strong advocate for the language.
Calva, the VS Code extension, is at the heart of this movement, offering an integrated and interactive development environment that significantly boosts productivity. Although live coding can sometimes be unpredictable, Peter’s willingness to share both successes and challenges demonstrates the real-world applications of these tools, encouraging other developers to dive into the world of Clojure.
Whether you’re new to Clojure or a seasoned pro, Peter’s insights offer valuable perspectives on how to make the most of your developer tools, transforming programming into an intuitive, interactive experience.
Additional resources
- Peter Strömberg: LinkedIn, X, Calva
- Clojure in a nutshell by James Trunk
- Java to Clojure