implement ffi (dynamic libraries)