Replies: 7 comments 10 replies
-
Yes, it's a good book. The code examples it gives are in Lisp not C, but
the discussions are good and illustrative. Not so relevant to Trealla which
is more a traditional interpreter than a WAM-type compiler.
…On Thu, Jan 2, 2025 at 4:04 AM Jorge Gomez ***@***.***> wrote:
Hi,
Would you recommend this book as a good starting point for understanding
how to implement Prolog?
The Implementation of Prolog (Princeton Series in Computer Science) by
Patrice Boizumault
—
Reply to this email directly, view it on GitHub
<#652>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNKSETXFFXYBSXPUNHD5XL2IQU4NAVCNFSM6AAAAABUO3DM5OVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZXG43DQNRSGE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I doubt the source code would make sense to anyone 😆 as it's quite
ad-hoc, though i've tried to revise, organize and simplify it over
the last year or so.
…On Thu, Jan 2, 2025 at 11:14 AM Jorge Gomez ***@***.***> wrote:
Thanks for the information.
I'm fluent in Common Lisp so that won't be an issue for me. I've worked on
a number of Common Lisp projects.
What resources or books would you recommend for understanding the
implementation of Trealla besides just reading the source code and trying
to understand it with that approach.
I feel like I need to gain some more context before the Trealla source
code starts to make sense to me.
I am interested though in approaching the understanding required to do so.
—
Reply to this email directly, view it on GitHub
<#652 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNKSEXUI5T7J3IQPIYIBGT2ISHGXAVCNFSM6AAAAABUO3DM5OVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTCNZRGMYTIMI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
Hi, which book would you recommend for learning how to implement a WAM-type compiler? @infradig |
Beta Was this translation helpful? Give feedback.
-
As per initial comment...
If you're working in Lisp then maybe start here. I don't Lisp. |
Beta Was this translation helpful? Give feedback.
-
I started with a very simple Prolog interpreter, much like Adrian above. Then iterated more complex versions, trying different things. I will probably never attempt a WAM compiler though, plenty of options there already. Good luck, it's a very long & deep rabbit hole. |
Beta Was this translation helpful? Give feedback.
-
When I started out I wasn't aware of the WAM.
…On Tue, 18 Mar 2025, 13:23 Jorge Gomez, ***@***.***> wrote:
What made you not want to attempt a WAM compiler and instead go with your
own interpreter approach?
The WAM approach is convoluted in some way or something else?
—
Reply to this email directly, view it on GitHub
<#652 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFNKSERSSI4ZXTTMYQCEGPL2U6GULAVCNFSM6AAAAABUO3DM5OVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTENJTGI3TKNA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
More recently the code has become more 'inspired by' the WAM. For example compiling/inlinining control structures to static instructions during load. Clauses can have an alt form made of bytecodes instead of just goals. Meta goals like call/N & friends are also compiled just-in-time to bytes on the heap (though they are discarded as soon as possible). For example the first listing here shows the source-like form (in Prolog)...
whereas the second here shows the compiled/inlined form (as instructions)...
Note: 10 & 3 are offsets to jump in the instruction stream. The first is a conditional, the second unconditional. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Would you recommend this book as a good starting point for understanding how to implement Prolog?
The Implementation of Prolog (Princeton Series in Computer Science) by Patrice Boizumault
Beta Was this translation helpful? Give feedback.
All reactions