Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Writing Hello World in Web Assembly (2017) (wa9ace.net)
148 points by WA9ACE on June 7, 2019 | hide | past | favorite | 15 comments


Interesting to compare this to the Hello World that's now possible with WASI and its fd_write function:

https://github.com/CraneStation/wasmtime/blob/e530a582afe6a2...


Here is the Hello World example for WASI in headerless C using clang. A little bit more code but also more general.

https://gist.github.com/s-macke/6dd78c78be46214d418454abb667...


slen() returns 1 more than it should, or is it meant to include the '\0'?


Yes, you are right. This function should behave as the ordinary strlen function. Fixed.


Thanks for this, I hadn't seen it before. That example is much better commented and documented than mine.


It's always nice to see a blog that doesn't have ads or even a Google tracking snippet. :)


It is, so I sent him some BAT.


Thank you, I appreciate it!


Same. Sent you some as well. Nice writeup.


https://basicattentiontoken.org/ for anybody else wondering


Seems like Web Assembly is one of those things that's changing so fast that a 2 year old article is probably already outdated. Is this still relevant?


The article describes WebAssembly at a low level and use the assembly language wast. Therefore, it is still relevant if you want to understand WebAssembly at this level. The specification has not changed in the last 2 years.

However the tooling around WebAssembly changed a lot. E. g. the compilers start to fully support the wasm target.


Man that is an extremely ugly language. Is this supposed to convince people to use it? Who’s designing this language?


It’s mostly a target for other things to compile to. (The hint is in the name.)


I don't think the poster you're replying to was serious, rather they were trying to make a joke (which I agree does not add anything to the conversation, however).




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: