IRC channel logs


back to list of logs

<ArneBab_>I’m mainly modelling it after timeit(...) I know from python. It might prove to be a mistake, but I can change it then
<ArneBab_>and it helps me learn about syntax-case :)
<starmon>Hello! I'm having trouble using a module from the working directory...
<ijp>the current directory is not on the load path by default
<starmon>Oh figures, that's what -L was for
<davexunit>good evening guilers
<remi`bd>hello! I’m writing bindings for GnuNet (dynamic FFI), there’s this GNUNET_PROGRAM_run function that takes argc and argv as arguments, and I don’t know how to handle this
<remi`bd>to experiment, I tried to craft myself fake argc/argv, but I couldn’t find how to set argv to something like { "foo", NULL }
<remi`bd>another question: how can I make an “array of pointers” (for instance, a “char *argv[]” or a struct foo *options[]”) ? I tried to make a bytevector of pointers, but pointers being wrapped (and not raw pointers), it didn’t work
<davexunit>remi`bd: for the pointers, use 'pointer-address' to unwrap them
<davexunit>that way you can stuff them into a uint bytevector
<davexunit>not sure how safe this is, though. :)
<remi`bd>thanks :D
<remi`bd>uint? aren’t pointers signed quantities?
<ijp>that wouldn't make sense
<remi`bd>oh yes excuse me, ptrdiff_t is signed, not pointers
<remi`bd>another question: is there a specific way to treat pointers to functions?
<remi`bd>maybe just procedure->pointer
<davexunit>yes, that works for sending scheme procedures to C functions
<davexunit>I've used it for C libraries that register callbacks
***u_l-lap is now known as unknown_lamer
*davexunit bought "The Reasoned Schemer" today
*davexunit was hoping to find it on sale at MIT Press' loading dock sale, but couldn't find it so paid full price
<paroneayea>davexunit: wow! what a coincidence
<paroneayea>I literally had that book open right on my lap
<paroneayea>jsut as I read this
<paroneayea>was reading it on a typing break
<davexunit>paroneayea: I'm happy to have it and complete my collection of schemer books.
<paroneayea>relatedly, now I need to find either a way to run (mini)kanren in guile 2.x or install guile-log?
<paroneayea>there is a bug where minikanren does not run by default, apparnently.
<davexunit>paroneayea: ijp has a minikanren implementation that works with guile
<paroneayea>oh neat
<paroneayea>time to package for guix??
<davexunit>my only concern with it is that the official reference implementation has been updated since ijp's last commit. not sure if it matters.
<paroneayea>where is it
<paroneayea> oic
<davexunit>and the reference implementation
<davexunit>or rather, the canonical implementation
<davexunit>the issue with this version is that it's just a heap of code, no modules.
<davexunit>probably so that it uses R5RS features only or something
<davexunit>ah, I see
<davexunit>not that I think about it, I've run into that.
***karswell` is now known as karswell
<ijp>davexunit: strictly speaking minikanren is not valid r[5/6]rs because it uses invalid symbol names
<ijp>but I think racket in #lang r6/5rs is the only thing that will complain about that
<davexunit>ijp: good to know, thanks
<paroneayea>davexunit: btw I bumped into and then which are interesting posts
<paroneayea>as well as those two authors going back and forth here:
<davexunit>paroneayea: cool
<davexunit>I'm unconvinced by the first blog post
<paroneayea>me too
<paroneayea>but it provides an interesting backdrop for the second
<davexunit>admittedly, I haven't read both of them thoroughly yet
<davexunit>I really want to apply minikanren in a game
<paroneayea>davexunit: for AI or etc?
<davexunit>paroneayea: AI or level generation
<paroneayea>davexunit: would be interesting to think how it might be done in a way that can happen in the background
<davexunit>would be neat to use a minikanren relation to describe how an enemy makes their next move
<davexunit>in other news, I have the essential parser combinator functions working, complete with some basic tests.
<davexunit>but now for the hard part:
<davexunit>dealing with ambiguous and left-recursive grammars...
<davexunit>I haven't yet read an explanation that has made the solution click for me yet
<davexunit>this has been a really great guide most of the way, though
<davexunit>the actual code isn't great, but the explanations have helped