use OCaml primitives to serialize ints