Skip to content
0:00 / 0:00

#clojure#clojure.spec#functionalprogramming

"Agility & Robustness: Clojure spec" by Stuart Halloway

Strange Loop Conference

88K subscribers • 110 videos on Hallway • Conference channel

YouTube
  • Recommended by 4 people: 2 on Hacker News, 1 on Lobsters and 1 in engineering communities.
  • A classic. People kept recommending it from 2016 to 2022.
  • Presented by Stuart Halloway

Intermediate. Assumes working knowledge.

24K views10 years ago4 recommendations

Programming languagesSoftware designLisp and ClojureLanguage design and type systems

Stuart Halloway explains how Clojure's spec library enables declarative, predicate-based data validation and testing to build robust yet agile software.

You can program with high agility and end up with a robust, maintainable program. This talk will show you how to use Clojure and the new spec library to write programs that behave as expected, meet operational requirements, and have the flexibility to accommodate change. With Clojure, you can rapidly develop robust and reusable programs using interactive development at the REPL immutable data and pure functions code as data Clojure's new spec library augments these approaches. Developing with spec is declarative, predicative, layered, robust, and integrated with Clojure. spec is declarative. As with type systems in static languages, spec lets you make declarative statements that communicate and document data, function arguments, and returns. spec is predicative. You can declare predicates about data, about function arguments and returns, and even function semantics. This overlaps not only with type systems, but also with validations that are often done with costly bespoke tests and runtime checks. spec is layered. Spec does not require any specific workflow or program shape, and in particular is compatible with iterative and incremental development. spec supports robust programs via automatic generative testing. Given specifications, spec can write generative tests for you, generating a volume of tests limited only by your CPU time, not by what you are able to write and maintain by hand. spec is fully integrated with Clojure. As you develop your program, you have interactive access to spec-driven documentation, validation, destructuring, conformance checking, sample data, testing, and program instrumentation. Stuart Halloway is a founder and President of Cognitect, Inc. He is a Clojure committer, and a developer of the Datomic database. Stuart has spoken at a variety of industry events, including StrangeLoop, Clojure/conj, EuroClojure, ClojureWest, SpeakerConf, QCon, GOTO, OSCON, RailsConf, RubyConf, JavaOne, and NFJS. Stuart has written a number of books and technical articles. Of these, he is most proud of Programming Clojure.

Why it's here

4 people recommend this

What people say. Recommended as a compelling argument for dynamic typing combined with declarative specifications over traditional static type systems.

u/jrheardin r/Clojure • Recommends

"Agility & Robustness: Clojure spec" - Stuart Halloway's Strange Loop talk

InkyHarmonicson Lobsters • Recommends

Agility & Robustness: Clojure spec

susan_hallon Hacker News • Recommends

On “The Unsound Playground: Java and Scala's Type Systems are Unsound”

…early 1990s, but it certainly seems a bit dated in the year 2016. The limits of the Java type system have been discussed both here on HackerNews and also elsewhere, many times. For those who want to consider arguments against Java's style of strict typing, 2 things I would recommend include "Agility & Robustness: Clojure spec, by Stuart Halloway": link to this video He offers a chart that shows the strengths and weaknesses of strict typing versus unit tests versus the run-time checks offered by Spec. It's worth a look. The discussions around gradual typing have been interesting, but to see how far the limits of this can be pushed, I would suggest everyone check out the Qi/Shen programming language: [li…

Jonovonoon Hacker News • Recommends

On “Clojure 1.11 is now available”

..... you realise clojure has one of the most powerful ways to 'type' your language? Like 100x more powerful than the typescript or whatever type language you are using now ;p link to this video

lkrubneron Hacker News • Mentions

On “Making the move from Scala to Go”

Since they cite me (and my essay from 2014) as part of their decision making process, I want to throw in 2 cents here. They ended up deciding on Go, whereas I have ended up preferring Clojure, yet I agree with a lot of what they say, so I'll try to clarify why I ended up with a different decision than what they made. I understand what they mean when they write: I think the first time I appreciated the positive aspects of having a strong type system was with Scala. Personally, coming from a myriad of PHP silent errors and whimsical behavior, it felt quite empowering to have the confidence that, supported by type-checking and a few well-thought-out tests, my code was doing what it was meant to…