Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3608800
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T21:32:48+00:00 2026-05-18T21:32:48+00:00

I remember once reading that there were at least two other alternatives invented roughly

  • 0

I remember once reading that there were at least two other alternatives invented roughly at the same time as the WAM. Any pointers?

  • 1 1 Answer
  • 2 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T21:32:49+00:00Added an answer on May 18, 2026 at 9:32 pm

    Prior to the WAM, there was the ZIP by Clocksin. Its design is still very interesting. SWI-Prolog uses it. And also B-Prolog has slowly migrated from a WAM design towards the ZIP. Of course, on that way many new innovations were developed. Another alternative is the VAM.

    A comparison as of 1993 is:

    http://www.complang.tuwien.ac.at/ulrich/papers/PDF/binwam-nov93.pdf

    In the meantime, the most interesting architectural developments are related to B-Prolog.

    WAM vs. ZIP

    The key difference between the WAM and the ZIP is the precise interface for a predicate’s arguments. In the WAM, the arguments are all passed via registers, that is, either real registers or at least fixed locations in memory. The ZIP passes all arguments via the stack.

    Let’s consider a minimal example:

    p(R1,R2,R3,L1,L2,L3) :-  % WAM                % ZIP
                             % store L1..L3       % nothing
                             % nothing            % push R1..R3
                             % init X1..X3        % push X1..X3
       q(R1,R2,R3,X1,X2,X3),
                             % put unsafe X1..X3  % push X1..X3
                             % load       L1..L3  % push L1..L3
       r(X1,X2,X3,L1,L2,L3).
    

    Prior to calling q:

    The WAM does not need to do any action for arguments that are passed on to the first goal at the very same positions (R1..R3). This is particularly interesting for binary clauses – that is, clauses with exactly one regular goal at the end. Here the WAM excels.

    The other arguments L1..L3 need to be stored locally. So for these arguments, the register interface did not do anything good.

    The ZIP on the other hand does not need to save arguments – they are already saved on the stack. This is not only good for clauses with more than one goal, but also for other interrupting goals like constraints or interrupts.

    As a downside, the ZIP must push again R1..R3.

    Both have to initialize X1..X3 and store them on the stack.

    Calling q:

    When calling q, the WAM has to allocate stack space for X1..X3 and L1..L3 thus 6 cells, whereas the ZIP needs R1..R3,L1..L3,X1..X3. So here, the WAM is more space efficient. Also, the WAM permits environment trimming (for more complex situations) which is next-to-impossible for the ZIP.

    Prior to calling r:

    This r is the last call, and systems try to free the space for this clause, provided no choice point is present.

    For the WAM, the existential variables X1..X3 have to be checked for being still uninstantiated local variables (put_unsafe), and if, they are moved onto the heap – that’s expensive, but occurs rarely. L1..L3 are just loaded. That’s all, the WAM can now safely deallocate the local frame. So last call optimization is dirt cheap.

    For the ZIP, everything has to be pushed as usual. Then only, an extra scan has to examine all the values on the stack and moves them accordingly. That’s rather expensive. Some optimizations are possible, but it is still much more than what the WAM does. ((A possible improvement would be to push arguments in reverse order. Then the variables L1..L3 might be left in their location. So these variables would not need any handling. I have not seen such an implementation (yet).))

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I remember reading once that there was a way to embed an image into
I remember reading once that .NET had a built in configSection handler that could
A long time ago I remember reading that you should always use the smallest
I remember reading in the spec once that both the id attribute and the
I think I remember reading once there is a way to navigate through the
I remember reading once that the order of the members of an evaluation is
I remember reading something once, but could not find it now while searching, if
I remember reading somewhere that Hadoop's performance deteriorates significantly if the machines it runs
I'm using ICEFaces 1.8. I remember that once I opened a Javascript window via
So i remember that i once did something in another project and (later removed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.