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=1.9 required=5.0 tests=AWL,DNS_FROM_RFC_POST, 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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id CACF2BBAF for ; Mon, 22 Jun 2009 11:19:24 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AloCACjpPkrRVdvXm2dsb2JhbACYIT8BAQEBAQgJCgkTpSuBGY0/AQMCBIQGBQ X-IronPort-AV: E=Sophos;i="4.42,267,1243807200"; d="scan'208";a="29946520" Received: from mail-ew0-f215.google.com ([209.85.219.215]) by mail3-smtp-sop.national.inria.fr with ESMTP; 22 Jun 2009 11:19:24 +0200 Received: by ewy11 with SMTP id 11so4561523ewy.9 for ; Mon, 22 Jun 2009 02:19:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=+eq4OhrHtbskSlZ3xmITbjH7//vz0HdgiqYZGIOQIfc=; b=xBUtPrUd2N+a/8Mp/C54Mi+5tRwfPUlNKYETmuim1oVWulKlqPUx6dJSvrMLcjwfG8 pdWuj2v6OneFyMx6Epp5Xf+tF0/f+Mo7TnGCEL69/3VX9ritT0Ps8V/gOinpREjZuwEQ 66DzMKo8xzdELvlsmTQBNGrWuKnFIDngzBjoA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=utny7Ui+IVXMpFkc7N/e+Mgzm+k8TVpL1AphgYlMl6ZrhPpTNicyEBkIQHocK9d/c4 csnFSSSGalV7y+2FmntIKx0ZT+sLRyn+ddcSbjC1HPQFxqHDIRWFlg8rZOliilGKzhPf 7utMEDmquJzcPua8vdG4cvBNG+xRzfx8MumEw= Received: by 10.210.115.15 with SMTP id n15mr4785978ebc.72.1245662363788; Mon, 22 Jun 2009 02:19:23 -0700 (PDT) Received: from ?192.168.0.10? (ivr94-5-82-237-227-151.fbx.proxad.net [82.237.227.151]) by mx.google.com with ESMTPS id 28sm224848eyg.54.2009.06.22.02.19.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 22 Jun 2009 02:19:23 -0700 (PDT) Message-ID: <4A3F4C99.2030808@gmail.com> Date: Mon, 22 Jun 2009 11:19:21 +0200 From: Benjamin Canou User-Agent: Thunderbird 2.0.0.21 (X11/20090409) MIME-Version: 1.0 To: =?ISO-8859-1?Q?Daniel_B=FCnzli?= Cc: OCaml List Subject: Re: [Caml-list] Re: Obj.magic and existential types. References: <4A3BCE1A.3010403@citycable.ch> <91F6B99D-3075-47A1-9257-0BD208C6D5D8@erratique.ch> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Spam: no; 0.00; existential:01 bunzli:01 implements:01 semantics:01 distro:01 trivial:01 arrays:01 cheers:01 javascript:98 garbage:01 incremental:01 abstract:01 caml-list:01 short:01 benjamin:01 Daniel Bünzli a écrit : > > Le 21 juin 09 à 20:08, Jake Donham a écrit : > >> I have not tried either, but from a cursory glance at the code I have >> the impression that React's space safety relies on support for weak >> references, which standard Javascript does not have. > > Yes. > > The weak module is available in obrowser, but I don't know if it > implements its semantics. If the author of obrowser is on this list > would he be kind enough to enlight us ? Abstract: The weak.js file remaining in the distro is a mistake. I see possibilities to implement them but have no short term plans for a perfect solution. Well... there is no such a file as this garbage weak.js in the distribution, it must have spawn by itself in your computer ;-) Indeed there is no such mechanism in JS. I have ideas to implement them on top of JS, in particular a trivial solution involving reference counters and updating weak arrays incrementally every N VM instructions could suffice in some cases (but induce memory leaks in presence of cycles through the weak value, of course). There are more satisfying possibilities but I have yet to figure out one with good complexity, incremental, and not too hard to implement (in particular not too intrusive in other parts of the VM). Cheers. PS: btw, there is now a darcs repo for obrowser at ocsigen.org for those who didn't know