clojure-spec

Simon 2022-02-17T16:29:56.898109Z

Hello Very Senior Clojure Spec question here: I’m new to Clojure-spec, but have been using Clojure for about a year now. During my thesis I implemented the compiler for Secure Guarded Commands by Flemming Nielson (my supervisor). https://link.springer.com/chapter/10.1007/978-3-030-41103-9_7 The language syntax allows the compiler to analyse the explicit, implicit, bypassing, correlation, sanitised, and indirect information flows. Such that to make sure at compile time that no information is leaked. Would it be valuable to add similar information flow analysis to Clojure Spec?

Alex Miller (Clojure team) 2022-02-17T16:32:25.816819Z

what problem would this solve?

Alex Miller (Clojure team) 2022-02-17T16:35:41.979879Z

I guess I'm wondering if you're looking to extend spec or use the information in specs to do this analysis independently?

Simon 2022-02-17T17:14:17.833759Z

At a minimum something like this:

Simon 2022-02-17T17:22:08.230259Z

I think i have some people doing something similar. https://dl.acm.org/doi/pdf/10.1145/3468264.3473127

Alex Miller (Clojure team) 2022-02-17T17:28:16.888609Z

that image makes me think you are wanting something even more fundamental, like a change to the language

Simon 2022-02-17T17:29:22.888469Z

not neccessarily, I think we could also use a syntax that is closer to that of spec.

Simon 2022-02-17T17:30:37.899599Z

it’s sort of an extension of a type checker.

Simon 2022-02-17T17:31:04.491919Z

and if clojure.spec checks types, then I think it would be possible to do?

Alex Miller (Clojure team) 2022-02-17T17:32:17.395449Z

well, spec is emphatically not a type checker :)

Alex Miller (Clojure team) 2022-02-17T17:32:34.419919Z

it's a predicate value system applied at runtime

Alex Miller (Clojure team) 2022-02-17T17:34:29.482069Z

some people have explored using it for static checks (https://github.com/arohner/spectrum and some work with https://github.com/clojure/core.typed)

Alex Miller (Clojure team) 2022-02-17T17:35:08.550729Z

but that's certainly not the conception or use of it in core