IRC channel logs

2025-10-12.log

back to list of logs

<mra>ooh, just noticed that the fall lisp game jam is coming up
<mra>I've been tinkering on a physics engine. maybe I can get enough of it together in time for the jam to throw together a game based on it
<mra>are there existing frameworks for game development in guile?
<rlb> https://dthompson.us/projects/chickadee.html at least
<mra>rlb: ooh, that's super convenient! thanks!
<daviid>mwette: i hve a basic config and access to the fluidsynth low level types, settings and synth api. so I can call (new_fluid_settings) => $6 = #<pointer 0x55d452152580>
<daviid>what are the ffi-helper procs i can use to get access to its content? point me to some to read, I have bearably reada nythig till now ...
<daviid>ah, i guess i need to use the fluidsynth api to set/get those
<mwette>daviid: hmm. Does new_fluid_settings not return a fluidsynth type? If it's supposed to be foo_t* then (make-cdata foo_t* $6);
<mwette>see https://github.com/mwette/nyacc/wiki/CData-Reference-Manual
<mwette>also https://github.com/mwette/nyacc/wiki/FFI-Helper-User's-Manual if you have not read that
<encryptedwhispe->Hello! I have a hopefully quick question about libguile. If I have a char* buffer on the c side, and I want to turn that into a guile u8 bytevector, what is the best approach? The char* is a buffer filled with data.
<encryptedwhispe->(rather than text)
<encryptedwhispe->scm_from_pointer followed by scm_pointer_to_bytevector?
<encryptedwhispe->I am unsure what to put for the second argument to scm_pointer_to_bytevector, type.
<encryptedwhispe->Think I've got it. The last two args just need to be SCM_UNDEFINED for my use case
<encryptedwhispe->I think I got slipped up because the header names the values incorrectly. It says that the second arg is 'type' but it's actually 'len'.
<encryptedwhispe->(in foreign.h)
<rlb>encryptedwhispe-: what is the buf, i.e. how is it allocated/freed -- I believe scm_c_take_gc_bytevector can be used to turn a gc allocated char array into a bytevector. Though I notice it's not documented, in the info pages, and is after the "internal API" header in bytevectors.h, so even though it isn't marked scm_i_, I'm not sure it's public.
<rlb>encryptedwhispe-: I believe a common approach would be to scm_c_make_bytevector() and then memcpy the bytes into the SCM_BYTEVECTOR_CONTENTS().
<characteristic>public and hidden well or internal and hidden badly?
<rlb>It's either actually public, which the name suggests, or someone forgot the scm_i_.
<rlb>But if it's public, it's a little confusing to be after the "/* Internal API */ header.
<rlb>encryptedwhispe-: oh, sorry, you're working with ffi, I was thinking about more direct libguile use.
<ArneBab>mra: chickadee is pretty awesome. Make sure to get the interactive REPL working before the game jam (and mark all your modules as #:declarative? #f): https://files.dthompson.us/docs/chickadee/latest/Live-Coding.html#Live-Coding
<mra>ArneBab: ooh, that's so cool! I need to see if I can get my physics engine up to scratch before I look more seriously at chickadee, but the existence of a repl environment is awesome
<ArneBab>mra: yes -- you need to make sure to have some indirection so you can replace bindings (I’m doing that in https://hg.sr.ht/~arnebab/drachi/browse/drachi/drachi.w?rev=tip#L476 by making all the procedures named in run-game only call other procedures. Then I redefine those other procedures.
<ArneBab>mra: sometimes the game can break if I actually add broken code, but being able to most of the time just tinker in the running game is pretty neat.
<ArneBab>mra: don’t forget ,m (your module) so your bindings get set at the right location.
<ArneBab>A small example: https://www.draketo.de/software/wisp#chickadee-2022-10-08https://www.draketo.de/software/chickadee-wisp.webm
<rlb>dsmith: we don't have a bug for that timestamp issue yet, do we?
<euouae>Hello, can I step every VM instruction seen in ,disassemble?
<mwette>sneek, later tell euouae, I believe ,si is the right meta command. You can also (use-modules (system vm vm)) (vm-add-next-hook! your-hook) if I read right
<sneek>Okay.