IRC channel logs

2024-04-20.log

back to list of logs

<rlb>wingo: oh, in case it matters, in the situations I saw, falling back to the interpreter wouldn't have been useful (or harmful) because the compilation was failing just due to "broken code" (bad scheme).
<rlb>i.e. it'd have been just fine to halt altogether at that point.
<rlb>And I think if a .go load fails, I'd probably also want us to just halt, since that might mean that the only "correct code" had been damaged (bad block, or cosmic rays, or...), and so we shouldn't try anything else even if we could...
<jpoiret>re hoot: seems that a simple (import (scheme inexact)) leads to https://gitlab.com/spritely/guile-hoot/-/issues/249 for me, and HEAD fixes it.
<jpoiret>seems pretty severe
<dthompson>jpoiret: interesting! haven't run into that before, but we're at the stage where basically every new program uncovers new bugs. we're currently fixing all the bugs we know about and will be making a 0.4.1 release soon. :)
<jpoiret>dthompson: great! while I have you here, how do I build a pair from javascript?
<jpoiret>I want one of my foreign functions to return a pair of integers, instead of having two different functions for each coordinate. Is that doable?
<dthompson>it's kind of a 6 of one, half a dozen of the other situation. to construct a pair you'd have to call back into wasm to do it. the pair would then go back to js and *then* be sent back to wasm to the original caller.
<dthompson>...so you might as well make 2 ffi calls
<jpoiret>hmmm, that's a shame. I see there's no pair constructor exported by reflect.wat so that's expected
<dthompson>yeah the interface currently is just for reading values
<dthompson>I suspect there's another way to write your program that would be more efficient
<dthompson>but there's also limitations in wasm right now that make certain types of data sharing inefficient
<dthompson>strings are one such example, though we make it transparent to users
<jpoiret>basically I'm reading the coordinates of a MouseEvent, I want to simply pass them back as a coordinate pair
<dthompson>I'd just do 2 calls to js for each coordinate. will avoid an allocation.
<tomnor>(define x 7) (variable? x) ==> #f
<tomnor>is that normal? How does the variable? predicate work?
<dthompson>yes that's normal. you're saying (variable? 7)
<dthompson>to get access to a variable object, you'd either make one yourself or use module introspection to get a top-level variable
<tomnor>should I say (variable? 'x)
<dthompson>that would also be #f
<dthompson>since 'x is a symbol
<tomnor>module introspection sounds exciting
<dthompson>it's useful sometimes
<dthompson>but generally speaking you wouldn't use things like variable? in regular programs
<tomnor>I discovered the existance of it by accident and started wonder what it does