[racket] Pure functional Racket
25 minutes ago, Matthias Felleisen wrote:
>
> On Jul 6, 2011, at 9:16 PM, Eli Barzilay wrote:
>
> > How would it be useful? (Not a rhetoric question.)
>
> I can think of two and a half ways:
>
> 1. Haskell has had a tremendous benefit in putting a stake in the
> ground with "totally pure".
[You mean:
Totally pure!
*wink* *wink* *nudge* *nudge* *cough* unless you^W^W
Nah, it's totally pure. (Watch out! there's a giant tiger behind
you!)
]
> It's decision mechanism. It appears to be elegant. It is an
> easily remembered design slogan.
But there you get the benefit of a compiler that can take advantage of
this, and we don't. (Even if it does, it would require even more
subtle points like avoiding struct definintions, threads, exceptions,
continuations...)
> Try to come up with a slogan like that for Racket. (I still think
> we should say Racket is a programming language programming
> language.)
(I don't think I've seen that before... I remember Sam's "Racket is a
Programmable Language".)
> I suspect one would similar benefits from a call-by-value
> parenthesized macroized possibly typed Racket. I am sure monadic
> programming would be much easier with macros. I am also sure people
> will prefer call-by-value over lazy, especially if you bother with
> type classes or something like that.
>
> In short, it is an unexplored point in the design space and you
> never know what you find.
>
> 2. As you point correctly, it is a non-trivial task to ensure total
> purity: require is the first problem that comes to mind but I
> wouldn't be surprised if other reflection mechanism don't end up
> being in the way. It looks easy as in "require Racket, export
> only pure features" but for all we know, we may discover that we
> need to support other ways of restricting languages.
>
> 3. It would also be another playing field in exploring
> interoperability.
Yeah, that's what I was implying -- it would be interesting to have a
way to talk to an unpure world. In any case, if Cesar is aware of
this then that would definitely be an interesting experiment.
> The first exercise would be to define what purity is.
> I/O anyone? Is the world model from big-bang acceptable? How about
> files? CPS-IO? Monads?
>
> The second exercise would be to implement this core language.
> How many of the macros do you want to allow in, can you afford to
> allow in?
>
> The third one is probably to design a type system.
>
> The fourth one calls for macros.
>
> Someone go for it -- Matthias
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze is Life!