Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Super happy to see WebAssembly Interface Types in development!

At Wasmer (disclaimer, I'm the founder!) we've been creating integrations with a lot different languages (C, C++, Rust, Python, Ruby, PHP, C# and R) and we agree that this is a pain point and an important problem to solve. We're excited that Mozilla is also pushing this forward.

If you want to start using WebAssembly anywhere: https://wasmer.io/

Keep up the good work! Let's bring WebAssembly everywhere!



Is this going to replace wasmer's WebAssembly interfaces?

As a library implementer, I'm a bit lost about how to expose functions from a wasm module to the outside world.

wasmer's interfaces have the advantage of being very simple to write. But they are not very expressive.

WebIDL is horrible, albeit more expressive.

At the same time, I feel like this is not enough.

My experience with libsodium.js, one of the first library exposing wasm (and previously asm.js) to other environments, has been that IDLs simply exposing function interfaces are not good enough.

For example, C functions returning 0 or -1 to indicate an error or not, would not be idiomatic at all if exposed that way in Scala, Javascript or Python. We want these to raise an exception instead.

Also, we need ways to preallocate buffers, check their size, etc. in order to make things appear more idiomatic.

In libsodium.js, the description language for the WebAssembly <-> JS glue is JSON-based. It describes the input and output types, but also their constraints, and how to interpret the output. That was necessary, and if more languages are targeted, this is even more necessary.

I feel like WebIDL is both complex, and insufficient.

Another thing that I don't necessarily get is why such a description language was designed specifically for WebAssembly.

Instead, we could have (yet another) way to describe APIs and how to encode that description. That description can then be included in ELF libraries, in Java objects, in WebAssembly modules, whatever. You know, like, what debuggers already use.


We are exploring using Wasmer as a scripting/modding platform in the Amethyst game engine: https://github.com/amethyst/amethyst/pull/1892




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: