<story><title>Using Prolog as the AST</title><url>https://marcellerusu.com/using_prolog_as_the_ast.html</url></story><parent_chain></parent_chain><comment><author>iot_devs</author><text>As very long term goal, I want to work on a project like this but on much larger scale.&lt;p&gt;I have a tiny prototype based on Go and soufflé.&lt;p&gt;The overall goal would be to figure out classical error conditions like nill pointers deference.&lt;p&gt;If I can figure out if a pointer will be nil in some execution branch, there is no reason why a computer cannot do the same.&lt;p&gt;However it is very hard work and the part I am currently stuck in is creating a reasonable abstraction level where I can reason (in soufflé) about code and not about an AST.&lt;p&gt;I personally would see this as an human race level upgrades. Imagine feeding your code to a CI that spit back something like: &amp;quot;you will have a panic at line 156 when your input is &amp;gt; 4&amp;quot;&lt;p&gt;Moreover we will be able to check the &amp;quot;real code&amp;quot; starting from main down to all execution paths. Which is much more powerful than current static analysis that usually analyse a single function without considering how the function itself is invoked.&lt;p&gt;Beside the actual implementation difficulties, the other big elephant in the room is the amount of resources needed to run this kind of analysis.&lt;p&gt;(I am less concerned about that as computation resources exploded due to AI and solving SAT is getting faster and faster)</text></comment>
<story><title>Using Prolog as the AST</title><url>https://marcellerusu.com/using_prolog_as_the_ast.html</url></story><parent_chain></parent_chain><comment><author>JimmyRuska</author><text>Racket made a prolog implementation that is currently used in the compiler, or at least I thought I heard that in one of their talks. Might be worth trying, since its model is a language for making languages&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;docs.racket-lang.org&amp;#x2F;datalog&amp;#x2F;&quot; rel=&quot;nofollow noreferrer&quot;&gt;https:&amp;#x2F;&amp;#x2F;docs.racket-lang.org&amp;#x2F;datalog&amp;#x2F;&lt;/a&gt;&lt;p&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;docs.racket-lang.org&amp;#x2F;racklog&amp;#x2F;&quot; rel=&quot;nofollow noreferrer&quot;&gt;https:&amp;#x2F;&amp;#x2F;docs.racket-lang.org&amp;#x2F;racklog&amp;#x2F;&lt;/a&gt;</text></comment>