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
lockywolf has quit [Ping timeout: 272 seconds]
liberiga has joined #racket
JunjieZ has joined #racket
endobson has joined #racket
vraid has quit [Ping timeout: 245 seconds]
pera has quit [Ping timeout: 244 seconds]
jao has quit [Ping timeout: 272 seconds]
lockywolf has joined #racket
cpup has quit [Quit: Breaking stuff]
q9929t has quit [Quit: q9929t]
lockywolf_ has joined #racket
lockywolf_ has quit [Remote host closed the connection]
lockywolf_ has joined #racket
lockywolf has quit [Ping timeout: 258 seconds]
lockywolf_ has quit [Remote host closed the connection]
lockywolf_ has joined #racket
ng0_ has joined #racket
ng0 has quit [Ping timeout: 260 seconds]
orivej has joined #racket
sword865 has joined #racket
Sgeo_ has joined #racket
Sgeo has quit [Ping timeout: 248 seconds]
lockywolf__ has joined #racket
lockywolf_ has quit [Ping timeout: 272 seconds]
lockywolf has joined #racket
lockywolf__ has quit [Ping timeout: 248 seconds]
lockywolf_ has joined #racket
lockywolf has quit [Ping timeout: 258 seconds]
<lavaflow> I think a smarter person that myself might do some good by making some sort of "namespaces for idiots" convienence module for people like me
<lavaflow> because man this stuff has tied my brain in a knot
<lavaflow> I think I've got it mostly figured out at this point, but I still don't really understand why some things are necessary
<lavaflow> like the double quoting of module names like some functions require
<lavaflow> also things like namespace-attach-module not returning the new namespace functional style but instead modifying the one given to it is a bit.. ugly I guess. I don't know enough about this stuff to know why it's done like that. performance maybe? but it seems rough to me, a novice user of it.
<lavaflow> also "15.2 Manipulating Namespaces" in the guide was very helpful, but I don't see a link to it from "14.1 Namespaces" in the Reference
<endobson> lavaflow: can you give an example of the double quoting?
<lavaflow> (namespace-require ''foo5 ns5)
<lavaflow> (where 'foo5 is a module and ns5 is the namespace I want it required in)
<endobson> ok so that looks like a single layer of quoting to me
<endobson> the name has a quote in it
<endobson> think about what the difference would be between using ''racket and 'racket
<lavaflow> well I mean, I did (module foo ....) so the (require 'foo) that I'd normally do seems like one layer of quoting to me
<endobson> the second would use the standard library
<endobson> but you have to use a raw-require-spec
<endobson> https://docs.racket-lang.org/reference/require.html?q=namespace-require#%28form._%28%28quote._~23~25kernel%29._~23~25require%29%29
<endobson> and you seem to want to use the raw-root-module-path = (quote id) production
JunjieZ has quit [Remote host closed the connection]
<lavaflow> it kind of feels like taking multivariate calc again. I'm confident what the professor is talking about is logical and correct, but it's still making me feel dumb ;)
<endobson> i think part of it may be that '"foo" and "foo" are the same thing
<endobson> but ''foo and 'foo are not
<lavaflow> I'm going to keep poking at it until it makes sense, but for me this stuff out seems like some of the trickiest bits of racket I've encountered yet.
<lavaflow> s/out// I probably need some sleep too..
<endobson> Do you understand phases and the differences between the different ways modules can be instantiated/other terms
<lavaflow> not particularly. I'm familar with the concept of it being done in phases, and I guess different macro expansions and whatnot happen at different stages, but I've not really dug into that stuff
<endobson> The namespace stuff you are looking at is related to it
<lavaflow> ok, I'll give through those sections of the guide/reference a more careful look then
notzmv has joined #racket
lockywolf_ has quit [Ping timeout: 245 seconds]
lockywolf has joined #racket
dddddd has quit [Read error: Connection reset by peer]
lockywolf has quit [Ping timeout: 245 seconds]
lockywolf has joined #racket
<lavaflow> so I'm reading s-expressions from incoming connections from a tcp listener, and evaling them in a namespace that I believe to only contain #%app #%top #%datum, and a handful of procedures and structs I provide from my command-lang.rkt module
Sgeo__ has joined #racket
<lavaflow> I don't think there is any set! being provided, nor require.. so should it be safe for me to reuse the namespace between different connections to the server?
<lavaflow> or should I create a fresh namespace each time just to be safe?
<endobson> are you worried about correctness or security?
<lavaflow> I can't think of any way, given what command-lang.rkt provides, to override any of the bindings in the namespace, but maybe I'm missing something
<lavaflow> mostly just correctness
<endobson> what procedures are you providing?
<lavaflow> well here, let me post a gist of it
orivej has quit [Ping timeout: 245 seconds]
lockywolf_ has joined #racket
Sgeo_ has quit [Ping timeout: 248 seconds]
<endobson> Looks pretty good
<lavaflow> it's mostly place-channel message passing for sql stuff
<endobson> are you only expecting the s-expressions to be racket expressions?
<lavaflow> yes, a restricted subset of racket.
<endobson> rudybot: init racket
<rudybot> endobson: your sandbox is ready
<lavaflow> e.g. #:keyword stuff should work and whatnot
<endobson> rudybot: doc #%expression
<rudybot> endobson: http://docs.racket-lang.org/reference/__expression.html#(form._((quote._~23~25kernel)._~23~25expression))
<endobson> If you wrap it in that it will prevent it from being a definition
lockywolf has quit [Ping timeout: 246 seconds]
<lavaflow> ah neat. so something like (eval `(#%expression ,sexpr)) ?
liberiga has quit [Ping timeout: 260 seconds]
<endobson> sorta
<endobson> that would require exporting #%expression which is fine
<lavaflow> ah right, of course.
ng0_ has quit [Remote host closed the connection]
<endobson> I believe if you don't want to do that then you need to do `(,#'#%expression ,(namespace-syntax-introduce sexpr ns))
<lavaflow> think I'll just provide #%expression from command-lang.rkt. seems simpler
ng0_ has joined #racket
lockywolf_ has quit [Ping timeout: 258 seconds]
lockywolf has joined #racket
endformationage has quit [Quit: WeeChat 2.5]
<lavaflow> I think eval with a restricted namespace was the correct decision, I'm really pleased with how this is working now.
lockywolf has quit [Remote host closed the connection]
lockywolf has joined #racket
lockywolf has quit [Ping timeout: 246 seconds]
lockywolf has joined #racket
<lavaflow> damn, racket/fasl is _considerably_ faster than racket/serialize for large inputs, but it doesn't handle sql-null from the db module
<lavaflow> sql-null not being #:prefab is annoying. can't put it through place channels.
sauvin has joined #racket
lockywolf_ has joined #racket
manualcrank has quit [Quit: WeeChat 1.9.1]
lockywolf has quit [Ping timeout: 244 seconds]
lockywolf_ has quit [Read error: Connection reset by peer]
lockywolf_ has joined #racket
orivej has joined #racket
lockywolf_ has quit [Ping timeout: 248 seconds]
lockywolf_ has joined #racket
endobson has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Sgeo_ has joined #racket
Sgeo__ has quit [Ping timeout: 244 seconds]
lockywolf_ has quit [Remote host closed the connection]
lockywolf has joined #racket
jao has joined #racket
<tonyg> (lavaflow: the stuff around namespaces and modules is genuinely one of the murkiest, trickiest bits of Racket! You're not alone :) )
lockywolf has quit [Ping timeout: 246 seconds]
ng0_ is now known as ng0
ephemera_ has joined #racket
pie_ has quit [Ping timeout: 264 seconds]
anddam has joined #racket
<anddam> howdy
manualcrank has joined #racket
ArthurStrong has joined #racket
Sgeo__ has joined #racket
Sgeo_ has quit [Ping timeout: 268 seconds]
ng0 has quit [Quit: Alexa, when is the end of world?]
vraid has joined #racket
ng0 has joined #racket
iyzsong has joined #racket
<winny> greetings
orivej has quit [Ping timeout: 272 seconds]
dddddd has joined #racket
mSSM has joined #racket
Sgeo_ has joined #racket
Sgeo__ has quit [Ping timeout: 245 seconds]
davidl has quit [Ping timeout: 244 seconds]
lockywolf has joined #racket
lockywolf has quit [Remote host closed the connection]
lockywolf has joined #racket
lockywolf has quit [Remote host closed the connection]
pierpal has quit [Remote host closed the connection]
lockywolf has joined #racket
pera has joined #racket
endobson has joined #racket
sword865 has quit [Quit: Connection closed for inactivity]
orivej has joined #racket
dddddd has quit [Quit: Hasta otra..]
dddddd has joined #racket
iyzsong has quit [Quit: ZNC 1.7.1 - https://znc.in]
ng0 has quit [Remote host closed the connection]
ng0 has joined #racket
davidl has joined #racket
ng0 has quit [Remote host closed the connection]
ng0 has joined #racket
davidl has quit [Ping timeout: 244 seconds]
pera has quit [Ping timeout: 268 seconds]
efm has joined #racket
davidl has joined #racket
ArthurStrong has quit [Quit: leaving]
endformationage has joined #racket
Lowl3v3l has quit [Ping timeout: 245 seconds]
Lowl3v3l has joined #racket
vraid has quit [Quit: Leaving]
vraid has joined #racket
orivej has quit [Ping timeout: 258 seconds]
FreeFull has joined #racket
shwouchk has joined #racket
orivej has joined #racket
orivej has quit [Ping timeout: 268 seconds]
davidl has quit [Ping timeout: 244 seconds]
lockywolf has quit [Ping timeout: 272 seconds]
Nomenclatura has joined #racket
orivej has joined #racket
sauvin has quit [Read error: Connection reset by peer]
endobson has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
androclus has joined #racket
efm has quit [Ping timeout: 245 seconds]
efm has joined #racket
efm has quit [Ping timeout: 272 seconds]
ubLIX has joined #racket
selimcan has joined #racket
<dzoe> Ok, here is a good advice for anyone doing futures stuff in DrRacket: never spawn too many long futures, you cannot kill them.
<dzoe> On the upside, I can compute (fib 40) using 8 threads now :)
<dzoe> Still wondering why GC kicks in so often and what are the remaining two memory allocations.
<dzoe> And the nested loop gets JITted in each future separately (more like "for each future")
<dzoe> That is strange. Putting the inner (let loop () ... ) into separate function makes the runtime JIT it just once and all garbage collections disappear as well.
pera has joined #racket
<lavaflow> I never managed to use futures effectively. I had one case where I thought they'd be a good fit, running a thousand or so bayes classifiers at once, in theory a bunch of float math. but contorting my solution to really leverage futures properly proved a PITA
<dzoe> It is rather interesting task, to be honest.
<dzoe> My goal is to implement parallel in-place merge sort of large fxvectors.
<vraid> gosh, i read "leverage futures" in a completely different way after working in finance
<dzoe> So basically the first step was to implement merge sort using as little allocations as possible (and leveraging unsafe-fx* functions)
<dzoe> Now the second step was to create a proof-of-concept parallel implementation of a doubly-recursive function using futures - I used Fibonacci sequence as a nice example.
<dzoe> And now building on this I hope to create futures-based parallel in-place merge-sort.
<dzoe> Although Fibonacci's sequence wasn't the best idea (all futures take different times to complete), it allowed me to test the idea and to simulate the recursion using fixed-size stacks for each future.
<dzoe> A big downside is the time it takes me to finish it all. If I can keep up this pace, it will be roughly a week of full-time work to finish this project.
<dzoe> And it started so innocently... I just needed to sort 2^{27} values :)
ng0 has quit [Ping timeout: 260 seconds]
ng0 has joined #racket
selimcan has quit [Quit: Leaving]
badkins has quit [Remote host closed the connection]
ZombieChicken has joined #racket
pie_ has joined #racket
ubLIX has quit [Quit: ubLIX]
FreeFull has quit []
<nisstyre> vraid: let's short the Racket futures
<nisstyre> it'll be a racket
orivej has quit [Ping timeout: 248 seconds]
ng0 has quit [Quit: Alexa, when is the end of world?]
<lavaflow> reminder that racketeering is a crime :P
badkins has joined #racket
badkins has quit [Remote host closed the connection]
<lavaflow> semi-related, I had an idea for a function sync/vector, which takes a vector of evt? and returns a vector of the same size where each element is the synchronization result of the corresponding evt (it doesn't return until every evt has synced)