Symbolic Execution
Published on August 16, 2023 by Ambrose Bonnaire-Sergeant
Hi,
I'm excited to announce Typed Clojure 1.1.1 which includes support for symbolic execution via a new type called a "symbolic closure".
I have written a guide on how to think about this new type and what it enables. In short, it can dramatically decrease the number of local annotations needed on anonymous functions.
For example, instead of:
(map (fn [x :- Int, y :- Int] (+ x y)) [1] [2])
You can now write:
(map #(+ %1 %2) [1] [2])
It's also useful for transducers, though we're lacking much support for `comp` at the moment. For now instead of:
(into [] (map (fn [x :- Int] (inc x)) [1 2])
You can simply write:
(into [] (map #(inc %)) [1 2])
Functions can now whiz around and be checked *after* they have been defined:
(let [f #(inc %)] (f 1))
Thanks,
Ambrose