@ben has joined the channel
@ben set the channel purpose: racket/contract
hi @robby “quick question”, I’m thinking about changing mk-any/c->boolean-contract
so it special-cases predicates like real?
instead of just struct predicates
@robby has joined the channel
and I tried adding a hashtable with “all the predicates” from racket/base
(118 predicates)
but that made raco setup
& the contract tests a bit slower (20s and 7s, but I only took one run)
question is: do you know what would be good programs to run to see what racket/base
predicates get used the most in contracts (and would be worth special-casing)?
(or generally, what test would convince you — that I should collect data for)
also
I was testing “is this a trusted predicate?” with an expr like (hash-contains-key? H real?)
, where H
is a hasheq
not sure if there’s a better way. (eom)
Why not do this syntactically
?
oh, wait. nevermind.
I’m very surprised that raco setup
got 20s slower. I would have expected no measurable change.
I think a good approach to decide which contracts to special case would be to just log all of the ones that appear when say, building the docs, starting up drracket, and whatever other of your favorite app startups. Maybe run a pkg-build with that logging turned on and collect the set.
something like that.
does that help?
yeah that’s good, I’ll find some apps
(drracket, package server)
also, I did a little experiment with bytecode size vs. optimizations mentioned in the “Inside Racket” talk. Just for fun: \| Racket version \| du -ch ${dir}/**/*.zo \|
\|--------------------+-----------------------\|
\| 6.8 \| 228 \|
\| build-simple-arrow \| 229 \|
\| 1 popular key \| 244 \|
\| 2 pop. keys \| 244 \|
\| 3 pop. keys \| 236 \|
\| 4 pop. keys \| 236 \|
\| 5 pop. keys \| 236 \|
\| 6 pop. keys \| 231 \|
\| 7 pop. keys \| 230 \|
\| 8 pop. keys \| 229 \|
\| 9 pop. keys \| 229 \|
\| 10 pop. keys \| 229 \|
\| 11 pop. keys \| 228 \|
\| 12 pop. keys \| 228 \|
(build-simple-arrow = bytecode size when build-simple-arrow is a define-syntax) (pop. keys = number of “popular keys”) sizes are in MB for the main distribution, unzipped the 6.8 release and ran raco setup