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.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 948EDBC0A for ; Thu, 14 Jun 2007 13:52:00 +0200 (CEST) Received: from furbychan.cocan.org (furbychan.cocan.org [80.68.91.176]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5EBpxqk030652 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 14 Jun 2007 13:52:00 +0200 Received: from rich by furbychan.cocan.org with local (Exim 3.35 #1 (Debian)) id 1Hynrr-0008CR-00 for ; Thu, 14 Jun 2007 12:51:59 +0100 Date: Thu, 14 Jun 2007 12:51:59 +0100 To: caml-list@inria.fr Subject: Re: [Caml-list] DSL for handling parsing binary memory structures? Message-ID: <20070614115159.GA3960@furbychan.cocan.org> References: <20070517212157.GA20085@furbychan.cocan.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070517212157.GA20085@furbychan.cocan.org> User-Agent: Mutt/1.5.9i From: Richard Jones X-Miltered: at discorde with ID 46712BDF.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; parsing:01 0100,:01 ocaml:01 alignment:01 bitfields:01 accessors:01 wrote:01 caml-list:01 binary:01 binary:01 structures:02 structures:02 redhat:03 size:95 thu:05 On Thu, May 17, 2007 at 10:21:57PM +0100, Richard Jones wrote: > > I wonder if anyone has thought about or developed a domain-specific > language in OCaml for handling the processing of binary structures? > > I was thinking of writing something to make system calls into the Xen > hypervisor. The main problem is that the hypervisor takes & returns > binary structures which have very precise size / alignment > requirements, bitfields, etc. (and the requirements change with > versions of the hypervisor). It sounds like the ideal use for a DSL > to describe the binary structure of each version of each call and > automatically build accessors. I had a play with some code to do this. A write-up of my experiment is here: http://et.redhat.com/~rjones/hvcalls/ Rich. -- Richard Jones Red Hat