From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 8DB28BB83 for ; Sat, 19 Aug 2006 08:14:20 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k7J6EFBg031555 for ; Sat, 19 Aug 2006 08:14:20 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA01108 for ; Sat, 19 Aug 2006 08:04:01 +0200 (MET DST) Received: from ciao.gmane.org (main.gmane.org [80.91.229.2]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k7J640EH030792 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO) for ; Sat, 19 Aug 2006 08:04:01 +0200 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1GEJw1-00039k-Ut for caml-list@inria.fr; Sat, 19 Aug 2006 08:03:53 +0200 Received: from 0x5731d08c.bynxx18.adsl-dhcp.tele.dk ([87.49.208.140]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 19 Aug 2006 08:03:53 +0200 Received: from spam by 0x5731d08c.bynxx18.adsl-dhcp.tele.dk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sat, 19 Aug 2006 08:03:53 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Bardur Arantsson Subject: Re: Help interfacing with C Date: Sat, 19 Aug 2006 08:03:43 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: 0x5731d08c.bynxx18.adsl-dhcp.tele.dk User-Agent: Thunderbird 1.5.0.5 (X11/20060729) In-Reply-To: Sender: news X-Spam: no; 0.00; interfacing:01 error-prone:01 ocaml:01 internals:01 unix:01 ocaml:01 gerd:01 stolpmann's:01 unix:01 abstractions:01 cheers:01 drink:98 wrote:01 wrote:01 api:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Nathaniel Gray wrote: > On 8/18/06, Bardur Arantsson wrote: >> Nathaniel Gray wrote: >> > On 8/16/06, Bardur Arantsson wrote: >> >> Nathaniel Gray wrote: >> >> > Hi folks, >> >> [--snip--] > Let me be clear about this -- it's not really about performance. I'm > looking at the entire sequence of operations and data structures > needed to make a select call. Here's a typical example with the > current API: [--snip-- example --snip--] Ok, I did understand _what_ you are trying to do, I'm just not sure why anyone wouldn't choose the path of least resistance -- a solution in C is likely to be more error-prone (as you've discovered ;)) and harder to maintain if there are changes in OCaml internals -- whereas Unix.select is likely to remain that way "forever". Of course if the aim of the whole exercise is to get the modified select included in OCaml then I guess there's your motivation for doing it in C ;). However, if you just want a nicer interface then there are other solutions such as Gerd Stolpmann's "Equeue" framework. I would just use that instead of worrying about Unix.select. It provides much nicer abstractions: http://www.ocaml-programming.de/packages/documentation/equeue/ Cheers, -- Bardur Arantsson - If you can remember drinking it, you obviously didn't drink enough of it. Me