testnet icon indicating copy to clipboard operation
testnet copied to clipboard

add C/C++ guide

Open poemm opened this issue 6 years ago • 7 comments

poemm avatar Dec 06 '18 23:12 poemm

Wow, you guys are lightning quick!

poemm avatar Dec 06 '18 23:12 poemm

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.)

axic avatar Dec 06 '18 23:12 axic

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 avatar Dec 07 '18 00:12 poemm

@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?

lrettig avatar Dec 28 '18 20:12 lrettig

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.

poemm avatar Dec 28 '18 22:12 poemm

Did anyone try following the steps in this doc? Would be nice to have at least one confirmation that it works.

poemm avatar Dec 28 '18 22:12 poemm

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.

poemm avatar Jan 03 '19 13:01 poemm