Why Prolog and CBV?
Date: Sun, 17 Nov 91 13:57:17 -0500
Date: Fri, 15 Nov 91 17:36:44 EST
From: John C. Mitchell <email@example.com>
Subject: Re: Why Prolog and CBV?
Date: Fri, 15 Nov 91 10:39:25 PST
What does seem to be the case is that if one integrates
effects into the language in roughly the style of ML (eg,
with ref types), then cbv is essentially forced on you for
reasons of determinacy.
I realize that this is accepted by many, but what is the mathematical
reason for it, if any? Leftmost evaluation is certainly deterministic.
If asked, I would make up some story about a call f(e), where e contains
an assignment, and say that with cbn it is hard to predict where in
the evaluation of the body of f this assignment would be done.
If the body of f assigns to or reads the same variable, it gets
confusing. Does anyone have a ready-made explanation that is more
precise, say involving proof rules?
It gets more than confusing: it gets non-CR. Consider
(set! x 3)
(lambda (u) x))
(set! x 4)
which gives different results depending on the order of evaluation of the
operator and operand. As we speak, this very debate is raging on
comp.lang.scheme, over the issue of the order of evaluation of arguments in
Scheme. I wish I could report that anything new or interesting was being said