IRC channel logs

2024-06-16.log

back to list of logs

<RavenJoad>janneke: We could. Or I could just contribute some clarification and examples to the manual, now that I know what I am doing.
<cow_2001>aaaaa https://codeberg.org/kakafarm/guile-pstk/compare/048e816f0c685e6b22656c50fa4e53bad025ed08...master
<lechner>Hi, how may I call 'malloc' and 'free' from Guile, please? I tried foreign-library-function with "libc" and "malloc" but get: In procedure dlopen: file "libc.so", message "/gnu/store/ln6hxqjvz6m9gdd9s97pivlqck7hzs99-glibc-2.35/lib/libc.so: invalid ELF header"
<lechner>wow, it's a symlink!
<flatwhatson>lechner: you don't need to dlopen libc, it's already loaded
<flatwhatson>> If library argument is omitted, it defaults to #f. If library is false, the resulting foreign library gives access to all symbols available for dynamic linking in the main binary.
<flatwhatson>see the first example here: https://www.gnu.org/software/guile/manual/html_node/More-Foreign-Functions.html
<flatwhatson>memcpy is from libc, but because it's already loaded #f is passed as the lib
<kjartanoli>I'm working with a FFI function that requires FILE* arguments. Is it possible to pass a file port to such a function, or extract the underlying FILE* from the port?
<kjartanoli>Or am I better of calling fopen?
<lechner>flatwhatson / okay, i tried "" instead of #f. Thanks!
<lechner>Hi, I'm seeing "madvise failed" after using 'malloc' and 'free' in Guile code called from Greetd via the "Tortoise" C interface. Is that a message Guile might issue, or should I look at Greetd? Thanks!
<lampilel`>lechner: it's Guile
<haugh>I tell you hwat, I'd really like to use some of these racket libs in guile. Obviously it's never been easier to steal code, but I wonder if anyone's tried to do this at scale. Theoretically it's quite feasible to run racket as a service, trading sexps over a port. Does anyone have thoughts on this? Tried to do anything comparable?
<haugh>dthompson, thank you for linking Sussman's 2011 Strange Loop talk in your optimization post. It's full of mythic quotes.
<haugh>"Suppose for every little memory module I had a big processor associated with it. Don't worry about it! That'll happen, because there's no other way to make the future happen."
<lechner>lampilelo / thanks!