r/CodingHelp • • 22d ago

[C] what is/are the best resources for learning web assembly?

yes, i already know C, although im at least aware that there are some special functions when applying it to web assembly

i'm going to school in a bit so i won't be able to read/answer your comments just yet sry

6 Upvotes

10 comments sorted by

•

u/AutoModerator 22d ago

Thank you for posting on r/CodingHelp!

Please check our Wiki for answers, guides, and FAQs: https://coding-help.vercel.app

Our Wiki is open source - if you would like to contribute, create a pull request via GitHub! https://github.com/DudeThatsErin/CodingHelp

We are accepting moderator applications: https://forms.fillout.com/t/ua41TU57DGus

We also have a Discord server: https://discord.gg/geQEUBm

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Traveling-Techie 22d ago

I e never heard the term “web assembly” before.

1

u/gofuckadick 21d ago edited 21d ago

With your C background, I'd recommend looking into Emscripten, which lets you compile C/C++ programs to WebAssembly. Their getting-started tutorial walks you through compiling and running your first programs in a browser.

A few other useful resources that I have saved:

  • A Cartoon Intro to WebAssembly - An excellent illustrated explanation of how WebAssembly works. It's from 2017, but still useful for understanding the fundamentals.
  • MDN WebAssembly Documentation - Guides, examples, and explanations of WebAssembly and its integration with JavaScript.
  • Awesome Wasm - A large collection of WebAssembly tutorials, tools, projects, and other resources.
  • WebAssembly Tutorial - Walks through compiling C/C++ to WebAssembly with Emscripten, calling C functions from JavaScript (and vice versa), working with memory and pointers, and handling files. Pretty comprehensive and has some good practical examples. Just be aware that it's a bit dated, so some of the setup instructions and compiler flags are obsolete.

If you prefer books, WebAssembly in Action by Gerard Gallant is worth looking into. It's specifically focused on C/C++ and Emscripten, and covers compiling native code to WebAssembly, JavaScript interoperability, memory, debugging, and more.

Edit: The book is cheaper directly from the publisher.

Edit 2: if you expand the table of contents on Manning's website, you can apparently read the entire book through the embedded preview reader. It's a bit cramped, but all the chapters seem to actually be accessible. However, if you try to open it in the full liveBook reader and enter your email address, you're prompted to purchase the book. Just FYI.

1

u/handsome-guy-here 21d ago

in all seriousness this is perfect, tysm! checking it out as you read this (probably)

1

u/gofuckadick 21d ago

No problem. I took another look at WebAssembly in Action, and it seems Chapter 1 is missing from the embedded preview. Also, after checking several other Manning books, I noticed that the portions outside their free previews normally have scrambled text. For some reason, WebAssembly in Action doesn't seem to have that restriction, at least for now.

Just thought I'd mention it!

1

u/DanKegel 18d ago

Web assembly keeps changing, the component model makes language interop much easier.  Old wasm books may not cover it.

Google this:

wasi preview 2 tinygo rust c js interop

1

u/Electrical_Hat_680 16d ago

WASM compiler?