From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id XAA30699; Sun, 21 Mar 2004 23:36:01 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 XAA30418 for ; Sun, 21 Mar 2004 23:36:00 +0100 (MET) Received: from swordfish.cs.caltech.edu (swordfish.cs.caltech.edu [131.215.44.124]) by concorde.inria.fr (8.12.10/8.12.10) with ESMTP id i2LMZxHd003133 for ; Sun, 21 Mar 2004 23:36:00 +0100 Received: from orchestra.cs.caltech.edu (orchestra.cs.caltech.edu [131.215.44.20]) by swordfish.cs.caltech.edu (Postfix) with ESMTP id 59BCEDF260; Sun, 21 Mar 2004 14:35:58 -0800 (PST) Received: by orchestra.cs.caltech.edu (Postfix, from userid 2554) id 8023C9BBA2; Sun, 21 Mar 2004 14:35:56 -0800 (PST) From: Michael Vanier To: skaller@users.sourceforge.net Cc: oleg_trott@columbia.edu, caml-list@inria.fr In-reply-to: <1079888775.3165.11.camel@pelican.wigram> (message from skaller on 22 Mar 2004 04:06:18 +1100) Subject: Re: [Caml-list] extensible records again References: <20040321062143.BE7D29BBA2@orchestra.cs.caltech.edu> <405D4D77.2030403@columbia.edu> <20040321084008.429279BBA2@orchestra.cs.caltech.edu> <405DBE78.5020609@columbia.edu> <1079888775.3165.11.camel@pelican.wigram> Message-Id: <20040321223556.8023C9BBA2@orchestra.cs.caltech.edu> Date: Sun, 21 Mar 2004 14:35:56 -0800 (PST) X-Miltered: at concorde by Joe's j-chkmail ("http://j-chkmail.ensmp.fr")! X-Loop: caml-list@inria.fr X-Spam: no; 0.00; vanier:01 mvanier:01 caml-list:01 extensible:01 sourceforge:01 2004:99 2004:99 oleg:01 vanier:01 refactor:01 vyper:01 python:01 vyper:01 extensible:01 ocaml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk X-Status: X-Keywords: X-UID: 289 > From: skaller > Date: 22 Mar 2004 04:06:18 +1100 > > On Mon, 2004-03-22 at 03:10, Oleg Trott wrote: > > Michael Vanier wrote: > > > > In fact, in your case, I believe it's more convenient > > not to create an artificial distinction between the "core types" and > > "other types": suppose someone extended your language with "files", and > > you later decide to add "file" to your "core types". You'll have to > > redefine "data" and refactor a lot of your base code to do it, unless > > you just use polymorphic variants, as suggested (in which case there is > > no special distinction between "core types" and "other types"). > > However there IS a reason for making the distinction sometimes, > namely performance. > > My Vyper interpreter (a Python interpreter written in Ocaml) > used a type like > > type PyObject = Int of int | Float of float | > String of string | PyClass of pyclass > > which deliberately distinguished simple types > so that a fast match could be used to perform > common calculations: > > match o1, o2 with > | Int i, Int j -> Int (i + j) > .... > Is the code for Vyper still available? Also, is there really any significant speed difference between polymorphic variants and regular variants? How would this compare to using exceptions as an extensible variant type? Mike ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners