WASI is essentially a different operating system, POSIX-like but not
exactly the same. We will need to add support for it alongside POSIX and
Windows.

There's actually a PR open to create a build mode which mostly avoids OS
dependencies altogether, which might be a good starting point:

https://github.com/capnproto/capnproto/pull/1376

I'm a little confused about exceptions, though. Exceptions are not an OS
feature, they're a programming language feature... how could they not be
supported? Cap'n Proto actually does support building with
`-fno-exceptions`, so maybe that's a path forward, but there are a lot of
caveats...

-Kenton

On Sat, Jan 22, 2022 at 2:43 PM pepij...@gmail.com <pepijnde...@gmail.com>
wrote:

> Hey,
>
> I was playing around a bit to see if I could compile capnproto with the
> wasi-sdk or emscripten. wasi is a "web assembly system interface" that
> allows running wasm code completely without a JS runtime, while emscripten
> requires a browser/nodejs runtime. I think both options could be
> interesting for distributing software in a platform independent way.
>
> However, it seems capnproto doesn't compile out of the box with either.
> When targeting wasi, it is missing a bunch of things such as pipes,
> signals, and exceptions as far as I understand from compile errors in kj
> exception and unix abstraction code. When targeting emscripting it actually
> compiles but has some missing symbols during linking, also related to
> exceptions:
> https://github.com/emscripten-core/emscripten/issues/11985#issuecomment-1019317541
>
> Would there be a way to compile capnproto without these problematic
> features, or a feasible way to provide wasi-specific stubs for them?
>
> Cheers,
> Pepijn
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/capnproto/52be11e2-9fb9-4a9c-831b-f7798703c5c3n%40googlegroups.com
> <https://groups.google.com/d/msgid/capnproto/52be11e2-9fb9-4a9c-831b-f7798703c5c3n%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/CAJouXQkzoFnJ82dUCRz07z4AVPUaD3L6ikAAbExaYF%2BaOxNLRA%40mail.gmail.com.

Reply via email to