samth changed the topic of #racket to: Racket v7.3 has been released: https://blog.racket-lang.org/2019/05/racket-v7-3.html -- Racket -- https://racket-lang.org -- https://pkgs.racket-lang.org -- Paste at http://pasterack.org
endobson_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lockywolf__ has quit [Ping timeout: 244 seconds]
johnjay has quit [Ping timeout: 245 seconds]
johnjay has joined #racket
clacke_movim has left #racket [#racket]
clacke_movim has joined #racket
SenasOzys has joined #racket
keep_learning_M has joined #racket
lockywolf has joined #racket
lockywolf_ has joined #racket
lockywolf has quit [Ping timeout: 245 seconds]
lockywolf has joined #racket
johnjay has quit [Ping timeout: 248 seconds]
lockywolf_ has quit [Ping timeout: 245 seconds]
lockywolf has quit [Ping timeout: 268 seconds]
FreeFull has quit []
SenasOzys has quit [Ping timeout: 258 seconds]
dddddd has quit [Remote host closed the connection]
orivej has quit [Ping timeout: 248 seconds]
SenasOzys has joined #racket
SenasOzys has quit [Ping timeout: 272 seconds]
endobson has joined #racket
jao has quit [Ping timeout: 272 seconds]
keep_learning_M has quit [Quit: This computer has gone to sleep]
endobson has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ziyourenxiang has quit [Quit: Leaving]
ziyourenxiang has joined #racket
iyzsong has joined #racket
orivej has joined #racket
lockywolf has joined #racket
zipper has joined #racket
iyzsong has quit [Read error: Connection reset by peer]
orivej has quit [Ping timeout: 246 seconds]
vraid has joined #racket
zipper has quit [Ping timeout: 248 seconds]
zipper has joined #racket
lockywolf_ has joined #racket
lockywolf has quit [Ping timeout: 248 seconds]
lockywolf_ has quit [Ping timeout: 244 seconds]
lockywolf has joined #racket
orivej has joined #racket
ubLIX has joined #racket
manualcrank has quit [Quit: WeeChat 1.9.1]
clacke_movim has left #racket [#racket]
notzmv has quit [Ping timeout: 258 seconds]
dimitarvp has joined #racket
keep_learning_M has joined #racket
dimitarvp has quit [Client Quit]
lockywolf has quit [Ping timeout: 245 seconds]
dustyweb has quit [Remote host closed the connection]
ubLIX has quit [Quit: ubLIX]
lockywolf has joined #racket
iyzsong has joined #racket
lockywolf has quit [Remote host closed the connection]
keep_learning_M has quit [Quit: This computer has gone to sleep]
lockywolf has joined #racket
clacke_movim has joined #racket
lockywolf_ has joined #racket
lockywolf has quit [Ping timeout: 248 seconds]
m1dnight1 has joined #racket
m1dnight_ has quit [Ping timeout: 245 seconds]
m1dnight1 is now known as m1dnight_
pie_ has quit [Ping timeout: 246 seconds]
lockywolf_ has quit [Ping timeout: 245 seconds]
dddddd has joined #racket
keep_learning_M has joined #racket
badkins has quit [Remote host closed the connection]
keep_learning_M has quit [Client Quit]
jao has joined #racket
egp_ has joined #racket
keep_learning_M has joined #racket
badkins has joined #racket
manualcrank has joined #racket
lockywolf has joined #racket
ubLIX has joined #racket
ym555 has joined #racket
orivej has quit [Ping timeout: 272 seconds]
iyzsong has quit [Ping timeout: 250 seconds]
ym555 has quit [Read error: Connection reset by peer]
endobson has joined #racket
notzmv has joined #racket
dmh has joined #racket
ziyourenxiang has quit [Ping timeout: 258 seconds]
Arcaelyx has joined #racket
badkins has quit [Ping timeout: 246 seconds]
pera has joined #racket
vraid has quit [Quit: Leaving]
badkins has joined #racket
YuGiOhJCJ has joined #racket
orivej has joined #racket
johnjay has joined #racket
johnjay has quit [Client Quit]
efm has quit [Remote host closed the connection]
efm has joined #racket
dustyweb has joined #racket
dustyweb has quit [Ping timeout: 245 seconds]
<zipper> Hello, anyone know why struct accessors can't accessed outside the module where the struct is defined?
<endobson> zipper: They can be, they just need to be provided
<zipper> endobson: Thanks
<zipper> endobson: I hope you got my mail btw :)
<endobson> yep
<endobson> both in fact
pie_ has joined #racket
keep_learning_M has quit [Quit: This computer has gone to sleep]
badkins has quit [Ping timeout: 276 seconds]
selimcan has joined #racket
<zipper> endobson: LOL I couldn't see the first one in my sent folder
badkins has joined #racket
dmh has quit [Quit: Connection closed for inactivity]
zipper has quit [Ping timeout: 245 seconds]
ubLIX has quit [Quit: ubLIX]
teardown has joined #racket
selimcan has quit [Quit: Leaving]
notzmv has quit [Ping timeout: 248 seconds]
vraid has joined #racket
orivej has quit [Ping timeout: 248 seconds]
FreeFull has joined #racket
<lavaflow> what's the fastest way to compare and swap two variables? (unsafely is acceptable)
<endobson> lavaflow: what do you mean compare? 'eq?'
<lavaflow> greater than, on two numbers
<endobson> and what do you mean swap? does it need to be set! or can just switching the name in a subexpression work.
<lavaflow> so given two variables A and B, I want A to contain the larger and B the smaller
<lavaflow> hmm
efm has quit [Read error: Connection reset by peer]
mason has joined #racket
<lavaflow> switching the name in a subexpression could work actually
<endobson> ok (let-values (([large small] (if (< x y) (values y x) (values x y)))) ...)
<lavaflow> I could also just branch on it, but I was thinking a little compare-and-swap macro would make the code look nicer
<lavaflow> would the straight forward method like that be performant in practice? for context this is going to be in a pretty hot loop.
<lavaflow> I'll give it a try, premature optimization and all that..
<endobson> I would think so, especially because this is very clear for the optimizer
<lavaflow> ah okay, I'm unfamilar with the extent of the racket optimizer
<endobson> don't use set! if you want stuff to be fast
<lavaflow> hmm
<lavaflow> what about mcons?
<lavaflow> I'm using mcons pretty hard right now
<endobson> https://docs.racket-lang.org/guide/performance.html?q=performance#%28part._.Mutation_and_.Performance%29
efm has joined #racket
<endobson> lavaflow: what is your algorithm, a sort like thing?
<lavaflow> it's a bit complicated to explain.. it's a cache of a forest of naive bayes classifiers, that I need to update on the fly
<endobson> approximately how big is the forest?
<lavaflow> particularly, given a set of sets, it caches the cardinality of intersections of those sets
<lavaflow> I'm shooting for 10,000
<endobson> I think the biggest thing I would worry about is allocation
<lavaflow> well, that's how many classifiers there are. the cardinality of intersections would be 10,000^2 if it were computed fully (it's not)
<endobson> avoid allocating too much, and also avoid unnecessary mutation
<endobson> how are you using the mcons?
efm has quit [Ping timeout: 244 seconds]
<lavaflow> well, that's subject to imminent change, but currently for each pair of tags A,B, I store an mcons that represents P(A|B)
<lavaflow> when that gets modified, it's usually incrementing or decrementing the car of that mcons
<lavaflow> actually the cdr gets modified a lot too now that I think about it
<endobson> so it really is a two element struct
<endobson> you aren't using it as a mutable list like thing
<lavaflow> Currently no, though it started off doing something more like that.
<lavaflow> I'm replacing that system with simply storing the cardinality of A∩B
<lavaflow> I was thinking I'd just store a straight number for that, and do a hash-set! to update it when necessary
<endobson> That doesn't sound too bad. Mutation for implementing a mutable datastructure is probably fine
<lavaflow> at the least, I think it could half the number of mutations and the size of the table on disk.
pera has quit [Ping timeout: 268 seconds]
pera has joined #racket
<lavaflow> I think instead of comparing/swapping in racket, I could just use min() and max() in SQL. I wager that would be pretty fast.
<lavaflow> wait no, the in memory cache
notzmv has joined #racket
ubLIX has joined #racket
cantstanya has quit [Remote host closed the connection]
cantstanya has joined #racket
endobson has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]