Hacker News new | past | comments | ask | show | jobs | submit login
Warren's Abstract Machine: A Tutorial Reconstruction (1991) [pdf] (sourceforge.net)
46 points by kbp on March 3, 2019 | hide | past | favorite | 6 comments



For those who are unfamiliar (as I was):

"The WAM is an abstract machine consisting of a memory architecture and instruction set tailored to Prolog. It can be realised efficiently on a wide range of hardware, and serves as a target for portable Prolog compilers."

(From the book's foreword.)


A few years back I was working on a WAM to LLVM compiler as a way to learn LLVM. Never fully finished my implementation, but this book really was an amazing reference. I particularly enjoyed the way the "tutorial style" that built up starting from a very simple language and explaining the design choices being made while extending the language to eventually become Prolog.

I don't know where the code is now, maybe I should make a point of digging it up and fixing it up to work with a recent versions of LLVM.


I spent a lot of the early 80s writing Prolog, first on DEC-10 Prolog and then on Quintus Prolog. Too bad this great document was not available back then!


is the WAM the best virtual machine for prolog or are there out better and newer approaches?


Also from the prologue,

"Although the WAM is a distillation of a long line of experience in Prolog implementation, it is by no means the only possible point to consider in the design space. For example, whereas the WAM adopts “structure copying” to represent Prolog terms, the “structure sharing” representation used in the Marseille and DEC-10 implementations still has much to recommend it."


There was substantial research in the 80s and 90s yield a few abstract machines for prolog. Most of them derived from the WAM I believe. See http://www.hpl.hp.com/techreports/Compaq-DEC/PRL-RR-36.pdf




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: