inspeired by this article uses zig to create zig bindgens for c++
zig cc -x c++ -std=c++11 -Xclang -ast-dump=json {input_file}
zig in your PATH, you will need the version 0.13 and upc2z executable from zig-out to your desired locationzig build run -- ARGSzig build run -- lib.h or c2z lib.hzig build run -- -DNDEBUG -I.\include -target x86-linux -- .\include\lib.hcpp.zig it is located in the src foldermsvc has a second tier support, just pass it as target tuple like as: -no-glue -target x86_64-windows-msvc to generate a target specifc binding for it. Debug builds aren’t fully supported, use ReleaseFast or at least -O1, you might also wan’t to find a way of define _ITERATOR_DEBUG_LEVEL to something different than 2.transpile inline or constexpr constructors when the class isn’t polymorphic
use function pointers to handle varidact functions
(hard) #include -> @import
(easy) walk a directory tree
transpile vector of vectors
(easy) better input file not found error
(easy) verbose option
(easy) handle BlockCommandComment and ParamCommandComment in FullComment
(easy) resolve return of function with a aliased return type
(easy) fail when clang ast-bump has failed, because missing headers or wrong code
(hard) if (*data++ == v) { ... } should generate { const __tmp0 = data; data += 1; if (__tmp0.* == v) { ... } }
(hard) solve UnresolvedMemberExpr, maybe when integrating clang ast directly
(hard) solve implicit destructors calls
(easy) handle private members, class is default private, struct default public, in code is referenced as self.public
(hard) handle varidact functions myFunction(va_args) -> myFunction(args: [*c]u8) and myFunction__VA(...)
(hard) apply keywordFix
use @compileError for objects that couldn’t be transpiled
write layout tests