haxscramper / hcparse

High-level nim bindings for parsing C/C++ code
https://haxscramper.github.io/hcparse-doc/src/hcparse/libclang.html
Apache License 2.0
37 stars 2 forks source link

Automatically generate boilerplate code that makes wrappers easier to use #10

Open haxscramper opened 2 years ago

haxscramper commented 2 years ago

``` Feel free to comment on this issue with extra ideas It is intended to be used as a place to collect all potentially useful suggestions, even though some of them might be harder to implement. ```

Configuration for more sophisticated wrapper logic. A lot of additional information that is not accessible even to the C compiler (like magical int returns values) that should be handled. Previous clang-based implementation allowed passing a series of callbacks for automatically altering generation and handling of the code, but this must be generalized for tree-sitter as well.

In addition to regular source code enhancement features, it is also possible to automatically generate .nimble project files that would automatically handle installation/build and other project-related parts of the process. Similar to the https://github.com/nimterop/nimterop#build-api, but again, without the need to depend on the hcparse run/compile-time framework. An alternative solution would be to put all of this logic into a small no-dependency package and make all generated wrappers depend on this. Basically, I want to decrease 'bus factor' of the generated wrappers as much as possible. Ideally, I should be able to make build and installation of the wrapped library optional. Related - https://github.com/nim-lang/RFCs/issues/398 and #11

haxscramper commented 2 years ago

Make wrapper analyze build environment to provide necessary information for a wrapper to function properly or fail

Directly related - https://github.com/nim-lang/RFCs/issues/414

Technically I'm aiming to produce a wrapper, not drag the whole build system together with me, so #20 is related