[prev in list] [next in list] [prev in thread] [next in thread] 

List:       e-lang
Subject:    Re: [E-Lang] analogy between "when" and monads
From:       Dan Moniz <dnm () pobox ! com>
Date:       2001-08-17 18:33:09
[Download RAW message or body]

>The following idle thoughts on E and monads occurred to me recently.
>If you're not a languagemonger you can skip this message.

Ooh. Content that's right up my alley. Hi Jonathan!

>Has anyone else noticed the analogy between the E argument that says
>that message passing / event loop style is better than blocking / RPC
>style, on the one hand, and the functional programming community's
>basic position that monads are better than uncontrolled side effects?
>I just searched for "monad" at eros-os.org and didn't turn up
>anything.

Yup.

I posted a widely incoherent stream-of-consciouness that mentioned 
this idea (but only briefly at the very very end of what is otherwise 
a long, high level "what-if" of some concept of next generation 
Design by Contract in E) at 
<http://www.eros-os.org/pipermail/e-lang/2001-May/005259.html>

Paul Snively also had the same idea as you and I as noted at:

<http://wmf.editthispage.com/discuss/msgReader$4994?mode=day>

and my reply at:

<http://wmf.editthispage.com/discuss/msgReader$5008?mode=day>

I'm enthused someone besides me with more rigorous training in all of 
this (such as yourself and Paul) is considering and thinking about 
these sorts of ideas, if only to signify I'm on an interesting track.

As it stands, I have a very alpha monad I've hacked together. I'm 
using the Hugs interpreter on Mac OS 9, and I have it on good 
authority from a Haskell hacking friend who I converse with on #lisp 
that the best way to fully grok monads is to write lots and lots of 
them, and to utilize other people's. I've read all the relevant 
category theory basis I can find and I still prefer tweaking the code.

[snip]

>A similar argument is made when people outlaw reified continuations
>(Scheme call-with-current-continuation (CWCC)), as most programming
>languages do.  What -- capture the current control stack?  Doesn't
>that lead to unreadable and undebuggable programs?  This design
>position isn't usually seen as a limitation because CWCC is seen as
>terribly exotic and expensive, but structurally it's pretty much the
>same.

Unrelated, but potentially interesting, one of the example monads 
I've been using is a CPS (simple call-cc) monad. It's not my code, 
but I'll see if anyone else has it posted, of if there's any 
objection to sharing it.

Also unrelated, I've been engaged in an interesting discussion in 
#python with some other friends who are really dead set against 
non-linear continuations in Scheme. I don't really have an issue with 
continuations, linear or non-linear, but I'm an odd case in that Lisp 
(both CL and Scheme) is what I think in most of the time due to early 
exposure before things like C, etc. I have a hard time qualifying a 
good use for non-linear continuations in a bubble that could be 
easily expressed, but then, I don't have an issue with them to begin 
with. Both aforementioned friends refer to the following argument:

<http://lists.tunes.org/archives/tunes/1999-August/002235.html>

I understand this argument, I think, but I don't really reach the 
same conclusions as the author or my friends.

>Danvy and Filinski showed that having reified continuations in the
>language allows the conversion of arbitrary monads from explicit
>(pure) for to implicit (impure) form in a program.  In E, CWCC would
>be equivalent to RPC.  This is a fine reason why E can't have CWCC.

This is a good point, and one which I think has some larger scale 
effects outside of E and into secure systems in general.

>No point to make here.  I like all these things - E, FP, CWCC.

Likewise. ;]

P.S.: Should anyone be interested, both IRC channels cited above are 
from the OpenProjects IRC network, irc.openprojects.net. See 
<http://www.openprojects.net/> for more information.


-- 
Dan Moniz <dnm@pobox.com> [http://www.pobox.com/~dnm/]
_______________________________________________
e-lang mailing list
e-lang@mail.eros-os.org
http://www.eros-os.org/mailman/listinfo/e-lang

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic