unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Daniel Skinner <daniel@dasa.cc>
To: Guile User <guile-user@gnu.org>
Subject: guile hoot and ArrayBuffer
Date: Sat, 1 Jun 2024 15:14:12 -0500	[thread overview]
Message-ID: <CAJ7_s+Kcg-wuBKeXVUP5wK7uoUbB93vJQ87faTNsWwqCSOb=uw@mail.gmail.com> (raw)

I'm wondering if it's possible (or on the roadmap, or if the question is
even sane) to have the various bytevector functions operate upon passed in
ArrayBuffer.

Or is there some manner to provide a view of a bytevector as an ArrayBuffer
from the default wasm memory in use.

For example, referencing below I mean to create the memory in JS and then
operate upon it in hoot module:
https://developer.mozilla.org/en-US/docs/WebAssembly/JavaScript_interface/Memory

Specifically, there is this section which I'm wondering if supported in
some fashion:
"""
Originally you could only perform memory operations on a single memory in
the Wasm module, so while multiple Memory objects could be created, there
wasn't any point doing so. More recent implementations allow WebAssembly
memory instructions to operate on a specified memory. For more information
see Multiple memories in Understanding WebAssembly text format.
"""

The actual problem I'm trying to solve is an area of memory with one writer
and many readers that may span worklets. I could solve this in a number of
inefficient copy methods but something along the lines of above seems like
a better choice.

See also this comment which seems desirable:
https://github.com/WebAssembly/design/issues/1231#issuecomment-420466909

Currently I'm doing the following within a single worklet which isn't even
the more complicated case above and wondering if necessary:
https://codeberg.org/dskinner/shields-tyvm/src/commit/01130104d18a50367d839a639d12895f43298ec8/realtime_worklet.js#L792

Thanks,
Daniel


             reply	other threads:[~2024-06-01 20:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-01 20:14 Daniel Skinner [this message]
2024-06-01 22:00 ` guile hoot and ArrayBuffer Thompson, David
2024-06-02  1:00   ` Daniel Skinner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJ7_s+Kcg-wuBKeXVUP5wK7uoUbB93vJQ87faTNsWwqCSOb=uw@mail.gmail.com' \
    --to=daniel@dasa.cc \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).