From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id BD3A67EE35 for ; Thu, 21 Apr 2016 09:14:01 +0200 (CEST) IronPort-PHdr: 9a23:qSgLABYYQCbAFaFniuWkDur/LSx+4OfEezUN459isYplN5qZpcm5bnLW6fgltlLVR4KTs6sC0LqG9f6/EjVauN6oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLDivcOMKFwS3XKUWvBbElaflU3prM4YgI9veO4a6yDihT92QdlQ3n5iPlmJnhzxtY+a9Z9n9DlM6bp6r5YTGfayQ6NtRrVdCHw7KG0v/4W/vhDGSU6L52AAemQQiBtBRQbfukLURJD05wTgu+V6wjjSGMTyQLs0UHz24KJiTBLjiC4vODsw8WWRgct12vEI6Cm9rgByltaHKLqeM+BzK/vQ Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gmalecha@gmail.com; spf=Pass smtp.mailfrom=gmalecha@gmail.com; spf=None smtp.helo=postmaster@mail-wm0-f44.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gmalecha@gmail.com) identity=pra; client-ip=74.125.82.44; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gmalecha@gmail.com"; x-sender="gmalecha@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gmalecha@gmail.com designates 74.125.82.44 as permitted sender) identity=mailfrom; client-ip=74.125.82.44; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gmalecha@gmail.com"; x-sender="gmalecha@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-wm0-f44.google.com) identity=helo; client-ip=74.125.82.44; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gmalecha@gmail.com"; x-sender="postmaster@mail-wm0-f44.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AcAgAVfRhXiCxSfUpeg1Y1fQanMAQDhy6GEYZyHoVsAgKBPQc7EQEBAQEBAQEBEQEBAQgLCwkfMUESAYFZgi0RBBkBGx4DEgkBBjcCJAERAQUBIjWHcgEDEp4OggeBMT4xizaBaoJXhwoKGScNUYQfDBgBBQoFhRp4iTeCU4JWBY5HhFeEcYEuhE2IGYI0jFyNcBEegQ42giMegXMcMIYWgjEBAQE X-IPAS-Result: A0AcAgAVfRhXiCxSfUpeg1Y1fQanMAQDhy6GEYZyHoVsAgKBPQc7EQEBAQEBAQEBEQEBAQgLCwkfMUESAYFZgi0RBBkBGx4DEgkBBjcCJAERAQUBIjWHcgEDEp4OggeBMT4xizaBaoJXhwoKGScNUYQfDBgBBQoFhRp4iTeCU4JWBY5HhFeEcYEuhE2IGYI0jFyNcBEegQ42giMegXMcMIYWgjEBAQE X-IronPort-AV: E=Sophos;i="5.24,512,1454972400"; d="scan'208,217";a="175264471" Received: from mail-wm0-f44.google.com ([74.125.82.44]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 21 Apr 2016 09:14:01 +0200 Received: by mail-wm0-f44.google.com with SMTP id v188so231739004wme.1 for ; Thu, 21 Apr 2016 00:14:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=oJ49cSGJNLLcJ380/AIgSkbtKSUOsPHcyU9oCE5lYFA=; b=ifN7wiZsww7UQEjYe1H83jeAK5bANahDu4aynmBvmsb4bXgdGj5jmmUTuiFKM9iCCS Pz+I+uaMLbI03f6xb7xpOYnf9NzJiLCU2oNirrln2hsscaO7ZPjXktMo8h8HsAPsiG00 SRAKlpwLQgm/YImMar2TCSOKAX+8ZiT99XEPh79R+gOqULNXeteHnKzbLzXb9H/bZPYX 8SdUyHoSQlzjLKp0yhN+xsVmuqHon8q46NdpVgtsP63rWirAtTPvyH5jTx5S7FY5DvyL r+okrP7kxr49HYU8qcu7O4ZNLTcYlKA68UXKQlReNzppTPpZjM8H/ZQ71fAOEeSiSAYa qbJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=oJ49cSGJNLLcJ380/AIgSkbtKSUOsPHcyU9oCE5lYFA=; b=QpEZsI0YfWDXRMv3XsTch303Crl5Q274MikiBOScA6+C5vpHU2rVZ7WJ+NmKmmi/JA 7K8BwwiGidHx5QGEYp9yHuEB4Sv9k7iPMDzaIQABBRWCWEjRO9N/MNN7gAw3+GrZ4EeX 7fbenCCh3/Whak/hwclZMePobc92qK596icOmI6zVw23ra/efDXb25nyDCbai7VXGTJM vDoOtteqC+CPCplXwxgeZQ/Oe8i1qvDabDvTe4tSrhMPFy5uGFeO0yfOLGqSe8O7oMAc 78PC71x46gvQe4VhsDAEgtbDmckuQjaI6bEm9sfkEA0WyzN52hgaBL+jamkH+AHknU8n hWwg== X-Gm-Message-State: AOPr4FW6darcLzwZjLXSQgQkpcwX8PvX7QTUmyWjebbLhj3LmBxn8/+Arcp1t+g4lSDBy968WX26Fb42ICCjYA== X-Received: by 10.28.48.210 with SMTP id w201mr7614606wmw.22.1461222840800; Thu, 21 Apr 2016 00:14:00 -0700 (PDT) MIME-Version: 1.0 Received: by 10.194.9.1 with HTTP; Thu, 21 Apr 2016 00:13:21 -0700 (PDT) From: Gregory Malecha Date: Thu, 21 Apr 2016 00:13:21 -0700 Message-ID: To: caml users Content-Type: multipart/alternative; boundary=001a114240bc5d1ab20530f97490 Subject: [Caml-list] Question about Optimization --001a114240bc5d1ab20530f97490 Content-Type: text/plain; charset=UTF-8 Hello -- I'm wondering if there is any work (and interest) on supporting user-defined optimizations similar to GHC's rewrite rules in the Ocaml compiler. For example, a standard example would be specifying map fusion: map f (map g ls) = map (fun x -> f (g x)) ls This works well in Haskell due to laziness and (mostly) purity but things are obviously more complex in Ocaml since you can not pretend that things are pure (due to exceptions, references, IO, and non-termination). On a related note, this sort of optimization could require a reasonable amount of static analysis for effects (or trying to reflect effects in the type system). Has there been any work related to this? Thank you. -- gregory malecha gmalecha.github.io --001a114240bc5d1ab20530f97490 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hello --

I'm wondering if there is = any work (and interest) on supporting user-defined optimizations similar to= GHC's rewrite rules in the Ocaml compiler. For example, a standard exa= mple would be specifying map fusion:

map f (map g = ls) =3D map (fun x -> f (g x)) ls

This works we= ll in Haskell due to laziness and (mostly) purity but things are obviously = more complex in Ocaml since you can not pretend that things are pure (due t= o exceptions, references, IO, and non-termination).

On a related note, this sort of optimization could require a reasonab= le amount of static analysis for effects (or trying to reflect effects in t= he type system). Has there been any work related to this?

Thank you.

--
gregory malecha
--001a114240bc5d1ab20530f97490--