RE: Performance of pattern synonyms
Are you as convinced as you were of the semantics of pattern synonyms? I can see they are the right semantics given a run-time implementation but the alternative compile-time implementation has a lot to recommend it. What exactly is "the alternative compile-time implementation"? Remember, although pattern synonyms are set up to call a matching function, that matching function is often inlined, which reduces the overhead to zero. I say "often" inlined. An INLINE pragma for pattern synonyms would be a good feature. Widening to ghc-devs. Simon From: Matthew Roberts <matthew.roberts@mq.edu.au> Sent: 11 February 2019 00:10 To: matthew.pickering@cs.ox.ac.uk; gergo@erdi.hu; Simon Peyton Jones <simonpj@microsoft.com>; rae@cs.brynmawr.edu Subject: Performance of pattern synonyms Hi all, I am working with someone on a compile-time pattern matching extension and the most important prior work is pattern synonyms in Haskell. I hope you might indulge a couple of questions I have not been able to answer myself from the literature: * [In my testing](http://pattern-benchmarks.herokuapp.com/posts/2019-02-09-peano.html<https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fpattern-benchmarks.herokuapp.com%2Fposts%2F2019-02-09-peano.html&data=02%7C01%7Csimonpj%40microsoft.com%7Cf4d58b9dd66c476d591a08d68fb549cd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636854406149018023&sdata=uehvVhVMCpNiYWp7Lr2pRLGqVSqt3gQTACl2kvS9crg%3D&reserved=0>), pattern synonyms have remarkable performance, has anyone ever benchmarked them before? * Do you have - on hand - the hackage data you used in investigating uses of pattern synonyms? I am looking for real-world usage of pattern matching extensions. * Are you as convinced as you were of the semantics of pattern synonyms? I can see they are the right semantics given a run-time implementation but the alternative compile-time implementation has a lot to recommend it. Thanks for your time, Matt Roberts Department of Computing, Macquarie University
On Feb 11, 2019, at 8:55 AM, Simon Peyton Jones <simonpj@microsoft.com> wrote:
What exactly is “the alternative compile-time implementation”?
In my response, I interpreted this to be macro-expansion, the alternative we discuss in the paper. The paper includes a nice discussion of how the semantics differs between what we currently have and macro-expansion. Richard
I'm looking at these links, but i'm actually having a hard time finding the actual different definitions of this microbenchmark... On Mon, Feb 11, 2019 at 9:22 AM Richard Eisenberg <rae@cs.brynmawr.edu> wrote:
On Feb 11, 2019, at 8:55 AM, Simon Peyton Jones <simonpj@microsoft.com> wrote:
What exactly is “the alternative compile-time implementation”?
In my response, I interpreted this to be macro-expansion, the alternative we discuss in the paper. The paper includes a nice discussion of how the semantics differs between what we currently have and macro-expansion.
Richard _______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
participants (3)
-
Carter Schonwald -
Richard Eisenberg -
Simon Peyton Jones