Hello,
I am new to MDN, so please assist by pointing my request in the right direction if I didn’t post this correctly:
I am trying to learn Webassembly from scratch, and I am making use of a page at MDN entitled " Compiling a New C/C++ Module to WebAssembly", at URL:
https://developer.mozilla.org/en-US/docs/WebAssembly/C_to_wasm
As I am a beginner, I am simply trying replicate the examples given. One of the examples does not behave as expected. How do I get assistance with the page (or otherwise communicate with an expert or page author that can help?)
Here is the specific issue:
Near end of the page, there are instructions that state:
-
Now we need to run our new
myFunction()
function from JavaScript. First of all, open up your hello3.html file in a text editor. -
Add a [
<button>
] element as shown below, just above the first opening<script type='text/javascript'>
tag. -
Now add the following code at the end of the first [
<script>
]element:
These instructions tell me to edit the html file generated by emcc.
This is where I get tripped up:
emcc is generating a .html and .js file which have no line breaks (that is, each file is just a single string of text.)
This makes editing the file as directed impossible.
I found after some experimentation that adding -g2 parameter to emcc command fixes the line break absence. I am a total beginner in this area, so simple issues like this are a hurdle for learning.
This post then is for two issues: (1) flag a possible error in the page (the needed -g2 parameter to emcc), and (2) comment about the page’s usability for a beginner (assumptions made by the page author(s) about the process of editing files as descried.)
Thank you for assistance on either/both front, or advice on where I can go to get assistance on this item.
Dave