IRC channel logs

2024-10-02.log

back to list of logs

<cpli>mwette: how fast is `assq-ref`, and would it be advantageous to maybe generate perfect hashmaps instead?
<eikcaz>I'm writing some guile to interact with a REST API, but their server likes to give strings in strings, so "foo" is sent as "\"foo\"". I want to do something like (read (open-input-string "\"foo\"")), but it seems dangerous to read possibly malicious data.
<eikcaz>is there a safe way to do that?
<eikcaz>cpli: how big are your association lists? (order of magnitude)
<cpli>eikcaz maximally 100 entries
<eikcaz>I would just use assq-ref
<cpli>hmm.. this might be ill-guided, but since i'm writing a renderer.. i'm anxious about that sort overhead *every frame*
<eikcaz>oh, that does sound intensive. Still, changing your code from association lists to hashmaps after the fact should be pretty easy (probably could be done with a couple find-replace's)
<mwette>cpli: are you talking about chasing struct tags using cdata?
<mwette>If so, you might look at ctype-sel and make-cdata-getter.
<wehlutyk>Hello all! I'm mostly a Guix user, starting to use Guile (aside from the guix config.scm files)
<wehlutyk>and got stuck in getting access in guile to a library I just installed
<wehlutyk>I'm trying to play around with guile-wlroots <https://github.com/Z572/guile-wlroots>
<wehlutyk>compiled and installed fine using its "guix.scm"
<wehlutyk>but which I can't get my guile shell to access
<wehlutyk>I tried "(add-to-load-path "/gnu/store/...-guile-wlroots.../lib/guile/3.0/site/ccache/")
<wehlutyk>which still doesn't let me use guile-wlroots as a lib: "(use-modules (wlroots))" or "(use-modules (wlroots types))" fail
<wehlutyk>Could there be something wrong with the depth in the lib folder?
<wehlutyk>any help or advice or pointer is very welcome!
<dthompson>that load path is for source but you're adding a path to bytecode
<dthompson>there's both load-path and load-compiled-path
<wehlutyk>aha
<wehlutyk>there's an "(add-to... )" for load-compiled-path? I'll look for that
<wehlutyk>got it, thanks -- instead of reading "Load Paths" in the docs, it was the previous section about "Loading Scheme Code from File"
<wehlutyk>dthompson: thanks for haunt! (happily using it for my homepage)
<dthompson>wehlutyk: glad you figured out your load path issue!
<dthompson>what's your website url?
<dthompson>glad you like haunt :)
<wehlutyk> https://slvh.fr/ (and I must mention all the css is inspired by your design)
<wehlutyk>so double thanks 😍
<dthompson>looks great!
<wehlutyk->:)
<dthompson>wehlutyk-: you made the style your own :)
<wehlutyk->thanks!
<jlicht>is there anything I can do to keep geiser from compiling my scm files? I already have GUILE_AUTO_COMPILE set to 0, but both `geiser-compile-current-buffer` and `geiser-load-current-buffer` lead to guile generating .go files in $HOME/.cache/guile
<graywolf>Hello, I am curious, should -Ocross-module-inlining be enabled by default?
<graywolf>Does it make it kinda easy to violate LGPL?
<graywolf>My code is AGPL, so I *think* I am safe, but is it even possible to write non-(L)GPL programs in guile?
<Arsen>yes
<Arsen>to the latter
<graywolf>Hm, how does it work? When I use some core Guile macro (under LGPL), and it is used in my module (non-GPL) and compile the .go that containes the result (and with module inlining possibly even LGPL procedure code), does that still comply with LGPL terms?
<Arsen>no - you need to distribute the sources
<Arsen>(which is nigh-necessary anyway, IIRC .go objects aren't stable across releases)
<graywolf>And those sources in addition need to be under LGPL compatible license no?
<Arsen>no
<graywolf>Maybe I need to re-read LGPL. I thought that when you are combining sources (as oposed to just linking), my code need to be license compatible with LGPL. And, in case of inlining and macros, I thought sources are being combined...
<Arsen> https://paste.sr.ht/~arsen/a579d93ad4700d8339a8d7a272daf6e1319d7869
<Arsen>emphasis mine - but I meant to also emphasize d0
<Arsen>(IANAL ofc, but I am decently sure this is the case)
<graywolf>Oh, so "source available" would suffice to satisfy the requirements.
<graywolf>I think I get it now, thank you :)
<Arsen>even enough sources to just recompile an interface library or something
<Arsen>but I think in this case no such thing exists (it is scripting after all)
<Arsen>and no problem
<wehlutyk>Hello again! Out of curiosity, has anyone here been trying out guile-wlroots?
<wehlutyk>or would the author even be here?
<wehlutyk>I'm attempting to get example uses running
<wehlutyk>but it fails in something I can't understand
<wehlutyk> https://paste.debian.net/1331126/
<wehlutyk>(I'll send the same on #guix)
<mwette>Oh, wlroots would be a fun ffi-helper project to try.
<wehlutyk>ffi-helper?
<wehlutyk>mwette: it's https://www.nongnu.org/nyacc/ffi-help.html right?
<wehlutyk>from what I understand it simplifies developing a new ffi, not diagnosing an existing one that hasn't relied on it right?
<mwette>Are you using the emturner one (I just saw)? If so, is it well implemented? I just took a cursory look, but didn't seem all there.
<mwette>And right, it will not help with your current issue.
<mwette>I've seen the error before. Are you trying to pass a lambda where a pointer (from procedure->pointer) is expected?
<mwette>In the update to ffi-helper to use cdata, I put in a lot to work to deal with function types and callbacks.
<wehlutyk>I'm not using any I think :-p , I'm very new to guile, and for the moment just trying to get the guile-wlroots example to run
<mwette>Do you have a link. I only found this: https://gitlab.com/emturner/guile-wlroots
<wehlutyk>sorry, https://github.com/Z572/guile-wlroots/
<wehlutyk>(I thought the emturner was another contributor to ffi-helper)
<mwette>OK. I had fun w/ wayland in guile a while ago. I wrote client side support in guile (except mmap, sendmsg, recvmsg wrappers in C). https://github.com/mwette/guile-wl-play
<wehlutyk>wow
<wehlutyk>from what I saw so far, Z572 is cutting into subparts in https://github.com/guile-wayland/ with recent commits for guile-wayland (I'll submit my bug by now)
<wehlutyk>so there's a bunch of versions I see