IRC channel logs

2024-11-18.log

back to list of logs

<old>also need a way to embed core modules and applications modules in the binary
<ArneBab>dthompson: I tried a minimal hoot, but it doesn’t work. To reproduce: guix shell guile-hoot guile-next -- guile -c '(import (hoot ffi)) (define-foreign document-body "document" "body" -> (ref null extern))' ⇒ no code for module (hoot ffi)
<ekaitz>wingo: i know where the problem is with the call_10_2.c and it's the RISC-V abi is a little bit crazy with floating point numbers
<ekaitz>when using more than 8 floating point arguments, they are sent in normal registers
<ekaitz>and lightening doesn't currently do that => i'm implementing it
<ekaitz>and lightening doesn't provide instructions for moving from floating point regs to normal regs
<dthompson>ArneBab: you're running regular guile in that snippet
<dthompson>I'm not sure what you expected to happen, I guess.
<ArneBab>dthompson: I expected guile to be guile-hoot when I started a guix shell with guile-hoot. Seems I misread the docs …
<dthompson>I recommend starting with something simpler than using the ffi. that is more advanced.
<ArneBab>dthompson: I tried to follow your guide for https://gitlab.com/spritely/guile-hoot-ffi-demo/-/blob/main/hello.scm?ref_type=heads from https://spritely.institute/news/building-interactive-web-pages-with-guile-hoot.html but I guess I missed intermediate steps.
<dthompson>take a look at the Makefile in that repo
<dthompson>it will show you how to compile programs with hoot
<ArneBab>damn, too obvious … https://gitlab.com/spritely/guile-hoot-ffi-demo/-/blob/main/Makefile?ref_type=heads#L3 — thank you!
<dthompson>np :)
<old>So when I use for-each from boot-9, the source column I have points to `f'. But when I use for-each from srfi-1, the column points to `('
<old>this is all weird
<old>this is driving me insane
<ArneBab>dthompson: found my problem: I used (import ...) instead of (use-modules ...). However I’m still stumbling over the guile-hoot-ffi-demo: it does not find wtf8.wasm
<dthompson>both 'import' and 'use-modules' are valid
<dthompson>it sounds like you might be trying to do too much at once
<old>hm this is interesting. A simple application of something like (proc args) will generate a single (line . column) pair in the source of the function. But a (for-each proc args) will generate two pairs
<old>which is why when I'm doing backtrace, I see the last pair that points not to the application itself
<dthompson>ArneBab: have you built and run the ffi demos *as-is* yet?
<dthompson>I can try to help but it's unclear what you're actually trying to do
<ArneBab>dthompson: yes, I built the ffi demos from the repository now.
<dthompson>and do they work in your browser?
<ArneBab>dthompson: besides: if you change serve to "serve: all", make serve compiles all wasm files before running serve.
<ArneBab>Do, the browser says: Uncaught (in promise) TypeError: WebAssembly: Response has unsupported MIME type 'text/plain;charset=utf-8' expected 'application/wasm'
<ArneBab>that’s ff 124
<ArneBab>also it does not find wtf8.wasm
<dthompson>looks like I accidentally deleted files. oops. will fix
<ArneBab>Thank you!
<dthompson>ahhh the issue is the .gitignore file. I moved wtf8.wasm and reflect.wasm to the root dir but there's an ignore rule for *.wasm
<dthompson>darn
<dthompson>thanks for reporting the problem
<dthompson>pushed a fix
<old>hmm this is interesting. So Guile actually emit one source pair for the application and one source pair for referecing free variables
<old>which seems to emit weird thing when doing backtrace
<ArneBab>dthompson: now it works!
<ArneBab>dthompson: that’s strange … this works locally (with guile -c '(... serve)', but not on my server: https://www.draketo.de/software/hello-hoot.html
<ArneBab>dthompson: I take it back, used the wrong browser to test. It works!
<dthompson>yay!
<ekaitz>wingo: passing all lightening tests now... but we need to review this ABI issue in detail
<ekaitz>wingo: we are passing both guile's and lightening's tests now.
<ekaitz>i don't think we are a WIP anymore
<ekaitz>it needs review, because I wrote a big part of this 3 years ago and my C wasn't that good (still isn't), and some call convention things might be weird