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 6309A8003B for ; Sat, 12 Nov 2016 17:36:19 +0100 (CET) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=gabriel.scherer@gmail.com; spf=Pass smtp.mailfrom=gabriel.scherer@gmail.com; spf=None smtp.helo=postmaster@mail-it0-f53.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of gabriel.scherer@gmail.com) identity=pra; client-ip=209.85.214.53; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of gabriel.scherer@gmail.com designates 209.85.214.53 as permitted sender) identity=mailfrom; client-ip=209.85.214.53; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="gabriel.scherer@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-it0-f53.google.com) identity=helo; client-ip=209.85.214.53; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="gabriel.scherer@gmail.com"; x-sender="postmaster@mail-it0-f53.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3A3SF1hxckDMZx/I2hHiY7bbJ8lGMj4u6mDksu8pMi?= =?us-ascii?q?zoh2WeGdxcW9Zh7h7PlgxGXEQZ/co6odzbGH6Oa4BidQsN6oizMrSNR0TRgLiM?= =?us-ascii?q?EbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVr?= =?us-ascii?q?O+/7BpDdj9it1+C15pbffxhEiCCzbL52Ihi6txndu8sZjYZhLqs61wfErGZPd+?= =?us-ascii?q?lK321jOEidnwz75se+/Z5j9zpftvc8/MNeUqv0Yro1Q6VAADspL2466svrtQLe?= =?us-ascii?q?TQSU/XsTTn8WkhtTDAfb6hzxQ4r8vTH7tup53ymaINH2QLUpUjms86tnVBnlgz?= =?us-ascii?q?ocOjUn7G/YlNB/jKNDoBKguRN/xZLUYJqIP/Z6Z6/RYM8WSXZEUstXSidPAJ6z?= =?us-ascii?q?b5EXAuUDM+ZWr4fzqVgToxWgGQahH/ngxiNSi3LswaE2z+YsHAfb1wIgBdIOt3?= =?us-ascii?q?HUoc30OqgISu+11qjIwivHb/hLxDny9IjIfQ47of6SR7J7bM3cyUY1GAzelFWQ?= =?us-ascii?q?qJLqPzeP2uQWr2eb7/RvVfixhG49sAxxrT2vyd0tionNnI4a1lfE9SBgzYszON?= =?us-ascii?q?a2Rkl7Ydu+H5tRsSGXL4p2QsU4Q2Fpoik20LMGuYSjcCgFyZQn2x7fa+GcfISS?= =?us-ascii?q?4xLjU/6dITNii3JgY72wmgy9/VG8yu38SMa4yUtKri5ZktnNs3ACzQDT5dadRv?= =?us-ascii?q?t65Eeh1i6D2BzJ5eFBO0w7j7bUJ4Q8wr4zjpYSv1rMHjLtmErolK+WeV0k9vKp?= =?us-ascii?q?6+ThbLXmoYeQN4h3igH7M6QumNazAeMiMggBWWWQ5Oey1KX78EHnXLlHiuc6n6?= =?us-ascii?q?rZvZzAO8gXu6G0DxVV34st7Ru0Ei2o384CnXYdKVJIYBKHgJbtO1HJOP34CO2w?= =?us-ascii?q?g1WokDtyxvDGIqHtDozDLnXDnrrtZ7l960lbyAo8ydBQ+YhYBa0GIPL2QkPxtd?= =?us-ascii?q?rYAQElMwGs3errFNFw2pkdVG+PGKOVLr7evFCS6u8vLeSAfIoVtyz8K/gh6f7u?= =?us-ascii?q?l3g5mVoFcKmmx5QYc2q4HvV4LEWde3bsmcsOEWcUsQokUuPqkkaPUTFWZ3moXq?= =?us-ascii?q?I84is3B56hDYfGXoytmqCO3D+nHp1KYWBLEkyDHm3td4WAQvsMbCOSItR9kjEf?= =?us-ascii?q?TrigS4oh1Qm0uwPgyrpnKPDU+iwCup752th1/b6bqRZnzj1xCMLV+HuQRmd5hS?= =?us-ascii?q?tcXD4z26Y5qlZgw1GOyu4i26QHPdkP97VOSAhsZrDGyOkvJNn4QAPMep+yQ1ar?= =?us-ascii?q?WNi8SWU+R9grwtIKJV12G9i4gwrr0C+jArtTnLuOUs9nupnA1mT8cp4ug03N07?= =?us-ascii?q?Ms2hx/GpNC?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0AKAgAbRCdYfzXWVdFdFgYBAQQBAQoBA?= =?us-ascii?q?RcBAQQBAQoBAYMGAQEBAQE9OoEAB6RBgmCFe4ZphRyCByiFewKCBQdAEwEBAQE?= =?us-ascii?q?BAQEBAQEBEgEBCQsLCRsygjMaAYIUAQEDARIRHQEbGAUBAwELBgMCCzcCAiIBE?= =?us-ascii?q?QEFARwGExQOiCQBAw8IDpFtj1KBMj8yi1CCBAUBH4MLBYNTChknDVSDPAEBAQE?= =?us-ascii?q?BBQEBAQEBAQEYAgYQhiyEWoF+UxOCEYJXgl0Fj1yKZYFvhE2KIYI+jWKNRIJHE?= =?us-ascii?q?x6BEg8RAoEaOAuCWyyCJiA0AQGIBgEBAQ?= X-IPAS-Result: =?us-ascii?q?A0AKAgAbRCdYfzXWVdFdFgYBAQQBAQoBARcBAQQBAQoBAYM?= =?us-ascii?q?GAQEBAQE9OoEAB6RBgmCFe4ZphRyCByiFewKCBQdAEwEBAQEBAQEBAQEBEgEBC?= =?us-ascii?q?QsLCRsygjMaAYIUAQEDARIRHQEbGAUBAwELBgMCCzcCAiIBEQEFARwGExQOiCQ?= =?us-ascii?q?BAw8IDpFtj1KBMj8yi1CCBAUBH4MLBYNTChknDVSDPAEBAQEBBQEBAQEBAQEYA?= =?us-ascii?q?gYQhiyEWoF+UxOCEYJXgl0Fj1yKZYFvhE2KIYI+jWKNRIJHEx6BEg8RAoEaOAu?= =?us-ascii?q?CWyyCJiA0AQGIBgEBAQ?= X-IronPort-AV: E=Sophos;i="5.31,627,1473112800"; d="scan'208,217";a="200129051" Received: from mail-it0-f53.google.com ([209.85.214.53]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 12 Nov 2016 17:35:50 +0100 Received: by mail-it0-f53.google.com with SMTP id q124so29230595itd.1 for ; Sat, 12 Nov 2016 08:35:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=UWSrNUDUxgXXdr9unbxEbPPDfHYMglbr41J2hwxnL08=; b=MoB8IqN4xETljYFuIHlbXg3JH1CZhr8kGAoJc8ZI/tHj+3j6ymWdflH2RVdv1ZbYSi VtRI1r/0spYH+lox9q1PRcETqxV/sZDDMQnDvuilJzUjVZVTufq/K9/O6qxcfxqGozli 3BqO0BFyN0WdkN61m8saJRrwRDeWyqffBnVEUyv0oZ16PO1UgTVmr+jiNKpEKwWJFXc5 xaTH3R9zzI+mjQu7k/I/nKRjs4WhePjdzJJ1YuYFOXkOxMP3xbJR1uhA2vxSvf9XPq7a tksZt0JYoRl0aKtZryFj5C+hTqKV+AJdBlO6z9Hth4TBSsZJF14cR5Fr5+nHmWay+SIh 77PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=UWSrNUDUxgXXdr9unbxEbPPDfHYMglbr41J2hwxnL08=; b=X8yVMgIa4iTJ/5PiIgfVVfWCo0UKT2FFNtZgCynFH4br/ruK+to9R/8vepBeExpp67 THny5YIMfVKVc9eZN3eXelrXmkiMjY/kLneXW2h+vLNx/tEgwsyEe7WVFC5JYN2L0NVM qvKbTHX3qnOk/oR4VpsRTFYSOAc7z+T69l1EpCTV9ToQTan1jv2O6JY/CHVk/qeozQqx LkOcbc27BzkB/2W4R7EfXz60u03cm7tx1ZfJV4ukMSDc1tzKd5d/bXri+lr/4sKhhM/Q VoApM7+G2b1NfZ6p1Xy5Mm9i7hyVPytDVZtOK2ZFvbv4oAklp10RldN4P57B7xbUoFRm aokw== X-Gm-Message-State: ABUngvcju7nJL1dC5RTRQXTxOs9b+1Ht1JCIq5karVIUzidamP7AIb5+xS99iu8VGQuQtbG9WyyIwVzGjYcvCw== X-Received: by 10.107.134.26 with SMTP id i26mr17564261iod.182.1478968549095; Sat, 12 Nov 2016 08:35:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.79.18.131 with HTTP; Sat, 12 Nov 2016 08:35:08 -0800 (PST) In-Reply-To: <20161112162107.GB24883@carty.home> References: <20161112130134.GA3313@Magus.localnet> <20161112162107.GB24883@carty.home> From: Gabriel Scherer Date: Sat, 12 Nov 2016 11:35:08 -0500 Message-ID: To: Simon Cruanes Cc: Oleg , Yaron Minsky , caml users , Gregory Malecha Content-Type: multipart/alternative; boundary=001a113ecf3400c0cc05411d3307 Subject: Re: [Caml-list] The fastest stream library [Was: Question about --001a113ecf3400c0cc05411d3307 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable In case anyone on the list wonders about MetaOCaml ( http://okmij.org/ftp/ML/MetaOCaml.html ), an excellent resource to learn about it is Jeremy Yallop's course on staging (as part of an Advanced Functional Programming course at Cambridge, https://www.cl.cam.ac.uk/teaching/1415/L28/materials.html ), presented as an IOCamlJS notebook: http://ocamllabs.github.io/iocamljs/staging.html http://ocamllabs.github.io/iocamljs/staging2.html http://ocamllabs.github.io/iocamljs/staging3.html The last discussion about whether MetaOCaml could eventually be merged into OCaml that I'm aware of happened in May 2015: http://lambda-the-ultimate.org/node/5146 . At the time, Oleg replied that there are still design aspects of (BER) MetaOCaml that he was not fully satisfied with, and wanted to wait before proposing it for upstreaming. (There is a virtuous interaction between MetaOCaml and modular implicits; in particular, one pain point of MetaOCaml's design is cross-stage persistence (should it be a language construct or a derived operation?), and implicits make it much more convenient to define and use persistence operators.) On Sat, Nov 12, 2016 at 11:21 AM, Simon Cruanes wrote: > Using meta-programming is very nice indeed, but until meta-OCaml is > merged into OCaml itself, it will be no use for most OCaml programmers > (at least, those I know of). So it still makes sense to write > alternative stream libraries that do not rely on metaprogramming nor on > features yet to come (effects=E2=80=A6). For pure OCaml libraries, there = is no > clear winner yet (depends on what API is exposed), Sequence is faster in > most cases but cannot implement zip/merge, BatSeq/Core.Sequence are good > in average and probably the best tradeoff overall, Enum is a bit > complicated but quite comprehensive=E2=80=A6 > > Le Sat, 12 Nov 2016, Oleg a =C3=A9crit : > > Gabriel, > > > > Thank you for the detailed and thoughtful message and the > > motivations behind Enum choices. The library and language design was > > the central issue in our paper. We do have a different overall > > approach, which you haven't yet touched. The approach is > > meta-programming. > > > > It is high-performance community who discovered for themselves > > that the most promising way to increase or maintain performance is by > > meta-programming. It was late Ken Kennedy (of High-Performance Fortran > > fame) who came with telescoping languages and popularized the idea of > > active libraries. It was again Ken Kennedy who coined the phrase > > ``abstraction without guilt''. The references (in old, by now) paper > > make the case that become even clearer by now > > http://www-rocq.inria.fr/~acohen/publications/CDGHKP06.ps.gz > > > > Thus we can have a very general interface and still very efficient > > implementation. We can have a pure functional, a fully compositional > > interface and a very tangled, imperative implementation with > > -- > Simon Cruanes > > http://weusepgp.info/ > key 49AA62B6, fingerprint 949F EB87 8F06 59C6 D7D3 7D8D 4AC0 1D08 49AA > 62B6 > --001a113ecf3400c0cc05411d3307 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
In case anyone on the list wonders about MetaOCaml ( = http://okmij.org/ftp/ML/= MetaOCaml.html ), an excellent resource to learn about it is Jeremy Yal= lop's course on staging (as part of an Advanced Functional Programming = course at Cambridge, https://www.cl.cam.ac.uk/teaching/1415/L28/materials.html ), presented as an IOCamlJS notebook:

=C2=A0
http://ocamllabs.github.io/iocamlj= s/staging.html
=C2=A0 http://ocamllabs.github.io/iocamljs/staging2.html
= =C2=A0 http:/= /ocamllabs.github.io/iocamljs/staging3.html

The last discu= ssion about whether MetaOCaml could eventually be merged into OCaml that I&= #39;m aware of happened in May 2015: http://lambda-the-ultimate.org/node/5146 . At the time, = Oleg replied that there are still design aspects of (BER) MetaOCaml that he= was not fully satisfied with, and wanted to wait before proposing it for u= pstreaming.

(There is a virtuous interaction between= MetaOCaml and modular implicits; in particular, one pain point of MetaOCam= l's design is cross-stage persistence (should it be a language construc= t or a derived operation?), and implicits make it much more convenient to d= efine and use persistence operators.)


On Sat, Nov 12, 2016 at = 11:21 AM, Simon Cruanes <simon.cruanes.2007@m4x.org> wrote:
Using meta-programming is very n= ice indeed, but until meta-OCaml is
merged into OCaml itself, it will be no use for most OCaml programmers
(at least, those I know of). So it still makes sense to write
alternative stream libraries that do not rely on metaprogramming nor on
features yet to come (effects=E2=80=A6). For pure OCaml libraries, there is= no
clear winner yet (depends on what API is exposed), Sequence is faster in
most cases but cannot implement zip/merge, BatSeq/Core.Sequence are good
in average and probably the best tradeoff overall, Enum is a bit
complicated but quite comprehensive=E2=80=A6

Le Sat, 12 Nov 2016, Oleg a =C3=A9crit :
> Gabriel,
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Thank you for the detailed and though= tful message and the
> motivations behind Enum choices. The library and language design was > the central issue in our paper. We do have a different overall
> approach, which you haven't yet touched. The approach is
> meta-programming.
>
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0It is high-performance community who = discovered for themselves
> that the most promising way to increase or maintain performance is by<= br> > meta-programming. It was late Ken Kennedy (of High-Performance Fortran=
> fame) who came with telescoping languages and popularized the idea of<= br> > active libraries. It was again Ken Kennedy who coined the phrase
> ``abstraction without guilt''. The references (in old, by now)= paper
> make the case that become even clearer by now
>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ht= tp://www-rocq.inria.fr/~acohen/publications/CDGHKP06.ps.gz
>
> Thus we can have a very general interface and still very efficient
> implementation. We can have a pure functional, a fully compositional > interface and a very tangled, imperative implementation with

--
Simon Cruanes

http= ://weusepgp.info/
key 49AA62B6, fingerprint 949F EB87 8F06 59C6 D7D3=C2=A0 7D8D 4AC0 1D08 49A= A 62B6

--001a113ecf3400c0cc05411d3307--