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=none autolearn=disabled version=3.1.3 Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 05A6DBC0C for ; Thu, 21 Dec 2006 22:11:02 +0100 (CET) Received: from mail.corp.idt.net (mail.corp.idt.net [169.132.25.53]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id kBLLB1Kq022857 for ; Thu, 21 Dec 2006 22:11:01 +0100 Received: from [169.132.9.113] (account saleyn HELO [169.132.9.113]) by mail.corp.idt.net (CommuniGate Pro SMTP 4.2.10) with ESMTP id 192973303; Thu, 21 Dec 2006 16:11:01 -0500 Message-ID: <458AF864.20902@hq.idt.net> Date: Thu, 21 Dec 2006 16:11:00 -0500 From: Serge Aleynikov User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 To: Chad Perrin Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Scripting in ocaml References: <6dbd4d000612201941wcd4b09anc503a13889576512@mail.gmail.com> <20061221153413.8f99e8ed.mle+ocaml@mega-nerd.com> <1166685756.5337.4.camel@rosella.wigram> <458A8C7B.7050204@hq.idt.net> <1166709162.5653.11.camel@rosella.wigram> <458AA143.3090303@hq.idt.net> <20061221202520.GG9440@apotheon.com> In-Reply-To: <20061221202520.GG9440@apotheon.com> Content-Type: text/plain; charset=windows-1251; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at discorde with ID 458AF865.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 run-time:01 ocaml:01 statically:01 runtime:01 runtime:01 marshaling:01 sockets:01 wrote:01 wrote:01 typing:01 typing:01 integer:01 marshal:01 caml-list:01 Chad Perrin wrote: > On Thu, Dec 21, 2006 at 09:59:15AM -0500, Serge Aleynikov wrote: >> I believe that introducing strict typing in the language might help in >> bridging static typing and dynamic loading. Strict typing would allow >> to do run-time type verification and type-specific guard checks. >> Though, this would no longer be Ocaml as we know it today. ;-) > > I think you lost me. What do you mean by "strict typing" such that > OCaml doesn't do it? From what I've seen, OCaml is both statically and > strongly typed. > What I meant by "strict typing" was performing type checks *at runtime*, i.e. that there are no unsafe operations. Say, as an example, doing type checks of function arguments at runtime: let f = fun i when is_integer (i) -> i | x when is_float (x) -> int_of_float x;; (raising Bad_match of some sort if neither one of the two guards pass) Direct application of this could be for making the Marshal/Unmarshal modules more safe when marshaling data over files/sockets between applications written in heterogeneous languages. Serge -- Serge Aleynikov Routing R&D, IDT Telecom Tel: +1 (973) 438-3436 Fax: +1 (973) 438-1464