
Bringing Fixed-Width Integers to OCaml - eatonphil
http://blog.eatonphil.com/2015/06/12/bringing-fixed-width-integers-to-ocaml/
======
rwmj
Yikes. The writer should probably learn about "noalloc", else those calls to C
are going to be _very_ slow. Also he should have a look at the Bigarray module
and the implementation of the ocaml-bitstring primitives.

[http://camltastic.blogspot.co.uk/2008/08/tip-calling-c-
funct...](http://camltastic.blogspot.co.uk/2008/08/tip-calling-c-functions-
directly-with.html)

[https://code.google.com/p/bitstring/](https://code.google.com/p/bitstring/)

Edit: I'm also dubious about the purpose of this exercise. What's wrong with
binding an existing C library? The C library likely represents man-years of
work (I know HTTP/2 is new, but still), and will be far less buggy than
anything you can write in OCaml in a reasonable time, and those benefits keep
on accruing to the C implementation in future. And OCaml makes it real easy to
write efficient bindings to C, including direct calls - see link above - and
manipulating C pointers directly.

------
rdc12
So that overflow example, is undefined behaviour. Probably not a great thing
to introduce into OCaml types.

