This great! Looks like there's still a bit of a gap wrt passing arguments; like the snippet above does. After skimming the chapter on ffi as well, there appears to be the need for a bit of experimentation (for me/a novice) to get that to work (eg: passing in a string, getting it back reversed, or as a list/array of unique characters/glyps etc).
I'll have a look when I find the time - but this is a great start!
Yeah, things like "what do I do about more complex types" needs tons of more docs in general. We will get there. I'm also pretty convinced that a dedicated individual could create pretty awesome automatic binding generators for any language, especially since bindgen works pretty well for C... but we'll see how it shakes out.
Don't hesitate to email me or post in the forums if you play around with this and get stuck :)
I'll have a look when I find the time - but this is a great start!