Hi, I'm interested in using hoot, but I'm new to wasm and web dev in general. I have some questions wrt hoot's FFI.
Following the example from the documentation: https://files.spritely.institute/docs/guile-hoot/latest/Foreign-function-interfa..., I created hello.scm as follows:
(use-modules (hoot ffi)) (define-foreign make-text-node "document" "createTextNode" (ref string) -> (ref extern))
Then, I compiled it to wasm:
guild compile-wasm --bundle -o hello.wasm hello.scm
Then, I loaded it into guile repl:
(use-modules (wasm parse))
(use-modules (hoot reflect))
(hoot-instantiate (call-with-input-file "hello.wasm" parse-wasm)
(("document" .
(("createTextNode" . ,(lambda (str) (text ,str))))))) Then, I tried to use the make-text-node function:
(define hello (make-text-node "Hello, world!"))
But it always gives me the error: Unbound variable: make-text-node.
I'm not sure if I'm fundamentally missing something. I'm just wondering if there's a way to test these kinds of procedures in a guile repl.