Hi all,
I'm working on Wasm and its security, mainly tinkering with compilers and programming languages that can compile to Wasm. When I have to explain Wasm and its concepts to a fellow developer, most of the time they struggle to understand the notion of "Wasm local and global variables" and the fact that they are not global or local variables as present in most programming languages. Once they understand, they still assume that Wasm locals and globals are linked in some way to local and global variables in programming language (like supposing that there is a mapping made between programming language global and local variables and Wasm globals and locals that is done at compile time, so that Wasm globals and locals have a direct counterpart in their language. Another common mistake I hear is saying that Wasm local and global variables can only hold "variables" of a programming language, which is of course untrue (e.g. LLVM use a global variable as a "register" to store the stack pointer). These mistakes are exacerbated when communicating by writing, and using not interactive means (like a blog post or an article).
This led me to think that I must not be the only one in the Wasm community to have this kind of trouble, and I'm coming here to look for good answers to these problems. Frankly, I'm even thinking that the terms "Wasm global and local variables" were poorly chosen and could maybe be changed. I'm hoping this topic is of interest not only for me be also for a sizable amount of Wasm users. I have a list of questions to propose, and I'm happily taking any feedback one may give.
- Do you already had trouble / confusion when explaining Wasm local and global variables ?
- How do you proceed to explain these clearly and avoid the confusion ?
- Did you already think that the "global and local variables" terms were poorly chosen ?
- If yes, do you think these terms should be changed ? Do you have ideas ?
Thanks for all your answers, and happing Wasming !