[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#479152: ITP: core -- Jane Street Capital's alternative standard library for OCaml



On Mon, May 05, 2008 at 12:41:36PM +0200, Stefano Zacchiroli wrote:
> On Mon, May 05, 2008 at 11:32:46AM +0200, Sven Luther wrote:
> > I don't even know what this bin-prot thingy does, do you have a link or
> > something to an explanation ?
> 
> It provides support for type-safe serialization of OCaml types.

Like the marshall module of the standard library ? 

> Serialization/deserialization functions are generated on the fly using
> camlp4 out of the type declaration, using the "with bin_io" modifier.
> E.g.:
> 
>   type foo = Foo with bin_io

Ok.

I guess that to give a sound advice, i need to look at the code and what
is exactly done.

> The quickest pointer to understand what is this about is the README
> contained in the distribution tarball. The latter is available at
> http://ocaml.janestcapital.com/?q=node/13 .

The README.txt says : 

  Currently only little endian (2) computer architectures are supported.
  Some architectures may potentially also suffer from data alignment
  issues with this library. Only Intel architectures are currently
  well-tested. Both 32bit and 64bit architectures are fully supported.

Which basically explains the problematic we are faced.

On powerpc, there are asm instructions which allow to do the conversion,
either separatedly, or while loading/storing data. I suppose that this
kind of instructions are available for other big endian arches too, so
the less costly way to do this, is to use those instructions on a per
arch basis.

But this asks the question of how well integrated into ocaml this module
is, and how we can do direct asm calls with the less overhead in ocaml,
ideally this should be added at the native code generation level, but i
don't think ocaml has this kind of functionality right now.

I will try to find some time to find out more, or alternatively, we can
discuss in live at some time in paris ? I ill be around paris half of
may and most of june.

Friendly,

Sven Luther


Reply to: