http://greenrd.org/hetero/archives/2003_10_01_index.html#106651213785544169
(There is a bug in the blogger template - you will probably need to
scroll up a bit to read the full title.)
It's really quite a bizarre and interesting model in which: things
which normally could never work in a referentially transparent
language, namely "set" methods which don't return anything, are
reinterpreted as functions returning a state, and a Hansel and Gretel
method is used to keep track of what needs to be copied when a write
is performed.
Oh, and the semantics of the language change dynamically depending on
context. Which is why I say at the end this is only for advanced
programmers.
Unfortunately it's not described very clearly; I rushed it a bit
because I am trying to commit myself of a regime of at least one
weblog post every Saturday, and I had to explain the existing
functional sublanguage in my language before I could get onto the new
bit.
Feel free to reply either there or here; I will import replies from
here to there.
Tongue half in cheek: How about Haskell's IO monad, which can use
normal Haskell code just fine?
> http://greenrd.org/hetero/archives/2003_10_01_index.html#106651213785544169
> Oh, and the semantics of the language change dynamically depending on
> context. Which is why I say at the end this is only for advanced
> programmers.
Oh, ick.
WEB> However, pure mode is not semantically as different from normal
WEB> mode as you might expect. You can still use assignment statements
WEB> - for efficient algorithms, or even - what fun! - to create cyclic
WEB> reference graphs (something not possible in Clean or Haskell at the
WEB> direct reference level - as opposed to indirect references like
WEB> integers).
So why is "ones = 1:ones" not considered a cyclic reference graph?
Yeah, they are immutable...
Anyway, it's interesting, but it seems to be addressing problems that I,
for one, don't see.
--
Aaron Denney
-><-
Ralf Hinze and Johan Jeuring. 2001. Weaving a web. Journal of
Functional Programming 11(6): 681-689.
http://www.informatik.uni-bonn.de/~ralf/publications/TheWeb.ps.gz
Gérard Huet. 1997. The zipper. Journal of Functional Programming
7(5): 549-554.
Also, it is a well-explored research problem to distinguish between
pure and impure code in a single programming language. If you haven't
already, check out (the references in):
Philip L. Wadler. 1998. The marriage of effects and monads.
In ICFP '98: Proceedings of the ACM international conference
on functional programming, vol. 34(1) of ACM SIGPLAN Notices,
63-74. New York: ACM Press.
I apologize if you already know of these pointers -- I know very little
about what you have previous done or reviewed in these areas.
--
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
"Who needs drugs when we have sex and chocolate?" -- Cory Kerens