At the beginning of any learning process you face a kind of adventure, when you learn a concept like WebAssembly you start a beautiful adventure.
Think like Indiana Jones discovering a new treasure, it's not easy but it's so fantastic. You will learn new tools, concepts and even meet some enthusiasts like you.
First we start by trying to use simple commands, short algorithms and then you can do a little bit more.
I will show how I made my first steps with WebAssembly.
At first I created a file using C language, in this file I wrote code that has as an output a basic operation using " -, +, * and /". The dynamic is, you give the operation and then you can see the result.
After saving my file, I opened my prompt to start the process of compiling.
The first step is to use gcc command
Second, you can use ./a.out to see your output.
Then you will use the "wasicc" command like this:
wasicc YourFile.c -o YourFile.wasm
while executing this command, it might generate some warnings but you can ignore them.
Executing it using WASM Runtime to see it as wasm
This is the result! Cool, isn't?
Of course we fail sometimes, we face some problems, but I was helped by other adventurers. Luckily we are not Indiana Jones and if we failed we don't die in a cave full of poisonous snakes and beetles.
However, we can still enjoy our treasure...
Top comments (0)