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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 3D8377F61E for ; Sun, 5 Nov 2017 22:53:46 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=paurkedal@gmail.com; spf=Pass smtp.mailfrom=paurkedal@gmail.com; spf=None smtp.helo=postmaster@mail-wm0-f44.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of paurkedal@gmail.com) identity=pra; client-ip=74.125.82.44; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="paurkedal@gmail.com"; x-sender="paurkedal@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of paurkedal@gmail.com designates 74.125.82.44 as permitted sender) identity=mailfrom; client-ip=74.125.82.44; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="paurkedal@gmail.com"; x-sender="paurkedal@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-wm0-f44.google.com) identity=helo; client-ip=74.125.82.44; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="paurkedal@gmail.com"; x-sender="postmaster@mail-wm0-f44.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AkFIf/BMhyKi4HBh1sVol6mtUPXoX/o7sNwtQ0KIM?= =?us-ascii?q?zox0KP37rarrMEGX3/hxlliBBdydsK0UzbeO+4nbGkU+or+5+EgYd5JNUxJXwe?= =?us-ascii?q?43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6aijSI4DUTAhTyMxZu?= =?us-ascii?q?bqSwQ9aKzpf/6+fn1JTZeQRFgHKGarN/Nhis5VHev8MMgIZmbL06yhbTr2FgdO?= =?us-ascii?q?FfxGcuLlWWyUXS/MC1qdRb/jhMtuhp3ogIbL/5cqgxSfYQWCwvLno26cHisTHM?= =?us-ascii?q?SAKO4j0XVWBAwUkAOBTM8ByvBsS5iSD9rOconXDCZcA=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0AdAgDvh/9ZhixSfUpcGgEBAQECAQEBA?= =?us-ascii?q?QgBAQEBg1kBgSwUEweDdpk4gXyYVwqEJgGBFAKEUAdCFQEBAQEBAQEBAQESAQE?= =?us-ascii?q?BCAsLCCgvgjgFAR4BBYI9AQIDIx0BGx0BAwwGBQsNAgImAgIhAQERAQUBHAYTi?= =?us-ascii?q?goBAxWdNkCMDIIFBQEcgwoFg1oKGScNWIJuAQEBAQYBAQEBHAIGEn2CH4IHhma?= =?us-ascii?q?CaoFmQYMVgmIFoVI8ApABhHmTNI0aiGgUBR+BFTWCDnpeNYIvgk0fgXRANosQg?= =?us-ascii?q?VUBAQE?= X-IPAS-Result: =?us-ascii?q?A0AdAgDvh/9ZhixSfUpcGgEBAQECAQEBAQgBAQEBg1kBgSw?= =?us-ascii?q?UEweDdpk4gXyYVwqEJgGBFAKEUAdCFQEBAQEBAQEBAQESAQEBCAsLCCgvgjgFA?= =?us-ascii?q?R4BBYI9AQIDIx0BGx0BAwwGBQsNAgImAgIhAQERAQUBHAYTigoBAxWdNkCMDII?= =?us-ascii?q?FBQEcgwoFg1oKGScNWIJuAQEBAQYBAQEBHAIGEn2CH4IHhmaCaoFmQYMVgmIFo?= =?us-ascii?q?VI8ApABhHmTNI0aiGgUBR+BFTWCDnpeNYIvgk0fgXRANosQgVUBAQE?= X-IronPort-AV: E=Sophos;i="5.44,349,1505772000"; d="scan'208";a="299395569" Received: from mail-wm0-f44.google.com ([74.125.82.44]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 05 Nov 2017 22:53:41 +0100 Received: by mail-wm0-f44.google.com with SMTP id b189so10257479wmd.4 for ; Sun, 05 Nov 2017 13:53:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=pylKylYfPDH2a24vfshojWqT2c30cR8sEnotgT05skc=; b=jgUqFM4X6/NbmC6aWZx83M6Q0SBKU1dOFdtohL3l6/ng9kyhz09j75/Z3z1xVybxWh mVw895O9ZEUq4ROmjSqeFCmMFGjz2nu9110FXdt7ogUwrXSXVnO5Je4tz+w9bzU1io1X Apfw1rt3lr8kwHNRwN4Nsqa+bTuoS7eP9npyT5shRyOe0H6rR8dOSX94LfYt0s5mJYPj mXd010lOH8XDDMi4kZMphYBSQO+3WE+ZES+sDEEjo870UE1s4cTZRVs9kokRpUqmhyJJ ZbbG5bdIYvXvlFOtd/qu5BIAk/y32GQ3EkqrjN0S/0mfn9Ca0sTrauAI2V4j8OCfLBlB 6czg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=pylKylYfPDH2a24vfshojWqT2c30cR8sEnotgT05skc=; b=os8zMp2f7NjqweeJCwCLBqO92+co86J+vTY0FrKchlWQ63b+Ny3koG8jl6NdumcKlO V0/9bsDTLl+tyO2668WYocSKr0lf8QH6pzHHH27zJaFtKIkSfknC1BZUhX876ATvB4wm EIhhhnkJPFVQXAjWoUZzf7Nn0P3//0uMgjlGX8YY2Mo5ojdw29/Dbnc/zH5pxxRMf7dk ekdcbRpMXHA0Cp0FhIFxMqD8H0tA6l/ep98jLkuDe8SxgrUW0ioOcmmiMz7AWfQYM7k8 Qeou8OTzuQbEolN7WnJUFfS49V/KHKteYmzOs8MdotUkN5pi1kqW/ArrAwfomjash0yP anIA== X-Gm-Message-State: AJaThX4lAizW14PUjod9dOqmha0lhdJovS74EqwverG5Ey9eEljwIU3s xU4qIaazOuvYubiJ2NJX2kZAd5/u8m3S2xx8lTE= X-Google-Smtp-Source: ABhQp+QwMU9592THY4yWXBkk7nqZa6G/RltlAFe5AznVL/DgQ5eHiXuGkJDjwvQBkw5MKrNooJcZhwJA9j+DVNJHpgY= X-Received: by 10.28.71.67 with SMTP id u64mr3512841wma.48.1509918820673; Sun, 05 Nov 2017 13:53:40 -0800 (PST) MIME-Version: 1.0 Received: by 10.223.156.209 with HTTP; Sun, 5 Nov 2017 13:53:39 -0800 (PST) In-Reply-To: References: <86o9p2ywgc.fsf@gmail.com> <20171020113815.GD32138@nunchakus.loria.fr> <20171024133026.uovvzdbnamnzoknv@annexia.org> <20171104184401.3el2vbha2tgpvse5@annexia.org> <20171105174116.lbd36diq2xzpjba6@annexia.org> From: "Petter A. Urkedal" Date: Sun, 5 Nov 2017 22:53:39 +0100 Message-ID: To: Gabriel Scherer Cc: Yaron Minsky , "Richard W.M. Jones" , octachron , "caml-list@inria.fr" , hugo heuzard Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Subject: Re: [Caml-list] What if exn was not an open type? On 5 November 2017 at 21:49, Gabriel Scherer wr= ote: > We also have return-by-local-exceptions in Batteries (the BatReturn > module), but reports from js_of_ocaml users (namely, Cl=C3=A9ment > Pit-Claudel) is that this style gets translated to extremely slow > Javascript code -- functions from Batteries using this style (string > search functions in particular) were a performance bottleneck on the > javascript backend. I fixed the issue by rewriting all uses of > BatReturn in Batteries libraries themselves. > Long-term, it would be better to have Javascript backends produce > better code on this, but I think it is rather difficult -- it is easy > to compile efficiently local exceptions that are raised in the same > basic block, but with_return takes a callback so you have to both > inline and specialize before you are within reach of the optimization. Sounds like something a PPX rewriter could solve. It could also avoid the need to manually scope it, if we accept the module-level let as the scope.