Added gtype conversions for cgo. #1
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adding support for converting parameters and passing these to C++ functions.
I should also add a more lean API for using the library from pure C (this might be horrendous and require implementation from the gobind side, with access to the headers and parsing those).
So the idea is to convert
GTypeto a Golang type and cgo type for interacing with C native types.Later we can support Structs that contain native types.
We can bypass any ABI compatibility issues, by retaining pointers to each member of a struct upon registration.
And then construct the struct using the same order of members specified.
(for this some kind of caster function would need to be made).
(this is not ideal, so another way must be found).
The development should be in baby steps, and soon we will need to do TDD for the entire pipeline to detect any anomalies since we are deep in ABI messing around territory.
For example I was curious how default parameters work in C++ and apparently the compiler just inserts the default argument at the call site of the function.
So if this is not encoded you get undefined behavior/unitialized data.
So safe to say we need to find a way to register default arguments.
The
GobindModulestruct is really starting to look like an AST slowly but surely.