use a native binding instead of FFI hackery