ColinEberhardt / wasmweekly

Website for the WebAssembly weekly newsletter
http://wasmweekly.news/
Creative Commons Zero v1.0 Universal
74 stars 11 forks source link

Console utility written by hand in raw WebAssembly (WASI) #58

Closed ghost closed 3 years ago

ghost commented 3 years ago

I believe that we underestimate the ability to write WebAssembly applications using low-level assembly language, from my point of view, when generating WebAssembly modules, people do not feel the spirit of this virtual machine, so I decided to close this gap.

First just figured out the wat text format and how to use wabt and described it on my GitHub gists ([1]). After that, I implemented a full-featured example of a console application to operate in two input modes - interactive and non-interactive. Also made the input processing function interchangeable, out of the box it is echo, reverse echo and numeric factorial, also was published on my personal GitHub gists ([2]).

[1] https://gist.github.com/dulanov/1cafcbd5cff229c89fb9d0962ae7c428 [2] https://gist.github.com/dulanov/9cff478d17d4feb755d8f22b2bafd083

Similar attempts - Raw WebAssembly demos, A Bare-Metal Intel 8086 Emulator Written In Raw WebAssembly.

FYI, can be also included in weekly letters: https://binji.github.io/wasmsummit2021-talk/