From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA27322 for caml-redistribution@pauillac.inria.fr; Fri, 25 Feb 2000 14:03:36 +0100 (MET) Resent-Message-Id: <200002251303.OAA27322@pauillac.inria.fr> 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 AAA26138 for ; Fri, 25 Feb 2000 00:31:04 +0100 (MET) Received: from ot-link.ot.com.au ([203.5.3.1]) by nez-perce.inria.fr (8.8.7/8.8.7) with SMTP id AAA06389 for ; Fri, 25 Feb 2000 00:31:00 +0100 (MET) Received: (qmail 21569 invoked from network); 24 Feb 2000 23:30:52 -0000 Received: from unknown (HELO druid.in.ot.com.au) (203.5.4.202) by 203.5.4.251 with SMTP; 24 Feb 2000 23:30:52 -0000 Received: (qmail 12261 invoked from network); 24 Feb 2000 23:30:50 -0000 Received: from merlin.in.ot.com.au (HELO in.ot.com.au) (203.5.4.26) by druid.in.ot.com.au with SMTP; 24 Feb 2000 23:30:50 -0000 Sender: maxs@inria.fr Message-ID: <38B5C085.A1F9898F@in.ot.com.au> Date: Fri, 25 Feb 2000 10:36:37 +1100 From: Max Skaller Organization: Open Telecommunications Ltd X-Mailer: Mozilla 4.61 [en] (X11; I; Linux 2.2.12-20 i686) X-Accept-Language: en MIME-Version: 1.0 To: Damien Doligez CC: caml-list@inria.fr Subject: Re: Calling C from OCaml, GC problems References: <200002231939.UAA01100@tobago.inria.fr> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Resent-From: weis@pauillac.inria.fr Resent-Date: Fri, 25 Feb 2000 14:03:36 +0100 Resent-To: caml-redistribution@pauillac.inria.fr Damien Doligez wrote: > > >From: Max Skaller > > > >I'd recommend getting rid of those macros. Anyone writing > >a CAML/C interface needs to understand details of how the GC > >works so as to optimise code to exactly the required > >functions to create temporary roots, etc .. it would be better > >to provide the raw functions and a good explanation. > > Even with the raw functions and a perfect understanding of the system, > I found it extremely difficult to write bug-free code, and very > time-consuming to fish out the inevitable bugs. That's why the macros > exist. But, use of the macros _also_ leads to code with bugs, as we are hearing, but programmers now have extra information to cope with, and no good explanation of exactly what the GC routines DO. Generally I agree with your (elided) comments about correctness and efficiency, but for some kinds of interfacing, the best possible performance is required. Anyone doing C interfacing needs to have considerable expertise -- I think it would be best to addess primary documentation to such people. -- John (Max) Skaller at OTT [Open Telecommications Ltd] mailto:maxs@in.ot.com.au -- at work mailto:skaller@maxtal.com.au -- at home