Hi Tobias,
it may be better to look at an example. For instance, to train my SQB classifier:
model = SQBMatrixTrain( featureMatrix, labelVector, maxIters, options )
where featureMatrix and labelVector are matrices (2-dimensional) and vectors (1-dimensional), maxIters is a uint32 and options a structure of the form:
options.<something> = value, where value may be a uint32, string, array, etc.
Lastly, "model" is an array of structs, where each struct also contains arrays in some of its members.
In this case most types/structs are known at compile-time, except for the length of featureMatrix, labelVector and model.
(and in the future may be the size of some arrays inside the structures of the array model may as well vary).
Wrapping such call in Julia with ccall seems overly complicated to me.
About structs, I can declare an immutable struct in Julia and do the exact equivalent in C, but I fear that at some time
I can mess up the order or types, and I have no way (AFAIK) of knowing if I made a mistake from the Julia or C side.
I would get garbage, or hopefully a segfault.
On the other hand, if I write some general wrappers for Julia, I could check whether the passed Julia type is an array or type
of struct I am looking for, check if a struct has field 'name' of type 'type', etc. I think this is a great advantage.
Once something like this is written, modifying structs is straightforward, and if an error happens, I can know what is happening.
Does this make sense? Or am I missing something fundamental from ccall's design?
Thanks.