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 E693DBBC4 for ; Tue, 31 Jan 2006 18:51:07 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k0VHp7Ln031494 for ; Tue, 31 Jan 2006 18:51:07 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id SAA26005 for ; Tue, 31 Jan 2006 18:51:06 +0100 (MET) Received: from mail1.sea5.speakeasy.net (mail1.sea5.speakeasy.net [69.17.117.3]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k0VHp4gi019327 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Tue, 31 Jan 2006 18:51:06 +0100 Received: (qmail 30095 invoked from network); 31 Jan 2006 17:51:02 -0000 Received: from shell2.sea5.speakeasy.net ([69.17.116.3]) (envelope-sender ) by mail1.sea5.speakeasy.net (qmail-ldap-1.03) with AES256-SHA encrypted SMTP for ; 31 Jan 2006 17:51:02 -0000 Date: Tue, 31 Jan 2006 09:51:02 -0800 (PST) From: brogoff To: "Quinn, Chris" Cc: caml-list@inria.fr Subject: RE: [Caml-list] Type-safe interface to Postgres's SQL In-Reply-To: <4DB758040F42334883C0350EB806CA73A598AB@ukspm207.emea.corp.eds.com> Message-ID: References: <4DB758040F42334883C0350EB806CA73A598AB@ukspm207.emea.corp.eds.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Miltered: at nez-perce with ID 43DFA38B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 43DFA388.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 type-safe:01 compiler:01 runtime:01 mismatch:01 gcaml:01 u-tokyo:01 furuse:01 gcaml:01 marshalling:01 wishlist:01 wrote:01 speakeasy:01 caml:02 implemented:02 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 On Tue, 31 Jan 2006, Quinn, Chris wrote: > A few years ago I implemented a type safe interface to db2 (odbc > compliant). > My approach was to extend the caml compiler with a Type.typeof : 'a -> > typeinfo function > which marshalled the internal type info into a string. > This is then used at runtime to compare with the database's notion of > what a query produces > (the check is performed only once during the execution life of the > program, thereby minimising cost) > So any mismatch with the db schema is caught (as long as that bit of the > code is actually run!) Sounds like GCaml (http://www.y1.is.s.u-tokyo.ac.jp/~furuse/gcaml) would have allowed you to express this directly. The better typed marshalling has been on my wishlist for a while -- Brian