[jhc] Re: darcs patch: try to abstract IO a bit
David Roundy
droundy at darcs.net
Sat Sep 5 12:37:08 EDT 2009
Sorry, this patch is missing a crucial element. Please wait for an
amended patch...
David
On Sat, Sep 5, 2009 at 10:54 AM, David Roundy<droundy at darcs.net> wrote:
> Hi John,
>
> This is an attempt to move towards the point where I could try
> implementing concurrent IO. I am not sure whether this approach will
> work at all, so I'll appreciate your feedback. I'll probably send a
> separate email with more details on what I'm thinking.
>
> This patch is essentially a cleanup, which moves the newtype of IO
> into Jhc.IO and avoids exporting its constructor. The hope is that
> I can later change the type of IO, perhaps to something like
>
> newtype OldIO a = IO (World__ -> (# World__, a #))
>
> newtype IO a =
> IO { runIO :: (a -> ThreadState -> OldIO ()) -- ^ a continuation
> -> ThreadState -- ^ the current state
> -> OldIO () } -- ^ the combined computation
>
> although I'd also want to figure out how to work exceptions into the
> picture.
>
> Anyhow, I think this patch is reasonable on its own. My greatest
> uncertainty at the moment due to my lack of understanding of how you
> deal with FFI calls. i.e. how is the code for a delcaration like
>
> foreign import ccall "stdio.h jhc_utf8_putc" c_putc :: Ptr CFile -> Int -> IO ()
>
> generated? I imagine that some work will have to happen in the core
> compiler in order for this import to generate a call to Jhc.IO.io
> (which is what I'd like).
>
> That's all for now... I'm off to have brunch. :)
>
> David
>
> Sat Sep 5 10:45:15 EDT 2009 David Roundy <droundy at darcs.net>
> * try to abstract IO a bit
>
>
--
David Roundy
More information about the jhc
mailing list