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 mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id E515FBC37 for ; Tue, 9 Feb 2010 09:43:20 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAGqucEuFBoIF/2dsb2JhbADKNo4UAQSEVIMU X-IronPort-AV: E=Sophos;i="4.49,435,1262559600"; d="scan'208";a="56439665" Received: from rabbit.math.nagoya-u.ac.jp (HELO mailhost.math.nagoya-u.ac.jp) ([133.6.130.5]) by mail4-smtp-sop.national.inria.fr with ESMTP; 09 Feb 2010 09:43:19 +0100 Received: from mailhost.math.nagoya-u.ac.jp (localhost [127.0.0.1]) by mailhost.math.nagoya-u.ac.jp (Postfix) with ESMTP id E8AC2B786; Tue, 9 Feb 2010 17:43:16 +0900 (JST) Received: from mailhost.math.nagoya-u.ac.jp (camel-172 [172.16.254.4]) by mailhost.math.nagoya-u.ac.jp (Postfix) with ESMTP id B62F188A9; Tue, 9 Feb 2010 17:43:16 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=math.nagoya-u.ac.jp; h= date:message-id:to:cc:subject:from:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=alpha; bh=Gg3v2mvDVGM47DHq1Rw5euVh3B4=; b=XvNpMrgX9jF3iey05EUew1ehQWM2 SB4huniU5dCUMFK/FDaieoFiJciBdCoDVt55k9Cp2AmzLhxhA9c/teWFiq4cFcUd /wzZp+1oR7euaH7shzFr3RRMUSdj1alYpRFUXfmLbmmT37R+c+HUGLZyMWmalNTz gitbukoMtxcwE1E= DomainKey-Signature: a=rsa-sha1; h=Received:Date:Message-Id:To:Cc:Subject:From:In-Reply-To:References:X-Mailer:Mime-Version:Content-Type:Content-Transfer-Encoding; b=qddocWjExd1pMg7KanQXR+hwBj2jNLH8orUnPYSoAoJ38Fs1bJ4s8LWLrk0MVhNPruROb8t4jhEeEl3SoM5GQCU4tlP7jADiz9yqcEfeqv4CgKu3pex4oehDiuLbJbUiN9aLRnRwnRVL+bw35C3PnNE7uYaklB897kq9mLpaQL4=; c=nofws; d=math.nagoya-u.ac.jp; q=dns; s=alpha Received: from localhost (millas [172.16.30.29]) by mailhost.math.nagoya-u.ac.jp (Postfix) with ESMTP id 9217C88A5; Tue, 9 Feb 2010 17:43:16 +0900 (JST) Date: Tue, 09 Feb 2010 17:43:15 +0900 (JST) Message-Id: <20100209.174315.59672152.garrigue@math.nagoya-u.ac.jp> To: miles@milessabin.com Cc: rich.neswold@gmail.com, caml-list@inria.fr Subject: Re: [Caml-list] Preventing values from escaping a context From: Jacques Garrigue In-Reply-To: <30961e501002090024l18a9b458y8b3a7bd910626d38@mail.gmail.com> References: <14cf844b1002081907y2900c313q97ae0cb6f4c92394@mail.gmail.com> <20100209.123813.39168535.garrigue@math.nagoya-u.ac.jp> <30961e501002090024l18a9b458y8b3a7bd910626d38@mail.gmail.com> X-Mailer: Mew version 6.2.51 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; uniqueness:01 compiler:01 uniqueness:01 haskell:01 ocaml:01 ocaml:01 cheers:01 caml-list:01 short:01 explicitly:02 off-topic:02 epfl:02 garrigue:03 garrigue:03 jacques:03 From: Miles Sabin >> The short answer is no. >> Types are not sufficient to prevent values from escaping. > > I appreciate that mention of Scala is borderline off-topic on this > list, however that's a very broad negative statement, so broad > counterexamples seem appropriate ... ;-) > > Philippe Haller of EPFL is working on a uniqueness types extension of > Scala which provides exactly this, packaged as a compiler plugin for > scalac (my hope is that it will be rolled into the main scala > distribution during the 2.8.x series, so this isn't solely academic > exercise). Indeed my statement was too general. Uniqueness type can do the trick... because they are explicitly designed for that. I answered this way because, in Haskell, since there are no hidden references, types are enough to disallow escaping. Unfortunately this does not work in ocaml. So ocaml also could profit from uniqueness types. Cheers, Jacques Garrigue