From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=AWL,SPF_FAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 978CABBC4 for ; Thu, 5 Mar 2009 09:59:54 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiUIAKUjr0lQRFuwX2dsb2JhbACUdxcLCgQUwkuECAY X-IronPort-AV: E=Sophos;i="4.38,305,1233529200"; d="scan'208";a="36121828" Received: from furbychan.cocan.org ([80.68.91.176]) by mail4-smtp-sop.national.inria.fr with ESMTP; 05 Mar 2009 09:59:54 +0100 Received: from rich by furbychan.cocan.org with local (Exim 4.63) (envelope-from ) id 1Lf9Qk-0006eC-3H; Thu, 05 Mar 2009 08:59:50 +0000 Date: Thu, 5 Mar 2009 08:59:50 +0000 To: Pal-Kristian Engstad Cc: Jon Harrop , "caml-list@yquem.inria.fr" Subject: Re: [Caml-list] stl? Message-ID: <20090305085950.GA24055@annexia.org> References: <91a2ba3e0903031340wcdc976cp52522eb35f7ccb73@mail.gmail.com> <200903042250.36421.jon@ffconsultancy.com> <49AF0C3D.2030009@naughtydog.com> <200903050131.03494.jon@ffconsultancy.com> <49AF35B8.9030104@naughtydog.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <49AF35B8.9030104@naughtydog.com> User-Agent: Mutt/1.5.13 (2006-08-11) From: Richard Jones X-Spam: no; 0.00; stl:01 2009:98 wrote:01 caml-list:01 data:02 pal-kristian:03 engstad:04 size:95 layout:05 extension:06 wed:06 prerequisite:07 red:92 cases:08 i'm:09 On Wed, Mar 04, 2009 at 06:15:20PM -0800, Pal-Kristian Engstad wrote: > Have you ever tried to conform to a specific memory layout? We are often > talking directly to hardware, and in those cases it is a prerequisite to > be able to produce data that is in the exact format prescribed. Often > these things are, put an 17-bit ID followed by a 3-bit CODE followed by > a 12-bit LENGTH field, after which follows LENGTH items each of size > that is some-function-of CODE. This is the sort of thing that OCaml-bitstring might be adapted to do. Now I'm not going to claim that bitstring does this already, because there is no way it's currently as fast as C/C++ (it involves a copy for a start). But a similar language extension might make it possible. http://code.google.com/p/bitstring/ Rich. -- Richard Jones Red Hat