let of_native_substring x ~offset ~length = if length = 0 then return "" else try return (String.sub x offset length) with e -> fail `out_of_bounds