Fork me on GitHub
#clojure-spec
<
2017-10-02
>
borkdude09:10:00

Is it me or is clojure.future.spec not checking macro specs at compile time?

gfredericks11:10:21

it couldn't without patching some monkeys, right? I have no idea if it attempts to do that or not.

ajs21:10:40

Is it typical to use spec during runtime in production apps, or is more of a debugging tool in development to ensure data is flowing as expected in your app, but turned on off in production?

bfabry21:10:01

turned off in production

bfabry21:10:18

except possibly in very specific spots (system boundaries etc)

bfabry21:10:31

we use it in development, and in our master and staging environments

guy21:10:31

How big a performance inpact is it to have it running?

ajs21:10:39

it would seem to me that spec/conform is designed with runtime use in mind for coercing data into a desired format, is this not accurate?

bfabry21:10:57

@ajs no it absolutely is designed for that, those are the "specific spots" I was talking about

bfabry21:10:37

ie it'd be odd to be validating/conforming data somewhere other than a system boundary, unless you're looking for bugs in your own code

bfabry21:10:54

which is what instrument/test.check are for, but they're expensive so just use in lower envs

ajs21:10:58

is something like goog.debug used for turning it off in production, or is there a spec-specific way to do so

bfabry21:10:09

you still need to validate/conform at system boundaries though, because you can't trust other people's code

bfabry21:10:48

there's a few different levers to tweak. instrument is used to add input validation to every function with an fdef. so just not calling that in production. spec/assert is a more explicit validation check, which can be disabled using compile-asserts or clojure.spec.check-asserts