testnet
testnet copied to clipboard
add C/C++ guide
Wow, you guys are lightning quick!
I'd prefer if the two C/C++ documentations could be merged into a single file, because they have a lot common (binaryen, chisel, etc.)
My C/C++ guide is focused on ewasm tips and concrete examples. Perhaps the other one might be an advanced section in my guide.
Feel free to copy whatever you want from mine and close this PR, or push to this PR.
@poemm and I discussed yesterday and I understand that he wrote this doc from scratch and feels that it covers everything covered in #46. I just reviewed them both again and I agree with the caveat that the compilation steps are more explicit in #46, whereas this doc basically says:
make sure to modify the Makefile to clang++, use extern "C" around the helper function declarations. run make
Basically, if the content in Compile C/C++ to WebAssembly could be brought into this doc, or else if it's no longer relevant (@axic said s2wasm was removed), then I think we're good to go with this one instead.
@axic, you suggested you wanted to cherry pick from #46 -- are we good to merge this and then bring anything required over from that one?
make sure to modify the Makefile to clang++, use extern "C" around the helper function declarations. run make
I agree that this is awkward, so I replaced this text with a link to a C++ example.
@lrettig Do you think that we should leave compilation steps in the makefiles, explicitly write compilation steps in the doc, or put compilation steps in both the makefiles and doc? I personally prefer only makefiles, but I trust your judgement.
Did anyone try following the steps in this doc? Would be nice to have at least one confirmation that it works.
Included downloading LLVM 7 from repositories, since LLVM 7 supports Wasm by default, so no need to compile your own. Also put compilation commands in the doc instead of just in the makefile.