Problems implementing some basic machine instructions for a WAM based Prolog

Rereading some of the literature I quickly remember why I haven’t implemented the WAM, as noted the paper is lacking details that would make implementing a WAM straight forward. The tutorial paper tries to bridge the gaps and seems to be of use because others are making use of it and seem to be successful; I say seem because I have not tried to verify their version.

So it seems your problem, like many problems, is that you are on one side of a large canyon looking to get to the other side and you see a bridge, the problem is the bridge was made for giants who can take steps spanning 10 ft and you can only take steps of 2 ft. Then you find a paper that has boards the can span the 10 ft gaps but sadly they have holes in them and so only a person who can step 4 ft can use the boards. My suggestion is to find more papers that can fill in those gaps so that those 4 ft gaps become 2 ft. :smiley:

If you have been following along with some of my topics and replies you will see that I am working on implementing PostScript in Prolog which has some parallels to what you are doing, e.g. implementing a stack based VM. How I bridge the gaps is to use a bottom up design approach, make lots of test cases and am not afraid to throw out every line of code and start over if it is wrong. (That should be one of the golden rules of programming). I also like to make pictures, keep lots of references to documents and keep detailed comments in the code.

Also don’t forget to check the slides and errata.