<div dir="ltr">If you're interested I have a <a href="https://github.com/polux/abstract-interpreters/blob/master/src/Main.hs">draft implemetation of that paper</a> in Haskell that uses monad transformers. There's <a href="https://github.com/josefs/AbstractingDefinitionalInterpreters">another one</a> online that uses effect handlers. The <a href="https://github.com/plum-umd/abstracting-definitional-interpreters">original scheme implementation</a> is also available. <div><br></div><div>A caveat: while playing with my implementation I found some issue with the GC as described in the paper and was able to reproduce on the reference implementation: <a href="https://github.com/plum-umd/abstracting-definitional-interpreters/issues/82">https://github.com/plum-umd/abstracting-definitional-interpreters/issues/82</a>. I'm not knowledgeable enough to understand whether this is a flaw of the approach or something that can be easily fixed.</div><div><br></div><div>Paul</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Nov 29, 2018 at 3:31 PM Carter Schonwald <<a href="mailto:carter.schonwald@gmail.com">carter.schonwald@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div><div dir="auto">Most parser libraries in Haskell provide facilities for including source information. </div></div><div dir="auto"><br></div><div dir="auto">And then you include in your syntax tree extra fields for those positions. </div><div dir="auto"><br></div><div dir="auto">Simple as that </div></div><div dir="auto"><br></div><div dir="auto"><br></div><div dir="auto">The paper : </div><div dir="auto"><div><a href="http://david.darais.com/assets/papers/abstracting-definitional-interpreters/adi.pdf" target="_blank">http://david.darais.com/assets/papers/abstracting-definitional-interpreters/adi.pdf</a></div>Is a great reference for how to add a bunch of program analysis features after you have a working interpreter .  Also it’s citations show a bunch of ways you can Add different flavored of anayses </div><div><div><br><div class="gmail_quote"><div dir="ltr">On Mon, Nov 26, 2018 at 3:37 PM Olaf Klinke <<a href="mailto:olf@aatal-apotheke.de" target="_blank">olf@aatal-apotheke.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> Hello Olaf,<br>
> <br>
> to me that sounds as if you want to do an abstract interpretation with a <br>
> forward collecting semantics that employs non-relational abstract <br>
> domains for the primitive data types and summarizes the dimensions of <br>
> arrays.<br>
...<br>
> I would start by writing a simple interpreter for the language to be <br>
> analyzed. That way you fix messy details before they bite you, e.g. the <br>
> order in which submodules are loaded and initialized.<br>
<br>
I was hoping not having to write an interpreter (because the language author wrote a translation to C++ already), but if that is the way to go, I'll do it. As I understand it, the Haskell semantics should contain just enough substance so that the errors I am after will cause hiccups in the Haskell compiler? That is indeed a compelling approach. <br>
What this does not address is the question about error reporting:  How could a translation to Haskell preserve information about scope, source position and masking? Can I leverage the ghc API for that? <br>
<br>
Regards,<br>
Olaf<br>
_______________________________________________<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></div>
</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>