On Wed, May 29, 2019 at 11:27 PM Ian Denhardt <i...@zenhack.net> wrote:

> One bit of food for thought: you can't exactly mmap() in elm,


That's not as true that you might think.

I'm not familiar with Elm specifically, but as I understand it, it
transpiles to JavaScript for execution in the browser.

JavaScript has ArrayBuffer, and it has the File and Blob APIs, which do in
fact allow you to mmap a file as an ArrayBuffer, once you've been granted a
capability to the file e.g. via the file-open dialog. Admittedly, that's
still probably an obscure use case.

An ArrayBuffer can also point into the memory space of a WebAssembly
module, and Cap'n Proto may in fact be an excellent way to share complex
structures between WASM and JavaScript (or Elm).

With all that said, it certainly makes sense to consider eager parsing as a
trade-off. I've been meaning to add an eagerly-parsed mode to C++ ("POCS"
support), since it could allow for an easier-to-use API in cases where
zero-copy is not important.

-Kenton

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capnproto+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/capnproto.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/CAJouXQmj%3De8wVb3sD2WO4Bhi%2BsucEjygOGT7iUvYKt544qFBYw%40mail.gmail.com.

Reply via email to