I really doubt there will be any problem with licensing it with
the MIT license.
If there is a macro/function `@member struct_ptr member_name` and
`@member struct_ptr member_name=value`, that uses the pointer directly,
is fast, that might be a perfect solution, in the sense that other
options are not really needed for performance. If `Ptr{Something}` with
`isa(Something, CompositeType)` worked that way automatically, there
wouldn't even be a need to do anything on the FFI side.
Before i knew of strpack.jl, the idea was to generate a C file with
getters and setters, and compile and FFI that aswel. The behavior is
similar, but it seems convoluted.(`ccall`s are cheap though, right?)
None of that handles ownership, for that, i suppose you could put the
pointer into some object something, and possibly add a destructor. (If
nothing really needs to be done, `free` should suffice.) Possibly there
are reasons to want that in the autoFFI(I dont see them), but i think
that is a later concern, and somewhat goes along with wanting hooks
into the stuff. Like the current `fun_namer` hook that lowercases the GL
function names. But the 'customization' stuff is there because it aughto
be there, probably very plain FFI just extended with regular Julia in a
separate package keeps things more predictable.
Veering offtopic a just bit, the `@member` macro would perhaps be nice
to put on `.` instead, then you can write `struct_pointer.member_name`
as usual. In general i worry about setters-and-getters. Possibly
they'd make different conventions, and they'd make getters and setters
for members of `CompositeType`s aswel.. Allowing people to just put
them on `.` might be nicer. However, people would have to be trusted
that they dont break the concepts behind it though.. Imo not sufficient
reason not to do it.
Off topic some more, CL has setf-functions that are a bit more general
yet, the 'setf and setf-functions' section about that here
https://github.com/JuliaLang/julia/wiki/common-lisp-rosetta-for-the-devs
I put an untested macro on how you might get that in Julia in the
attachment. On the one hand, how `ref` and `assign`(which is basically
exactly that) works demonstrates there are uses, on the other hand, i
dont see another use at this point.