<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:Wingdings;
panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p.MsoListParagraph, li.MsoListParagraph, div.MsoListParagraph
{mso-style-priority:34;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:36.0pt;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;}
p.Code, li.Code, div.Code
{mso-style-name:Code;
margin-top:0cm;
margin-right:0cm;
margin-bottom:0cm;
margin-left:19.85pt;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.EmailStyle18
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;
font-family:"Calibri",sans-serif;
mso-fareast-language:EN-US;}
.MsoPapDefault
{mso-style-type:export-only;
margin-top:6.0pt;
margin-right:0cm;
margin-bottom:6.0pt;
margin-left:0cm;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
{page:WordSection1;}
/* List Definitions */
@list l0
{mso-list-id:134838301;
mso-list-type:hybrid;
mso-list-template-ids:2118423390 134807553 134807555 134807557 134807553 134807555 134807557 134807553 134807555 134807557;}
@list l0:level1
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level2
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level3
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level4
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level5
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level6
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
@list l0:level7
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Symbol;}
@list l0:level8
{mso-level-number-format:bullet;
mso-level-text:o;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:"Courier New";}
@list l0:level9
{mso-level-number-format:bullet;
mso-level-text:;
mso-level-tab-stop:none;
mso-level-number-position:left;
text-indent:-18.0pt;
font-family:Wingdings;}
ol
{margin-bottom:0cm;}
ul
{margin-bottom:0cm;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-GB" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Ah….It seems that to get unfoldings exposed in the
<b>module you are compiling</b> you need <b>both</b><o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-size:11.0pt;font-family:Symbol;color:#1F497D;mso-fareast-language:EN-US"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">-fno-omit-interface-pragmas<o:p></o:p></span></p>
<p class="MsoListParagraph" style="text-indent:-18.0pt;mso-list:l0 level1 lfo1"><![if !supportLists]><span style="font-size:11.0pt;font-family:Symbol;color:#1F497D;mso-fareast-language:EN-US"><span style="mso-list:Ignore">·<span style="font:7.0pt "Times New Roman"">
</span></span></span><![endif]><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">-fexpose-all-unfoldings<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">And GHCi and –O0 both imply –fomit-interface-pragmas.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">To see the unfoldings on
<b>imported</b> functions you need –fno-ignore-interface pragmas.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Arguably –fexpose-all-unfoldings should override –fomit-interface-pragmas, which it doesn’t at the moment. Open a ticket if you think
that would be useful and important. I can give guidance about the places.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Simon<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0cm 0cm 0cm 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> conal.elliott@gmail.com [mailto:conal.elliott@gmail.com]
<b>On Behalf Of </b>Conal Elliott<br>
<b>Sent:</b> 18 January 2016 17:47<br>
<b>To:</b> Simon Peyton Jones <simonpj@microsoft.com><br>
<b>Cc:</b> Edward Z. Yang <ezyang@mit.edu>; Andrew Farmer <afarmer@ittc.ku.edu>; ghc-devs@haskell.org<br>
<b>Subject:</b> Re: ghci and unfoldings?<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm">
That's the flag I would expect. It doesn't seem to help or hinder availability of unfoldings in GHCi. Do you think it should?<o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:12.0pt;margin-left:0cm">
And Happy Birthday, Simon!<o:p></o:p></p>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
Warmly, - Conal<o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
<br>
On Monday, January 18, 2016, Simon Peyton Jones <<a href="mailto:simonpj@microsoft.com" target="_blank">simonpj@microsoft.com</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal" style="mso-margin-top-alt:6.0pt;margin-right:0cm;margin-bottom:6.0pt;margin-left:0cm">
Or -fexpose-all-unfoldings?<br>
<br>
Simon<br>
<br>
| -----Original Message-----<br>
| From: ghc-devs [<a href="mailto:ghc-devs-bounces@haskell.org">mailto:ghc-devs-bounces@haskell.org</a>] On Behalf Of<br>
| Edward Z. Yang<br>
| Sent: 18 January 2016 06:37<br>
| To: Conal Elliott <<a href="mailto:conal@conal.net">conal@conal.net</a>><br>
| Cc: Andrew Farmer <<a href="mailto:afarmer@ittc.ku.edu">afarmer@ittc.ku.edu</a>>;
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
| Subject: Re: ghci and unfoldings?<br>
|<br>
| Does passing -fobject-code solve your problem?<br>
|<br>
| Edward<br>
|<br>
| Excerpts from Conal Elliott's message of 2016-01-17 22:18:49 -0800:<br>
| > Hi Brandon. Thanks for the reply. I’m not sure that it addresses<br>
| what<br>
| > I was trying to ask. GHCi *does* invoke plugins and even reloads<br>
| those<br>
| > plugins dynamically when their source code changes. So in this sense<br>
| > ghci does enable optimization, even if it doesn’t perform much<br>
| > optimization on its own. And of course plugins and unfolding are not<br>
| just about optimization.<br>
| ><br>
| > I’m not looking for ghci to do optimization, but rather to enable me<br>
| > to more easily develop my GHC plugins. It’s *almost* there already.<br>
| I<br>
| > just need access to unfoldings from other modules for my plugin’s<br>
| use.<br>
| ><br>
| > For context, I’m rebuilding my Haskell-to-hardware compiler<br>
| > <<a href="https://github.com/conal/talk-2015-haskell-to-hardware" target="_blank">https://github.com/conal/talk-2015-haskell-to-hardware</a>>, which<br>
| relies<br>
| > on giving a non-standard but principled interpretation of Haskell<br>
| > programs via a conversion through the language of cartesian closed<br>
| categories (CCCs).<br>
| > The first back-end is hardware generation (e.g., via Verilog), and I<br>
| > have plans for several other CCC-based interpretations.<br>
| ><br>
| > In addition to facilitating my plugin development, hosting in ghci<br>
| > will make it much more pleasant for others to *use* the plugin<br>
| during<br>
| > exploratory programming, just as with ghci use in general. With<br>
| access<br>
| > to unfoldings, users will be able to generate circuit diagrams and<br>
| > Verilog like those in my compiler talk immediately and directly from<br>
| > within ghci. I also intend to make a GPU back-end for fast<br>
| interactive<br>
| > graphics etc, which would be much more fun in ghci than with batch<br>
| compilation.<br>
| > I hope this explanation clarifies my goals and motivation. I hope<br>
| > there’s a way to access unfoldings from ghci currently or with a<br>
| small<br>
| > amount of effort.<br>
| ><br>
| > Regards, - Conal<br>
| ><br>
| > On Sun, Jan 17, 2016 at 7:00 PM, Brandon Allbery<br>
| <<a href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a>><br>
| > wrote:<br>
| ><br>
| > > On Sun, Jan 17, 2016 at 9:40 PM, Conal Elliott <<a href="mailto:conal@conal.net">conal@conal.net</a>><br>
| wrote:<br>
| > ><br>
| > >> I'm developing a GHC plugin (using HERMIT), and I'd like to use<br>
| > >> ghci to speed up development. I'm able to do so, except that my<br>
| > >> plugin critically needs access to unfoldings, which appear to be<br>
| > >> unavailable in ghci. A little experimenting with ghc shows me<br>
| that<br>
| > >> "-O" is the key, but "-O" is incompatible with "--interactive"<br>
| (as<br>
| > >> in ghci). Is there any way to persuade ghci to make unfoldings<br>
| available?<br>
| > ><br>
| > ><br>
| > > I think unfoldings are only done as part of optimization, and the<br>
| > > bytecode backend doesn't support optimization at all.<br>
| > ><br>
| > > --<br>
| > > brandon s allbery kf8nh sine nomine<br>
| > > associates<br>
| > > <a href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a><br>
| > > <a href="mailto:ballbery@sinenomine.net">ballbery@sinenomine.net</a><br>
| > > unix, openafs, kerberos, infrastructure, xmonad<br>
| > ><br>
| <a href="https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fsine" target="_blank">
https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fsine</a><br>
| > ><br>
| <a href="https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fnomine.net&data=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7cb669a024c5b84ab83f3008d3202f635e%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=7lx6Ayz03bCdiHv1O0TkKOrwNQNFYRUhHRCZR%2bAEPmg%3d" target="_blank">
nomine.net</a>&data=01%7c01%7csimonpj%<a href="https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2f40064d.mgd.microsoft.com&data=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7cb669a024c5b84ab83f3008d3202f635e%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=nLmnL5PxzSjH%2bo8TnPLfoWgC0ySSaNIYXxfY6gKBGLA%3d" target="_blank">40064d.mgd.microsoft.com</a>%7cbaf2ef5<br>
| > ><br>
| 5f8af447b42e608d31fd1cec1%7c72f988bf86f141af91ab2d7cd011db47%7c1&sda<br>
| > > ta=qMNmL5LmkgMp0ebkr6SzPQIwhySqOicZgEdW%2fhe6Q%2b0%3d<br>
| > ><br>
| _______________________________________________<br>
| ghc-devs mailing list<br>
| <a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
| <a href="https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail.h" target="_blank">
https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2fmail.h</a><br>
| <a href="https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2faskell.org&data=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7cb669a024c5b84ab83f3008d3202f635e%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=0GhykVs2C40ykmJwU2Yrq2D4kxV4hd%2bAtVoV%2b%2bMptPo%3d" target="_blank">
askell.org</a>%2fcgi-bin%2fmailman%2flistinfo%2fghc-<br>
| devs%0a&data=01%7c01%7csimonpj%<a href="https://na01.safelinks.protection.outlook.com/?url=http%3a%2f%2f40064d.mgd.microsoft.com&data=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7cb669a024c5b84ab83f3008d3202f635e%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=nLmnL5PxzSjH%2bo8TnPLfoWgC0ySSaNIYXxfY6gKBGLA%3d" target="_blank">40064d.mgd.microsoft.com</a>%7cbaf2ef55f8af<br>
| 447b42e608d31fd1cec1%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata=veoz<br>
| Ab6M7N9jZaJZ9tgXZ%2fI8jq7U%2b4YM1FcSXvqTcaw%3d<o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</body>
</html>