[racket-dev] promise vs polym contracts

From: Eli Barzilay (eli at barzilay.org)
Date: Tue Jul 10 23:33:28 EDT 2012

On Friday, Carl Eastlund wrote:
> 
> From in-person conversation, what's really going on here is that
> Matthias is talking about some other, imaginary language, not
> Racket, where _any_ primitive operation other than promise? forces
> any promises in its arguments.  In this language, promises are more
> like an implicit monad than a data structure.

To make it more concrete in a possibly more obscure way, I think that
he's talking about a world where you only need `lazy', not `delay'.
(Since the only point of the latter is being able to distinguish a
promise that forces to a promise.)  To put it differently, you don't
have to switch to the world where promises are forced implicitly
(that's the r5rs blurb that I said many times that it should be
removed since it's much more than just a footnote to a language), you
just need a world where being a `promise?' is something that concerns
only meta/introspective kind of code, as in Robby's followp.


On Saturday, Matthias Felleisen wrote:
> 
> The more general idea is that there is an alternative design space
> out there where you want 'boxes' that signal errors when touched by
> strict functions. You need these every time you want transparent
> transitions from one point in the computational spectrum to another.
> 
> ;; ---
> 
> And one more level up, I am thinking of selling Racket as a
> wide-spectrum programming language, the first one that introduces
> "safe" or "transparent" transitions properly.

To combine both of these and my general wish for how the lazy language
would evolve: it would be nice beyond words if there was some new
implicit `#%value' macro wrapped around places that require a value.
With that, an implementation of a lazy language would be trivial,
together with all of the related similar-in-spirit languages.

(To relate this to another recent thing -- having a no-value thing
that doesn't leak out is too restrictive for some uses (as I need to
write in the followup I promised), but a way to loosen that
restriction so you can pass around no-values and avoid a damaging leak
would be to make such a `#%value' check for them...  But that's of
course just vague hand-waving that would naively suffer from the same
perfomance problems...)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the dev mailing list.