On Fri, Sep 27, 2013 at 2:15 PM, Paolo Donadeo <p.donadeo@gmail.com> wrote:
Many bindings deal with memory allocation. The binding of Lua deeply
interacts with the garbage collector and inspects the actual type
(tag) of OCaml value passed.

In principle you are right but the reality is that there is no much
"abstraction" in C :-)

It's true that coming from the C side, abstraction is a problem. However, the kind of bindings you're describing (Lua) essentially inhibit any improvement to the GC (such as parallelization, which is bound to happen some day) or to the runtime. It seems like it would be much better if bindings from C (Lua, for example) called more general functions or bindings present in the runtime's C code aka an API. Given that it seems like some bindings currently don't use an API but inspect values closely, I don't see any solution other than adapting the things that require changes. Hopefully the majority of C bindings (at least from the ocaml side) can be moved to ctypes, and can therefore be made more generic.

-Yotam