Live data from Hacker News

WebAssembly architecture for Go

docs.google.com

31–40 of 71 posts

Re: WebAssembly architecture for Go

#31
post #29
post #27

Earlier quoted context omitted.

WebAssembly can be used anywhere. It is not tied to JavaScript in nature. So think of it kind of like the JVM in a way (but it's not an implementation, just a spec).

So people are using wasm in a non web context ?

Yes. Not a ton of people (yet), but yes, some are.

Re: WebAssembly architecture for Go

#32
What kind of WASM file sizes can we expect? I know some work has gone into shrinking Go executables, especially in 1.7, but will we be able to produce something like the 15KB Rust Hello World WASMs? Go has a fantastic stdlib but it hasn’t prioritized web optimized file sizes (yet).

I’m looking forward to the results of this work!

Re: WebAssembly architecture for Go

#33
post #31
post #29

Earlier quoted context omitted.

So people are using wasm in a non web context ?

Yes. Not a ton of people (yet), but yes, some are.

but why, if you have plenty of good languages to do this? Wasm is good for browsers because only choice we have is js.

Re: WebAssembly architecture for Go

#34
post #27

Earlier quoted context omitted.

>non-JS WASM backend ...what's a non-js wasm backend?

WebAssembly can be used anywhere. It is not tied to JavaScript in nature. So think of it kind of like the JVM in a way (but it's not an implementation, just a spec).

but i'm asking what are some webasm languages/backends/use cases that aren't a JS interpreter?

Re: WebAssembly architecture for Go

#35
post #9

So when they say, it generates a big switch statement, do they generate this big switch statement for whole program or for individual functions which takes enough context to continue at at point where it yielded?

Speculating, but it sounds to me like it's within individual functions. Go's program counter is "[split] into 2 parts: PC_F and PC_B. PC_F is the index of the function to be executed. PC_B is the index of the basic block to be executed."

Re: WebAssembly architecture for Go

#36

> Go’s garbage collection is fully supported. WebAssembly is planning to add its own garbage collection, but it is hard to imagine that it would yield a better performance than Go’s own GC which is specifically tailored to Go’s needs I don't think it's hard to imagine reading the GC proposal. The JS collector that might be reused could be off thread, something WASM can't (yet) do. > Most file system operations are ma…

> WASM has fairly strict stack/frame rules/types, so arbitrary gotos wouldn't work. kinda funny because golang follows the same idea.

So I am curious how the presence of them in WASM would help

Re: WebAssembly architecture for Go

#37
post #29
post #27

Earlier quoted context omitted.

WebAssembly can be used anywhere. It is not tied to JavaScript in nature. So think of it kind of like the JVM in a way (but it's not an implementation, just a spec).

So people are using wasm in a non web context ?

Yup: https://github.com/cretz/asmble

Re: WebAssembly architecture for Go

#38
post #27

Earlier quoted context omitted.

WebAssembly can be used anywhere. It is not tied to JavaScript in nature. So think of it kind of like the JVM in a way (but it's not an implementation, just a spec).

but i'm asking what are some webasm languages/backends/use cases that aren't a JS interpreter?

See http://webassembly.org/docs/non-web/. Portability. For example, I can use Rust on the JVM: https://github.com/cretz/asmble/tree/master/examples/rust-re...

Re: WebAssembly architecture for Go

#39
post #31

Earlier quoted context omitted.

Yes. Not a ton of people (yet), but yes, some are.

but why, if you have plenty of good languages to do this? Wasm is good for browsers because only choice we have is js.

WASM can be good for other things too. It is portable and fairly easy to target. It's like asking "why emscripten of you have plenty of other languages to choose from, LLVM is good for executables"

Re: WebAssembly architecture for Go

#40
post #28

The main benefit of using the Web Assembly GC is not improved performance within the language, but rather having a single GC that handles both native DOM objects and language objects. Having two GCs interoperate is a big pain, and it's very difficult to pull off without leaks or performance problems. This is especially true for DOM objects, which have no user-visible finalizers. (The closest thing is WeakMaps, but I…

In Chrome today, as an example, the C++ based DOM and V8 (Javascript ) objects are using different GCs. Obviously it is a pain point, but the situation of having different GCs for DOM and language objects is not new with Web Assembly.

I mean, as of Oilpan the V8 garbage collector marks C++ objects by calling trace hooks, as I understand things. That isn't an option for Web Assembly, which doesn't have access to the V8 garbage collector in that way (except via the wasm GC proposal; in fact, that's fundamentally what the wasm GC proposal is).
Post reply on HN