<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Dec 12, 2021 at 3:54 PM Vanessa McHale <<a href="mailto:vamchale@gmail.com">vamchale@gmail.com</a>> 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>Have you tried the -xc flag yet?<br>
      <br></p></div></blockquote><div>Thanks for -xc option. Does program run without CPU overhead when -xc is off? I see that object file must be bigger, but CPU/RAM requirement is not clear.<br></div><div>-xc has <a href="https://gitlab.haskell.org/ghc/ghc/-/issues/20536">an issue</a> I encountered recently. Some libraries (e.g. directory) use exceptions for normal control flow.</div><div>So lots of stack traces could be produced. There is no control over what exception stack trace should be displayed.<br></div><div>The app is based on a Haskell interpreter to run user scripts.</div><div>It would be hard to understand such output for users.</div><div><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>
      If you do a profiling build and then run your program with +RTS
      -xc it will give a stack trace on exceptions. <br>
    </p>
    <p>(I think your idea still has some content but ^ is easier because
      it already exists!)<br>
    </p>
    <div>On 12/12/21 2:01 PM, Daneel Yaitskov
      wrote:<br>
    </div>
    <blockquote type="cite">
      
      <div dir="ltr">
        <div>Hi,</div>
        <div><br>
        </div>
        <div>I would like to enable stack traces at launch time and run
          program without HasCallStack overhead by default.</div>
        <div>I've got an idea to use GHC plugin which would duplicate
          all functions in modules with specified prefix. Duplicated
          functions should get disambiguating prefix (e.g. "debug") and
          HasCallStack constraint. Bodies of prefixed functions should
          be rewritten to use prefixed functions from matching modules
          (should be easy to do - hook just after renaming GHC phase
          when all names are fully qualified?).</div>
        <div><br>
        </div>
        <div>This way main function could choose "runLib" or
          "debugRunLib".</div>
        <div><br>
        </div>
        <div>Did anybody make something similar?<br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>-- <br>
          <div dir="ltr"><br>
            Best regards,<br>
            Daniil Iaitskov<br>
             <br>
            <br>
            <br>
          </div>
        </div>
      </div>
      <br>
      <fieldset></fieldset>
      <pre>_______________________________________________
Haskell-Cafe mailing list
To (un)subscribe, modify options or view archives go to:
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a>
Only members subscribed via the mailman list are allowed to post.</pre>
    </blockquote>
  </div>

_______________________________________________<br>
Haskell-Cafe mailing list<br>
To (un)subscribe, modify options or view archives go to:<br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
Only members subscribed via the mailman list are allowed to post.</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature"><br>Best regards,<br>Daniil Iaitskov<br> <br><br><br></div></div>