witx-codegen icon indicating copy to clipboard operation
witx-codegen copied to clipboard

Add an expermental alternative cpp backend

Open sonder-joker opened this issue 3 years ago • 2 comments

A implementation of cpp (need c++17). Wish to get a review! The generated cpp.h pass the clang-tidy check.

sonder-joker avatar Sep 19 '21 11:09 sonder-joker

  • I wish to add namespace in different module #10 . So I wish if you can help me to finish it!
  • Also I wish if you can help me check the layout of struct/union in generate file. I don't sure I have make some stupid mistake.
  • Some of inspired by wasi-libc's tool but it have abi change in wasi-crypto so I make a simple cpp backend.

sonder-joker avatar Sep 19 '21 11:09 sonder-joker

For current cpp backend I will:

  • [x] Support return result as a Result(rust) like style as return value(also use std::tuple)
  • [ ] Generate different namespace for each module
  • [ ] Adopt LLVM style's code
  • [ ] Support generate multiple files for each module (may not put in thie pull request).
  • [ ] Check the layout with static_assert

sonder-joker avatar Sep 20 '21 08:09 sonder-joker