Fork me on GitHub
#clojure-spec
<
2016-10-04
>
jrheard00:10:48

heh, enabling (s/instrument) on all instrumentable vars does not do wonders for my game’s performance

jrheard00:10:58

invaluable for finding the 7 random spots where i’d goofed when converting to namespaced keywords, though 🙂

jrheard00:10:42

i’m not complaining, i absolutely expected this degree of perf degradation when instrumenting like every function in this tight loop, it was just funny to go from 60fps to 0.5 😄

jrheard00:10:59

instrumenting only at the edges brings me back up to good perf, nice

ag00:10:25

so it turned out that my regex is bad

ag00:10:38

it does not take into account timezones

ag00:10:54

that minus sign sometimes is a plus sign

ag00:10:42

although I think it would be helpful if spec told me why exactly it couldn’t satisfy the predicate

jrheard00:10:15

i worked with a guy once whose most famous quote around the office was: <jlatt> dates suck <jlatt> f&@# time

jrheard00:10:51

i’ve had similar feelings when running into the “Couldn’t satisfy such-that predicate after 100 tries” error - i wish there was some way it could tell me how i’ve messed up

ag00:10:54

also I think test.chuck generator does not generate values with random timezones. maybe it should

jrheard00:10:54

i’m not sure how it could do that though

minimal13:10:01

@danielstockton :args (s/cat :arg1 (s/and ::query (s/+ (s/or :db map? :coll vector?)))

danielstockton13:10:54

Argh, I think I want s/cat instead of s/and actually

danielstockton13:10:03

now i see that s/and is adding two specs

danielstockton13:10:48

yep, thanks @minimal, somehow i was blind to that

seancorfield22:10:26

We officially have clojure.spec-based code in production now — Clojure 1.9.0 Alpha 13 and all of our REST API search code relies on spec for validation and conformation!

jcsims23:10:19

@seancorfield any plan to write about it?

seancorfield23:10:08

@jcsims I submitted a proposal to Clojure/conj about it… so if that gets accepted, I’ll have to write about it. If it doesn’t get accepted, I’ll probably still write it up for my blog, but in a very different format I expect.

seancorfield23:10:06

Part of my concern is that core to a lot of what we’re doing with spec is something that @alexmiller said is essentially an anti-pattern (heavy use of s/conformer).

seancorfield23:10:54

That, and we are still at times struggling mightily with how to apply spec to some situations...

jcsims23:10:55

well, looking forward to it either way 👍