IRC channel logs

2025-10-30.log

back to list of logs

<mwette>I remember also. I thought civodul had done something.
<sneek>dsmith: Greetings!
<tohoyn>sneek: botsnack
<sneek>:)
<dsmith>sneek, botsnack
<sneek>:)
<kestrelwx>What should I do for dictionary type binding for Hoot? Is this what `define-foreign-type` is for?
<dthompson>kestrelwx: dictionary type binding? like a js object? what are you trying to specifically?
<dthompson>define-foreign-type introduces a record type wrapper around a (ref extern)
<dthompson>so that you can distinguish between types of foreign objects without leaving scheme
<kestrelwx>So, I have an IDL spec like https://paste.debian.net/1403638/. I should've said that it's an IDL Dictionary instead.
<kestrelwx>I guess I should just produce pairs of getters/setters for each entry and a constructor, since these are objects.
<dthompson>kestrelwx: that's the return value of WebGLRenderContext.getContextAttributes() right?
<kestrelwx>Yes.
<dthompson>so yeah, getters and setters for each value makes sense to me.
<kestrelwx>I should then define foreign types for all the classes and these dictionaries.
<dthompson>if you want. it can help provide clarity in your code but it introduces a wrapper object.
<dthompson>could be helpful here, though
<kestrelwx>And then I only have to write wrappers for overloaded functions I think.
<kestrelwx>Do you have examples of having to do that?
<dthompson>what are the overloaded functions in this case?
<dthompson>typically for overloads you need a binding per signature
<dthompson>like if the same function could take an int or a string, you'd need to define two foreign functions
<kestrelwx>There's for example `readPixels` with 4 signatures.
<kestrelwx>Weird 'pixels' is lower case for the JS function. https://paste.debian.net/1403639/
<dthompson>that's strange because the method is definitely camel cased https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/readPixels
<dthompson>but yes, you'll need 4 foreign functions if you want to support each variant
<dthompson>because wasm functions cannot be overloaded
<kestrelwx>I guess I'll just append -1, -2, -3, -4 and then if there's actually a need for it, the user(me) would write the dispatch code.
<dthompson>yeah you can put a nice scheme interface around it if necessary
<dthompson>often I find I only need one or two variants and don't bother with the rest
<dthompson>or some of the variants are just conveniences that my wrapper code can handle just as well and then I can just a single foreign function
<kestrelwx>Oh, I must've lower-cased it in visual mode when copying, it's fine after I regenerated the bindings.
<dthompson>are you using an idl parser?
<kestrelwx>Yes, I'm using rgherdt_'s `webidl-parser`.
<dthompson>oh awesome!
<dthompson>this is the kind of thing I haven't been able to work on but I'm glad other people are making progress
<kestrelwx>I'm not too happy with what I wrote so far, but maybe I'll work on it after the jam.
<dthompson>the long term plan for hoot is to introduce a higher-level ffi for js bindings. it will make both manually written bindings and bindings generated from webidl easier to deal with.
<kestrelwx>I'll publish everything later today, I'm hoping still to port the breakout to these, but maybe I won't make it in time.
<dthompson>whatever happens, you're taking some important steps forward :)
<sneek>Welcome back tohoyn :)
<jralls>.
<sneek>jralls, you have 1 message!
<sneek>jralls, ArneBab says: my concern with scm_from_unsigned_integer is just that I donโ€™t know enough about the details, so Iโ€™m left asking about stuff that isnโ€™t obvious to me to be correct. Please get in contact with Jonas to get to the heart of those issues.
<kestrelwx>I'm seeing permission denied with `compile-wasm --bundle` on Guix.
<kestrelwx>When copying out of the store, I think.
<kestrelwx>Well, `guix build --repair` wasn't enough. https://paste.debian.net/1403700/
<euouae>Hello does anyone know why when I import r6rs libraries I get: WARNING: (guile-user): imported module (rnrs) overrides core binding `error' WARNING: (guile-user): imported module (rnrs) overrides core binding `map'
<euouae>E.g. warnings about error and map. Why not other core bindings?
<kestrelwx>Oh, I can't have '-' in a JS variable name.
<old>kestrelwx: yup first limitation I've encounreted
<kestrelwx>Can it not have emojis
<old>basically you need to define _everything_ in advance, I don't recall how exactly
<old>Maybe there is a way with module reflection to automatically change the binding names (or duplicate them) but changing `-' for `_'
<kestrelwx>Yeah, I'll map them to '_'.
<kestrelwx>In Scheme I can have ๐Ÿ˜Ž๐Ÿ˜Ž๐Ÿ˜Ž identifier just fine...
<kestrelwx>Gecko and V8 also gave totally unhelpful error messages, so I had no for a while of what's going on.