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.1 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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id CE1E1BC0A for ; Thu, 17 May 2007 23:33:46 +0200 (CEST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.179]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l4HLXkiE031543 for ; Thu, 17 May 2007 23:33:46 +0200 Received: from [84.59.123.75] (helo=gate.lan.gerd-stolpmann.de) by mrelayeu.kundenserver.de (node=mrelayeu0) with ESMTP (Nemesis), id 0MKwh2-1HonbV1yT6-0004Jm; Thu, 17 May 2007 23:33:46 +0200 Received: from flakew.lan.gerd-stolpmann.de (fw.lan.gerd-stolpmann.de [192.168.1.1]) by gate.lan.gerd-stolpmann.de (Postfix) with ESMTP id 3A836C16C; Thu, 17 May 2007 23:33:45 +0200 (CEST) Subject: Re: [Caml-list] DSL for handling parsing binary memory structures? From: Gerd Stolpmann To: Richard Jones Cc: caml-list@inria.fr In-Reply-To: <20070517212157.GA20085@furbychan.cocan.org> References: <20070517212157.GA20085@furbychan.cocan.org> Content-Type: text/plain Date: Thu, 17 May 2007 23:33:43 +0200 Message-Id: <1179437624.31581.6.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Provags-ID: V01U2FsdGVkX19attGIeXe+ERk3WJ/8vNNX7kXEEc27j/rOMxB Pioe1q7OUQjqwWdRYIx0d3k0yCp2oQXswKMevXll4CwhaCkKsM oDPlz8buBY9sRKhoPeMuVNcHDuiFBgD X-Miltered: at concorde with ID 464CCA3A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; parsing:01 gerd:01 stolpmann:01 donnerstag:01 ocaml:01 alignment:01 bitfields:01 accessors:01 ocamlnet:01 gerd:01 stolpmann:01 viktoriastr:01 64293:01 darmstadt:01 6151:01 Am Donnerstag, den 17.05.2007, 22:21 +0100 schrieb Richard Jones: > 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. Ocamlnet contains support for XDR, a simplified version of what you are looking for (smallest unit are 4 bytes). But this might be a starting point for this project. Gerd -- ------------------------------------------------------------ Gerd Stolpmann * Viktoriastr. 45 * 64293 Darmstadt * Germany gerd@gerd-stolpmann.de http://www.gerd-stolpmann.de Phone: +49-6151-153855 Fax: +49-6151-997714 ------------------------------------------------------------