MLton.Socket improvement

Stephen Weeks MLton@sourcelight.com
Mon, 17 Dec 2001 16:19:13 -0800


> I  like  combining  listen and listenAt into listen via the Port.t
> option.  

Great.  I expect to see that change and the other changes appearing in
the CVS repository any moment :-).

> I actually like the ide of eliminating the socket and having listen
> return a thunk, but as you say, the socket (that you do accepts on)
> is used in other calls, most notably close. 

Yeah, but that's hidden in the MLton.Socket interface, which relies on
closes of the iostreams that accept returns.  Their is no use of the
socket other than accept at the moment.

> Don't get me wrong, their socket interface seems grotesquely ugly to
> me compared to MLton's.

They enforce that you call {accept, bind, socket, ...} in the right
order using the type system, while MLton does it with abstraction.
Right now, their way has more functionality.  I'm not sure how close
we can get to them functionality-wise without getting as messy.  There
is something really annoying about their approach in that they need
yet another whole set of input and output functions.