I think it would be neat if WebAssembly were embedded in other languages, like it is in JavaScript now. For example, suppose Python had a WebAssembly engine. I bet that could replace a lot of C extensions, and it would be as portable/universal as pure Python code, so no need for C compilers, OS-specific binary packages, etc.
While this would supplant "C for speed" libraries, it wouldn't supplant "C for OS access" libraries. At some point, system code needs to call the OS.
WebAssembly is more than the web
51–60 of 83 posts
Re: WebAssembly is more than the web
#52I'm also excited about this aspect of WebAssembly, but interoperability will hard without a well-defined ABI. There are only four types in wasm: int32, int64, float32, and float64. Anything other than that needs to be encoded somehow, either as multiple values or in memory. For example, say you want to pass a 16-byte struct as an argument: how do you do it? Do you store the struct in memory and pass an int32 pointer…
You can't directly address and manipulate a single byte in WASM?
Re: WebAssembly is more than the web
#53Earlier quoted context omitted.
> WebAssembly isn't just a cross platform technology, it's also a way to target platforms that are currently walled gardens. Being able to run software on e.g., the iPad without paying Apple's 30% fee and being able to ship features / bug fixes without added delays is a big deal. Apple still control what API you can use in their mobile browser, and it's not like they are at the forefront when it comes to implementing…
Sure, that's certainly a factor. But there's a large class of applications that can get by with the API that is available. I'm not suggesting it's a way to build mobile applications without paying Apple. I'm suggesting it will be possible to deliver a product to (nearly) all platforms using 1) a single codebase and 2) bypassing walled gardens. Personally I won't build products for an App Store anymore. They're too re…
Meanwhile I will keep my sandboxes.
Re: WebAssembly is more than the web
#54Earlier quoted context omitted.
While this would supplant "C for speed" libraries, it wouldn't supplant "C for OS access" libraries. At some point, system code needs to call the OS.
Not all OS were or are written in C.
Re: WebAssembly is more than the web
#55I'm also excited about this aspect of WebAssembly, but interoperability will hard without a well-defined ABI. There are only four types in wasm: int32, int64, float32, and float64. Anything other than that needs to be encoded somehow, either as multiple values or in memory. For example, say you want to pass a 16-byte struct as an argument: how do you do it? Do you store the struct in memory and pass an int32 pointer…
> There are only four types in wasm: int32, int64, float32, and float64. You can't directly address and manipulate a single byte in WASM?
Re: WebAssembly is more than the web
#56This is technically web, but not in the way you might think. We (Cloudflare) are working on providing WASM support in our Workers [1] product that lets you run code in our 155 data centers around the world. WASM is great because we can run it in V8 isolates which are much lighter weight than containers or full VMs. [1] https://cloudflareworkers.com
What are the security implications here? i.e. the Chrome team, post-Spectre, are assuming that any value in a process' memory is readable by any code executing within that process.
[1] https://github.com/v8/v8/wiki/Untrusted-code-mitigations#san...
Re: WebAssembly is more than the web
#57One thing I am concerned about is startup performance. On my (slow) Chromebook, some of my multi-megabyte WASM files take 10 seconds to compile. Seems we need either faster CPU cores, faster code generation, or some kind of staged JIT compile -- though I guess the latter could be accomplished today with sufficiently clever tooling.
Chrome Canary contains Liftoff, which is about 8x faster on my machine for initial compilation of wasm. I'm assuming it'll be in Chrome 69.
Re: WebAssembly is more than the web
#58I'm also excited about this aspect of WebAssembly, but interoperability will hard without a well-defined ABI. There are only four types in wasm: int32, int64, float32, and float64. Anything other than that needs to be encoded somehow, either as multiple values or in memory. For example, say you want to pass a 16-byte struct as an argument: how do you do it? Do you store the struct in memory and pass an int32 pointer…
> For example, say you want to pass a 16-byte struct as an argument: how do you do it? Do you store the struct in memory and pass an int32 pointer to its start address? Or an int64 pointer? Maybe you encode it as two int64s? Once you've made a choice, good luck calling functions generated by a compiler that made a different one! Sounds like every architecture ever? There’s an architecture specification and then there…