Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Nice video but (unrelated to the IDE) in order to use a printf from js it was necessary to: provide a js emulated syscall to c file that calls another c function that calls back to js again


Yeah, it’s super weird when most people are expecting this to compile into JavaScript running in a browser. Nevertheless, to be fair, this isn’t a C, C++, or Rust to JavaScript compiler-compiler it’s a C, C++, or Rust compiler that targets WebAssembly. I realize this might read as overly pedantic but it explains why it makes sense to the implement the C interface. It’s also a reasonable optimization pass for a mature compiler when it knows that you’re targeting WebAssembly running in a browser.




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

Search: