Bare Metal Clojure with clojure.Spec - Michael Reitzenstein

4,814 views · Published 24 November 2016 · 36:07 · Indexed 26 October 2026

Channel: ClojureTV · 2016 · Science & Technology

Watch on YouTube

Clojure provides powerful abstractions and dynamic typing, and its high performance is enabled only through the amazing optimizations provided by the powerful JITs in JVM, V8 et al.

Using Clojure's new spec and gen features, it's possible to generate specialized versions of Clojure code for constrained specifications, eliminating much of the boilerplate and branch heavy code, which can then be translated into efficient C.

This talk follows optimization of the humble (fn fib [n]) in its most naive form, using a series of generally applicable techniques to transform it from a O( 2n ) to a O( log n ) algorithm, generating efficient C that would be difficult to match by hand.

More from this channel