[racket] Pure functional Racket
5 hours ago, Cesar Barata wrote:
> Hi all,
>
> I would like to know if there's any Racket language that enforces
> pure funcional programming like Haskell does. I thought that using
> the "Languages as libraries" nature of Racket to provide a pure
> funcional language would be really useful to achieve a clean
> separation of pure modules and impure ones. Integration with typed
> and/or lazy racket would also be great.
How would it be useful? (Not a rhetoric question.)
The only thing I can think of is making it easy to refactor code, but
that doesn't look like it's enough of an advantage to make up a new
language.
Note, BTW, that making a language that is *completely* side-effect
free can be a little tricky. For example, you'd need to either forbid
`require' or implement one that cannot get any non-pure code in, since
you should forbid pure code from calling out to impure functions. As
Matthias said, the lazy language is impure too -- and it's related to
this: if you want it to be completely pure then you need to give up
being able to call out to non-pure code, which means that you lose
interoperability. (Or you need to somehow organize access to the
impure code as in monads or similar things.)
--
((lambda (x) (x x)) (lambda (x) (x x))) Eli Barzilay:
http://barzilay.org/ Maze is Life!