taylanbayi...@gmail.com (Taylan Ulrich "Bayırlı/Kammer"): > Marko Rauhamaa <ma...@pacujo.net> writes: > >> l...@gnu.org (Ludovic Courtès): >> >>> I’m very skeptical about this use case (I’d use ‘mmap’ and get a >>> bytevector.) >> >> Please elaborate. >> >> 1. Does Guile offer mmap to Scheme code? > > It's pretty easy to call C functions from Scheme.
Not good enough. I would have to precompile libraries for different target platforms (or require the target environment to have a C compiler). Besides, the need is quite generic and shouldn't require an extension. >> 2. What would prevent Guile's GC from scanning the mmapped area for >> pointers? > > I don't know the details but AFAIK this is no problem with Boehm GC. I don't understand. It can be quite time-consuming to scan gigabytes of RAM for pointers. >> 3. How do I efficiently encode information in a bytevector in Scheme >> code? > > What sort of data? > > I have a library called bytestructures that imitates the C type system > within Scheme, to be used on bytevectors that contain data structures > generated by C code, though the library is built upon a generic core > with which other structures can be declared as well. Not sure if this > helps you: > > https://github.com/TaylanUB/scheme-bytestructures/ That's precisely it. It would be nice to have it as part of standard Guile. I wonder, though, if doing that is fast enough in Scheme code. Marko