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=2.3 required=5.0 tests=HTML_10_20,HTML_MESSAGE, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from discorde.inria.fr (discorde.inria.fr [192.93.2.38]) by yquem.inria.fr (Postfix) with ESMTP id 89E08BC69 for ; Fri, 23 Feb 2007 19:14:38 +0100 (CET) Received: from mu-out-0910.google.com (mu-out-0910.google.com [209.85.134.190]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id l1NIEbrH031263 for ; Fri, 23 Feb 2007 19:14:38 +0100 Received: by mu-out-0910.google.com with SMTP id w9so490670mue for ; Fri, 23 Feb 2007 10:14:35 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=AVhy77KUzlskvCGEL0VCRlk1z4UQLOxOvbE5GIDHPLZMe4EKpgDwFbQvpYcz+xGRoHw5QsKBjggpMMOzMQtEYN9vbDF+4uAyqIM4MzDAhATvo35s4GC5ejChLVhd3C1efudqXShnXvel/II+t2Wv4w2K0ktaLx9eJqPtD9EjYl0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:references; b=dqKIVCjzoxnLuPLnuWukqLeUaf+SG/+f3qOvtRs7d7r7axkEvNlCocOFeJiXcJyjnjzRGgMwDqlsxCeG2llg6b6UBqg5HzXrMsAmqVbJJfMKXyRzZR2WNSbA/OSHcLNlOZuQ5bSsCtIWnN/fBnV2DLBc9iQE/FtaaRCPtBt3b0I= Received: by 10.82.175.2 with SMTP id x2mr889448bue.1172254475144; Fri, 23 Feb 2007 10:14:35 -0800 (PST) Received: by 10.82.100.16 with HTTP; Fri, 23 Feb 2007 10:14:35 -0800 (PST) Message-ID: Date: Fri, 23 Feb 2007 19:14:35 +0100 From: Tom To: brogoff Subject: Re: [Caml-list] Instruction selection in the OCaml compiler: Modules or classes? Cc: caml-list@inria.fr In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_55754_11973498.1172254475038" References: <6CB0D237-F894-4AC3-BDBE-2BB484928D3C@gmail.com> X-j-chkmail-Score: MSGID : 45DF2F0D.000 on discorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at discorde with ID 45DF2F0D.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; ocaml:01 compiler:01 markus:01 subsumed:01 mixin:01 variants:01 ocaml:01 variants:01 model:01 namespaces:01 subtyping:01 structurally:01 markus:01 subsumed:01 mixin:01 X-Attachments: cset="UTF-8" cset="UTF-8" ------=_Part_55754_11973498.1172254475038 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline > > > I use classes less frequently (but as Markus points out they are for the > most part much more pleasant than Java or C++ classes) so my gut feeling > is that their abilities should be subsumed in the module system (mixin > modules?) and the record system. I think you should take a look at another currently active thread - "Feature request : Tuples vs. records". One of the red lines there is the comparison of structural versus nominal typing - classes and objects belonging to the former, and modules and records to the latter. Some say that structural typing features (objects, along with Polymorphic Variants) are an appreciated alternative to the "rigid" nominal typing of OCaml (variants, records, modules). That is why I believe that classes should exist as a separate entity (I'm not that much in favour of polymorphic variants - they weaken the type checking process too much in my opinion, and I have yet to see a good use for them), so that one can use them when one needs sharing - which records (and conventional inheritance-based object systems) don't provide. A criticism of OOP (available at http://www.geocities.com/tablizer/oopbad.htm) addresses the issue that although conventional class systems (that is, having nominal typing, not structural) are supposed to be "nature like" (OO proponents claim that objects are more suitable to modelling things as they are in nature), they often lack the dynamic aspect of the nature, the adaptability - for example, they cannot change class, and are usually adapted to one function only, or model a functionality forcefully "adapted" to the tree-like inheritance-based structure. OCaml objects seem a great alternative for that. The way I see things, or rather the way I dream things, is having modules simply as namespaces, having extensible records (records that have nominal subtyping - inheritance, so that parts of records can be shared - very useful in GUI implementation, in my opinion) with multiple dispatch, and having structurally typed object system, like the one in OCaml. I hope I will succeed in implementing such a system one day. - Tom ------=_Part_55754_11973498.1172254475038 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline

I use classes less frequently (but as Markus points out they are for the
most part much more pleasant than Java or C++ classes) so my gut feeling
is that their abilities should be subsumed in the module system (mixin
modules?) and the record system.

I think you should take a look at another currently active thread  - "Feature request : Tuples vs. records". One of the red lines there is the comparison of structural versus nominal typing - classes and objects belonging to the former, and modules and records to the latter. Some say that structural typing features (objects, along with Polymorphic Variants) are an appreciated alternative to the "rigid" nominal typing of OCaml (variants, records, modules). That is why I believe that classes should exist as a separate entity (I'm not that much in favour of polymorphic variants - they weaken the type checking process too much in my opinion, and I have yet to see a good use for them), so that one can use them when one needs sharing - which records (and conventional inheritance-based object systems) don't prov! ide.

A criticism of OOP (available at http://www.geocities.com/tablizer/oopbad.htm) addresses the issue that although conventional class systems (that is, having nominal typing, not structural) are supposed to be "nature like" (OO proponents claim that objects are more suitable to modelling things as they are in nature), they often lack the dynamic aspect of the nature, the adaptability - for example, they cannot change class, and are usually adapted to one function only, or model a functionality forcefully "adapted" to the tree-like inheritance-based structure. OCaml objects seem a great alternative for that.

The way I see things, or rather the way I dream things, is having modules simply as namespaces, having extensible records (records that have nominal subtyping - inheritance, so that parts of records can be shared - very useful in GUI implementation, in my opinion) with multiple dispatch, and having structurally typed object system, like the one in OCaml. I hope I will succeed in implementing such a system one day.

- Tom
------=_Part_55754_11973498.1172254475038--