Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Graph Copy-on-Write: A new approach to combining imperative and RT functional styles

0 views
Skip to first unread message

Robin Green

unread,
Oct 18, 2003, 8:04:16 PM10/18/03
to
Further to my previous pontifications on this group on making an
imperative language with a pure functional sublanguage - thus
attempting to combine the best of both worlds and allow developers to
more freely use the best tool for the job without being tied down to
one or the other - I have refined my idea with a third mode, "Graph
Copy-On-Write", described in my weblog here:

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.

Aaron Denney

unread,
Oct 20, 2003, 12:39:42 AM10/20/03
to
In article <f9cd2ccc.03101...@posting.google.com>, Robin Green wrote:
> Further to my previous pontifications on this group on making an
> imperative language with a pure functional sublanguage

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
-><-

Ken Shan

unread,
Oct 19, 2003, 11:27:11 PM10/19/03
to
I want to make sure that you know of Huet's work on the zipper and Hinze
and Jeuring's follow-up work on the web.

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

0 new messages