Lurker News
Hey HN!

I've been working on a book about WebAssembly over the last few months, and it's finally available at http://levelupwasm.com!
Why a book on WebAssembly you ask? Well... WebAssembly is awesome (obviously ) but it's certainly not the easiest thing to learn. So I wrote this book as a practical intro to using WebAssembly in your web apps.
I would appreciate any feedback!

Comments (88) 32 threads

Earlier comments
langitbiru1 reply#
Congratulations on your book! May I ask why you choose self-publishing road instead of publishing it on publisher? I am not saying one way is better than the other. I am just wondering.

Is it because no interest from the publishers? Or is it because you think the royalty percentage from publishers is too low? Or you don't have any particular reason? It's just feel natural to do self-publishing.
Also, do you hire editors?

raboukhalil#
Thanks! I like to self-publish mostly because I can craft the book in my own way and move faster. I also enjoy being able to touch all aspects of the book, including the design and marketing.

This is actually my second self-published book (first one was about wrangling data on the command line with bash), so it does feel natural to self-publish at this point!

macp3 replies#
Table of contents and sample chapter?

Webassembly for genomics sounds cool :)

raboukhalil1 reply#
Yes! Here's the table of contents: http://www.levelupwasm.com/toc.pdf

And for a sample of the writing, here's the section on compiling the CLI tool jq to WebAssembly: http://levelupwasm.com/sample-jq.pdf (though note that it builds on previous material so it doesn't re-explain everything)
Edit: Also, if you're curious about using WebAssembly in genomics, check out https://github.com/robertaboukhalil/aioli/ and https://github.com/robertaboukhalil/fastq.bio, a tool to get a preview of DNA sequencing quality that uses WebAssembly to speed up the analysis portions.

macp#
Awesome! Thank you.
itimetrack#
A short (or partial) screencast (might grab people... specially if the quality is good.
raboukhalil1 reply#
That's so cool, thanks for sharing! Do you know where I can find more info about how it was built/which portion of the app uses WebAssembly?
rfinney1 reply#
This provides access to hundreds of public and tens of thousands of restricted access cancer genomes (and often the matching "normal" samples): so you can see and visually verify mutations. Interestingly, too, you can check out germline polymorphisms which might predispose someone to get cancer.

Basically all the work is done in the browser : gzip decompression, custom parsing of sequencing alignment, png generation, etc. Lots of data are pushed to the client at load time like gene location information for genome build "hg38" (the latest). Server only provides reference sequence and sample genomic alignment "slices" for the region of interest. So, all the state is handled in the browser, server only provides trivial "wget" requests.
It is mostly wasm (source is C compiled with emcc). The front page is the requisite html/javascript start page. Pages are created in wasm code and pushed to JS for updating the DOM. Lots of calls to emscripten_run_script("your javascript here"). DOM manipulation straight from Rust/Go/C would be cool but it is not here yet.
Upside is server simplicity and security ... and no downloading and setting up complicated software.
https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5987889/
Code is done by the government so it's public domain. (Your tax dollars at work !)

Continue this thread — 1 reply

Accacin#
Intersting, I've been looking into this recently and this might be the thing I need to finally get stuck into it. Pricing seems reasonable, I'm not sure about other comments saying it's a little high.
SCdF1 reply#
Looks cool!

If I don't know any C++ (and never plan to) but am learning Rust, do you think there is value here? Or is really focusing on the C++ -> WASM experience?

raboukhalil#
Thanks! Yes the book focuses on C/C++, but you don't need very much C/C++ knowledge to follow along in the book.

Most of the time, we treat C/C++ libraries as black boxes that we compile to WASM, though in some cases like Pacman, we do have to modify the original code, but you should be able to infer what we're doing from the context and the text.

Load more comments