[MLton-devel] Fwd: Mark Tuttle

Matthew Fluet fluet@cs.cornell.edu
Thu, 1 May 2003 15:33:41 -0400 (EDT)


> > MLton1 -- new io, imperative IO -> on top of stream IO
> > MLton2 -- new io, imperative IO -> on top of buffered IO and stream IO
>
> Can you explain a little more about the difference between these two?

Sure; in basis-library/io/text-io.sml$TextIO1 there is the following:

      structure ImperativeIO = ImperativeIOExtraFile(open S)
      structure FastImperativeIO = FastImperativeIOExtraFile(open S)
      open FastImperativeIO

ImperativeIOExtraFile defines
      datatype instream = In of SIO.instream ref

FastImperativeIOExtraFile defines
      datatype instream' = Buffer of BI.inbuffer
	                 | Stream of SIO.instream
      datatype instream = In of instream' ref

So, FIIO is like the old io, in that it uses an imperative buffer unless
the user extracts the underlying stream, in which case we drop down to
using stream io.  On the other hand, IIO always uses stream io.

> The numbers look pretty good for MLton2 to me.  Can you check and see
> if that's what I enabled?  I was unaware of the two possibilities.

The checked in version of text-io.sml enables MLton2 by opening
FastImperativeIO rather than ImperativeIO.



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel