Live data from Hacker News

WebAssembly from the Ground Up

wasmgroundup.com

21–30 of 61 posts

Re: WebAssembly from the Ground Up

#21
post #9

Hi HN! Co-author of the book here, happy to answer any questions you have. Beyond the sample chapters which are linked from the landing page, we also have a couple blog posts which may be interesting: - A WebAssembly Interpreter: https://wasmgroundup.com/blog/wasm-vm-part-1/ - An older blog post, "A WebAssembly compiler that fits in a tweet" ( https://wasmgroundup.com/blog/wasm-compiler-in-a-tweet ), was also on HN e…

Does it cover tail calls?

Edit: changed slightly to provide a more useful answer.

No, it doesn't — not this version of the book at least. We only cover WebAssembly 1.0.

That said, as my co-author says below, there's really not much to tail calls. Once you've worked through the book, you'd be able to grok tail calls pretty quickly.

As an aside — 2.0 was announced just a few weeks after we launched the book, and 3.0 a few months ago. And with 3.0 (which added tail calls), the spec has more than doubled in size vs 1.0, so it would be hard to cover everything.

We've talked about doing a new chapter to cover some of the interesting parts of 2.0 (e.g. SIMD), but covering everything in 3.0 (garbage collection, typed reference, exception handling, tail calls…) feels almost like an entire 2nd book!

Re: WebAssembly from the Ground Up

#23
post #21

Earlier quoted context omitted.

Does it cover tail calls?

Edit: changed slightly to provide a more useful answer. No, it doesn't — not this version of the book at least. We only cover WebAssembly 1.0. That said, as my co-author says below, there's really not much to tail calls. Once you've worked through the book, you'd be able to grok tail calls pretty quickly. As an aside — 2.0 was announced just a few weeks after we launched the book, and 3.0 a few months ago. And with 3…

Co-author here.

if you are interested in tail calls you just need to understand the call instruction which we cover in the book and then replace it with either:

- return_call , the tail-call version of call

- return_call_indirect , the tail-call version of call_indirect

More info here: https://github.com/WebAssembly/tail-call/blob/main/proposals...

Re: WebAssembly from the Ground Up

#24
post #11
post #9

Hi HN! Co-author of the book here, happy to answer any questions you have. Beyond the sample chapters which are linked from the landing page, we also have a couple blog posts which may be interesting: - A WebAssembly Interpreter: https://wasmgroundup.com/blog/wasm-vm-part-1/ - An older blog post, "A WebAssembly compiler that fits in a tweet" ( https://wasmgroundup.com/blog/wasm-compiler-in-a-tweet ), was also on HN e…

It looks good! I may pick up a copy. Besides the convenience, why do you recommend your book over reading the WASM spec as you implement your basic compiler? I find that WASM has a beautifully readable spec. One of its best features! Either way, I’ll likely buy a copy to support the hard work on a piece of tech that I am very fond of

> I find that WASM has a beautifully readable spec. One of its best features!

Disclaimer: I'm one of the guys whose face is advertising this book, as someone who bought the early access version and loved it enough to help a bit with proofreading.

I'm a self-taught programmer who essentially started from the lowest level with Z80 assembly on the TI-83+. I just wanted to know how to fit the bytes together directly without dealing with the rest of the toolchain.

I've tried reading the spec multiple times and what it revealed to me is that my lack of formal training in the subject matter is really holding me back here. I feel like I can follow 90% of it, but that doesn't matter really. It's the remaining 10% I don't understand that does.

The spec is written as a reference and gives you all the pieces, but doesn't really do a great job at fitting all the pieces together.

Everyone I know who does have some relevant background to compiler writing agrees with you though. So I think that for them it's obvious how to fit the pieces together.

Speaking for myself though, this is the first book that made the bytecode "click" as a whole.

Having said that, I think this book and the spec together are the real combo to go for. The book covers the core, and understanding that foundation makes all the extensions easy to grasp from spec alone.

Re: WebAssembly from the Ground Up

#25
post #12
post #11

Earlier quoted context omitted.

It looks good! I may pick up a copy. Besides the convenience, why do you recommend your book over reading the WASM spec as you implement your basic compiler? I find that WASM has a beautifully readable spec. One of its best features! Either way, I’ll likely buy a copy to support the hard work on a piece of tech that I am very fond of

Doing is a far better way to learn than just reading.

[deleted]

Re: WebAssembly from the Ground Up

#26
post #12
post #11

Earlier quoted context omitted.

It looks good! I may pick up a copy. Besides the convenience, why do you recommend your book over reading the WASM spec as you implement your basic compiler? I find that WASM has a beautifully readable spec. One of its best features! Either way, I’ll likely buy a copy to support the hard work on a piece of tech that I am very fond of

Doing is a far better way to learn than just reading.

And is there anything you’ve done that has helped you learn WebASM?

Re: WebAssembly from the Ground Up

#27
post #5
post #2

I like PHP because it allows access to core system calls on any platform. I see runtime interpreters as constraining when a system call is needed, but proscribed.

You don't want to use PHP (a server-sided language) to solve a client-side problem.

I know a person who wrote Linux X Desktop Environment using PHP. Worked for them. It is general purpose programming language.

Re: WebAssembly from the Ground Up

#29
post #22

What's the state of wasm for porting multi-process code? I want to run something that execs a command line tool, both in the browser. Doable yet?

most of that is happening above the WebAssembly spec: https://wasi.dev/

More specifically for command line tools:

- https://wasi.dev/interfaces#presentation

- https://github.com/WebAssembly/wasi-cli

Re: WebAssembly from the Ground Up

#30
post #22

What's the state of wasm for porting multi-process code? I want to run something that execs a command line tool, both in the browser. Doable yet?

most of that is happening above the WebAssembly spec: https://wasi.dev/ More specifically for command line tools: - https://wasi.dev/interfaces#presentation - https://github.com/WebAssembly/wasi-cli

Is wasi .3 still planned to finish soon like the roadmap said? so wasi 1.0 is the the next goal?

wasi 1.0 feels like when it will take off after all these years of dev

timeline at the bottom of this page: https://wasi.dev/roadmap

Post reply on HN