<div dir="ltr"><div>Hello,</div><div><br></div><div>In theory the ext-stg interpereter could be used to run TH, but it is not done yet.</div><div>I'm interested in optimization much much more, but I deliberately designed the ext-stg ir/tooling to be simple and easy to use and understand for others so that an average Haskell programmer could implement his ideas or do his experiment.</div><div>I'm also open for discussion about the possibilities. We can have a video meeting about this if you'd like to.</div><div><br></div><div>Cheers,</div><div>Csaba<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 12, 2021 at 7:57 PM John Ericson <john.ericson@obsidian.systems> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
  
    
  
  <div>
    <p>Indeed it is!</p>
    <p>I also am very much hoping this can be the missing piece we need
      to allow Template Haskell to work with a stage 0 GHC, so that we
      can safely use TH in GHC itself even when the ABI is changing. See
      <a href="https://github.com/ghc-proposals/ghc-proposals/issues/162" target="_blank">https://github.com/ghc-proposals/ghc-proposals/issues/162</a> for
      details, where I've also linked Csaba's blog post. (And maybe also
<a href="https://gitlab.haskell.org/ghc/ghc/-/wikis/cross-compilation/roadmap" target="_blank">https://gitlab.haskell.org/ghc/ghc/-/wikis/cross-compilation/roadmap</a> for
      more background, and related things like
      <a href="https://github.com/ghc-proposals/ghc-proposals/pull/412" target="_blank">https://github.com/ghc-proposals/ghc-proposals/pull/412</a>.)</p>
    <p>TH could perhaps be used to replace some of the ad-hoc code gen
      we have for e.g. RTS constants and primops. This in turn would
      simplify the build system, allowing for `cabal install ghc` to
      work without shipping generated Haskell code in the sdist.<br>
    </p>
    <p>John<br>
    </p>
    <div>On 4/12/21 4:51 AM, Simon Peyton Jones
      via ghc-devs wrote:<br>
    </div>
    <blockquote type="cite">
      
      
      
      <div>
        <p class="MsoNormal"><span>That’s
            extremely impressive, Csaba.<u></u><u></u></span></p>
        <p class="MsoNormal"><span><u></u> <u></u></span></p>
        <p class="MsoNormal"><span>Maybe
            of interest to folk who have been thinking about “fat
            interface files”.<u></u><u></u></span></p>
        <p class="MsoNormal"><span><br>
            Simon<u></u><u></u></span></p>
        <p class="MsoNormal"><span><u></u> <u></u></span></p>
        <div style="border-color:currentcolor currentcolor currentcolor blue;border-style:none none none solid;border-width:medium medium medium 1.5pt;padding:0cm 0cm 0cm 4pt">
          <div>
            <div style="border-color:rgb(225,225,225) currentcolor currentcolor;border-style:solid none none;border-width:1pt medium medium;padding:3pt 0cm 0cm">
              <p class="MsoNormal"><b><span lang="EN-US">From:</span></b><span lang="EN-US"> ghc-devs
                  <a href="mailto:ghc-devs-bounces@haskell.org" target="_blank"><ghc-devs-bounces@haskell.org></a>
                  <b>On Behalf Of </b>Csaba Hruska<br>
                  <b>Sent:</b> 10 April 2021 11:49<br>
                  <b>To:</b> GHC developers <a href="mailto:ghc-devs@haskell.org" target="_blank"><ghc-devs@haskell.org></a><br>
                  <b>Subject:</b> External STG Interpreter blog post<u></u><u></u></span></p>
            </div>
          </div>
          <p class="MsoNormal"><u></u> <u></u></p>
          <div>
            <div>
              <p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">Hello,<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm"><u></u> <u></u></p>
            </div>
            <div>
              <p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">I've
                written a blog post about GHC-WPC's external stg
                interpreter.<br>
                <a href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.patreon.com%2Fposts%2Fexternal-stg-49857800&data=04%7C01%7Csimonpj%40microsoft.com%7C1535f88608f549dabb8108d8fc0e4c3f%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637536486264337310%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=VXa%2FhDs1ePRS5NTu04buv42yj%2BFKw%2FJzBLQJSwp8qTs%3D&reserved=0" target="_blank">https://www.patreon.com/posts/external-stg-49857800</a><u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">Feedback
                is welcome.<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm"><u></u> <u></u></p>
            </div>
            <div>
              <p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">Cheers,<u></u><u></u></p>
            </div>
            <div>
              <p class="MsoNormal" style="margin-right:0cm;margin-bottom:6pt;margin-left:0cm">Csaba<u></u><u></u></p>
            </div>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
ghc-devs mailing list
<a href="mailto:ghc-devs@haskell.org" target="_blank">ghc-devs@haskell.org</a>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs</a>
</pre>
    </blockquote>
  </div>

</blockquote></div>