From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p7VNe4Iu002905 for ; Thu, 1 Sep 2011 01:40:04 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AisDAKzFXk7RVdIpimdsb2JhbABCnQ2LOggUAQEBCgkNBxIGIYFAAQEBAQMSAiYGATgBAwwBBQUYHBI0AQUBHAYuB6Q3Co8RhVeJKAIDBoVvYASHZYtAhjaGLDyBR4Iz X-IronPort-AV: E=Sophos;i="4.68,310,1312149600"; d="scan'208";a="107294250" Received: from mail-pz0-f41.google.com ([209.85.210.41]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 01 Sep 2011 01:39:58 +0200 Received: by pzk4 with SMTP id 4so2553432pzk.14 for ; Wed, 31 Aug 2011 16:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:subject:mime-version:content-type:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to:x-mailer; bh=S3VOGxog5Z1nOKDvbusNUCa0pFycSDDB1fmOhnEPMKg=; b=QEXN2ZTIJssuP+UrSsbCePXoNwhXeOCkgA++NGiMyjBFxyJqdwVdPkip3LnNbx/Jvt /Z40lRxlohfPSwxjtSZHSbSc9dJGD79Vi7P0TFwrdh2lKf+jH6VMG6F4hDlV4TqC/zjZ XLLwI4v3QPjhn2Uu1kb1mJRn6+te29jJudFWQ= Received: by 10.68.9.231 with SMTP id d7mr1280358pbb.300.1314833997087; Wed, 31 Aug 2011 16:39:57 -0700 (PDT) Received: from tanpopo.garrigue.jp (58x158x128x157.ap58.ftth.ucom.ne.jp [58.158.128.157]) by mx.google.com with ESMTPS id z12sm62648wfn.23.2011.08.31.16.39.54 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 31 Aug 2011 16:39:55 -0700 (PDT) Sender: Jacques Garrigue Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: Jacques Garrigue In-Reply-To: <4E5EA894.9060607@frisch.fr> Date: Thu, 1 Sep 2011 08:39:58 +0900 Cc: caml-list Message-Id: <364C2CE8-55FB-4050-8BBC-D59B03F9E59F@math.nagoya-u.ac.jp> References: <4E58CCC3.4040901@gmail.com> <1314457588.3496.86.camel@thinkpad> <1314473840.3496.132.camel@thinkpad> <1314486489.3496.179.camel@thinkpad> <61B410B8-15EF-4B18-9CC5-C224FB495353@math.nagoya-u.ac.jp> <4E5EA894.9060607@frisch.fr> To: Alain Frisch X-Mailer: Apple Mail (2.1084) Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by walapai.inria.fr id p7VNe4Iu002905 Subject: Re: [Caml-list] Ocaml and the Fragile Base Class Problem On 2011/09/01, at 6:33, Alain Frisch wrote: >> Also, for various reasons, objects are not beginner friendly. >> I think the main problem is that they don't fit that well with type inference: >> both subtyping and polymorphic methods require explicit type annotations. > > Time to advertise the implicit-subtyping branch? Indeed the implicit-subtyping branch helps: if the compiler knows all the types, it doesn't force you to write a coercion by hand. On the other hand, this is only a partial solution, as my comment was on the lack of principality: you still need type annotations in many cases. Constraint-based type inference might recover this principality, but since the types inferred get even worse than with structural object types, I'm afraid this is not really practical. (It might work better with nominal subtyping.) Jacques Garrigue