From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 64C127EEE0 for ; Wed, 18 Mar 2015 04:16:42 +0100 (CET) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of kennethadammiller@gmail.com) identity=pra; client-ip=209.85.214.172; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="kennethadammiller@gmail.com"; x-sender="kennethadammiller@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of kennethadammiller@gmail.com designates 209.85.214.172 as permitted sender) identity=mailfrom; client-ip=209.85.214.172; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="kennethadammiller@gmail.com"; x-sender="kennethadammiller@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-ob0-f172.google.com) identity=helo; client-ip=209.85.214.172; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="kennethadammiller@gmail.com"; x-sender="postmaster@mail-ob0-f172.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0CVAADa7AhVm6zWVdFbhDIEgwjKMQdMAQEBAQEBEQEBAQEBBgsLCRQuhAYiER0BGx4DEggBBzcCJAERAQUBIjWHeAEDEaArgyw+MYsxgWuCd5ArChknDVSFDQEFDpJpgUUFmiqBG4wUhSQSI4EMCYQtIjGCQwEBAQ X-IPAS-Result: A0CVAADa7AhVm6zWVdFbhDIEgwjKMQdMAQEBAQEBEQEBAQEBBgsLCRQuhAYiER0BGx4DEggBBzcCJAERAQUBIjWHeAEDEaArgyw+MYsxgWuCd5ArChknDVSFDQEFDpJpgUUFmiqBG4wUhSQSI4EMCYQtIjGCQwEBAQ X-IronPort-AV: E=Sophos;i="5.11,419,1422918000"; d="scan'208";a="126482114" Received: from mail-ob0-f172.google.com ([209.85.214.172]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 18 Mar 2015 04:16:41 +0100 Received: by obbgg8 with SMTP id gg8so22833179obb.1 for ; Tue, 17 Mar 2015 20:16:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:date:message-id:subject:from:to:content-type; bh=TAzrSG2oMAbx+7F5mJqhjDQ/fdI8q7IKCJ0s6uOJ+pE=; b=RPRRjIp/Wn09wwJzczMV1GJslOwM4XvksuiXoOCp9nPn9/8K5VftNnOXBhUQf+xl56 Rg6oM6Lyg0vEO2WFlDfo03TnKLHo6VB96IAvEMOJkmRMC0ojEtUdCiytYeHeVfQY4W8q 8lcRsbQTDjbxYhhZXYtRmdt4qWeqqQDHsStMaiqSgxxAeDNaApkOvO87fLJYAfAxnns0 F0lgJN1VMXKEHeal9YRoxnw8JGvylKECf5l9CYcRAEAxss/68/1Wr4ZRmaKmsYAonJrG Rfwve6A4P6tf7IFTHupQFPeMJ83TZ/MMdfsW96MX+D8UeEZKN+Jdnr9rbhKKEUkZ/Buw w4kw== MIME-Version: 1.0 X-Received: by 10.182.51.138 with SMTP id k10mr55380828obo.68.1426648600209; Tue, 17 Mar 2015 20:16:40 -0700 (PDT) Received: by 10.202.185.8 with HTTP; Tue, 17 Mar 2015 20:16:40 -0700 (PDT) Date: Tue, 17 Mar 2015 23:16:40 -0400 Message-ID: From: Kenneth Adam Miller To: caml users Content-Type: multipart/alternative; boundary=047d7bfeb70a08ef0105118783ca Subject: [Caml-list] Compiler Intrinsics question --047d7bfeb70a08ef0105118783ca Content-Type: text/plain; charset=UTF-8 So, OCaml uses a lot of immutable data structures by default, and there's a way in OCaml to express how to replace everything else in a type with the same edition, with the exception of a single variable being updated. But does that mean that the compiler is sufficiently capable to conclude side effects that are more efficient rather than just the nieve explanation, which is a *copy* of the entire data structure with only the specified changed variable updated? Can OCaml conclude that it can update only one variable for efficiency, and know that the rest of the data structure is safe? For example, in tail recursion, it's provably equivalent to produce code that doesn't blow the stack and is faster, and that's exactly what the compiler does. So are side effects a "conclusion"? --047d7bfeb70a08ef0105118783ca Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
So, OCaml uses a lot of immutable data structures by defau= lt, and there's a way in OCaml to express how to replace everything els= e in a type with the same edition, with the exception of a single variable = being updated.


But does that mean that th= e compiler is sufficiently capable to conclude side effects that are more e= fficient rather than just the nieve explanation, which is a *copy* of the e= ntire data structure with only the specified changed variable updated? Can = OCaml conclude that it can update only one variable for efficiency, and kno= w that the rest of the data structure is safe?

For= example, in tail recursion, it's provably equivalent to produce code t= hat doesn't blow the stack and is faster, and that's exactly what t= he compiler does. So are side effects a "conclusion"?
--047d7bfeb70a08ef0105118783ca--