IRC channel logs

2024-10-26.log

back to list of logs

<dthompson>kreved: sorry for the delay, but basically you need to use define-foreign to define a binding to a foreign function (javascript). if you explain the exact task you're trying to do I might be able to provide more specific advice.
<dthompson>our game jam template repo is full of examples of the ffi in use https://gitlab.com/spritely/guile-hoot-game-jam-template/
<dthompson>as is https://gitlab.com/spritely/guile-hoot-ffi-demo
<drewjose>Writing bindings to the melonjs library but very slowly
<kreved>dthompson: turns out I don't need it D:
<kreved>at least not yet
<kreved>I basically have method that accepts nested js object
<kreved>and I'd like to build that object in scheme and pass it to js
<kreved>but from my understanding it's not possible yet
<dthompson>kreved: without having all the context needed to speak in any specifics, from my own experience working on hoot so far I'd say that if you find yourself wanting to build a nested js object from scheme that something has gone wrong in your design.
<dthompson>hoot's ffi is actually agnostic to its host platform, it speaks only in core wasm types. this is what allows hoot modules to run on the web/nodejs, as well as our own interpreter in guile, and with the possibility of running on non-web production runtimes such as wasmtime (in the future, they only just got support for wasm gc)
<kreved>dthompson: I'm using pixijs, so not really my design
<dthompson>I mean the design of the foreign interface
<dckc>nice to see the shepherd design!
<dckc>I wonder about confined services
<dckc>(rebooting for maintenance here, btw)