howto-wasm-minimal

Dev tools

wasm build tutorial

SHOW HN2022

217points
42comments
#252of 2,570 in 2022
Top 10%of 2022 by points

How HN took it

CuriousMostly questions and neutral comments

1 positive, 7 neutral or asking, 0 mixed, 4 critical, out of 12 comments about the project. Thread score -0.18.

Execution: 0 for, 2 againstPerformance: 0 for, 1 againstIdea: 1 for, 0 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Good resource for compiling without Emscripten

    From 2 comments
    • These are also good resources on using wasm without dependencies: https://depth-first.com/articles/2019/10/16/compiling-c-to-webassembly-and-running-it-without-emscripten/…
      bla3 on HN
    • See also my example I put together some time ago: https://github.com/PetterS/clang-wasm At the time, I could not find something like this online. It's fun to write your own…
      petters on HN

Objections

  • Gray conversion uses simple average instead of luminance weights

    From 2 comments
    • directly when reading this code I cannot help myself but to get into review-mode. It is an awesome example, which i will probably use myself one day. However... inc.cpp:27 Gray…
      dosshell on HN
    • For future readers, this is the code that is being referred: https://github.com/ern0/howto-wasm-minimal/blob/master/inc.cpp#L31-L35 It should be: ``` uint32_t gray = 0.299 *…
      syrusakbary on HN
  • Declaring memory as uint8_t instead of array is non-idiomatic

    From 1 comment
    • This is really cool! I never looked into WASM before, I'm really happy to see it's not that difficult to build a simple example like this. One thing that's bothering me about…
      moefh on HN

Requests

  • Zero-copy canvas access from C code

    From 1 comment
    • (Obligatory:) Neat! Still, a lot of copying bits around, and more JS than one might hope for. Could you send a pointer to canvas into the C code and operate on it in a direct,…
      drfuchs on HN
  • Support for compiling third-party C/C++ libraries

    From 1 comment
    • This looks good! In my experience the hardest part for compiling WebAssembly is third party dependencies. Getting arbitrary libraries to build can be rather challenging.
      melony on HN

Questions

  • How to compile Rust code to WASM without wasm-pack

    From 1 comment
    • Very cool! I've been desperately looking for something similar for Rust. I'm too old for all these magic frameworks and "deployers" :-) I have some Rust code, possibly linking in…
      gspr on HN
  • Is there a similar example for plain C

    From 1 comment

Alternatives named

  • Emscripten

    From 2 comments
    • Pedantically, it might even be undefined behaviour (not sure, maybe a point of contention, similar to container_of macro). It's unlikely to cause problems, but the way you…
      jstimpfle on HN
    • See also my example I put together some time ago: https://github.com/PetterS/clang-wasm At the time, I could not find something like this online. It's fun to write your own…
      petters on HN
  • wasm-pack (Rust)

    From 1 comment
    • I made some emulators in Rust as a learning project during the start of the pandemic, and ran into the exact same issue when I wanted to make a wasm version to run in a browser.…
      aquova on HN
  • wajic

    From 1 comment
    • Since I haven't seen it mentioned in the comments yet, here's another interesting project in the general area of "WASM without Emscripten": https://github.com/schellingb/wajic…
      flohofwoe on HN
  • WebAssembly Studio

    From 1 comment
    • Do you know https://webassembly-studio.kamenokosoft.com/ ? I don't know if it compiles in the browser or on a server.
      randomsilence on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/30991235)