[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: new Cohttp interface progress

On 21 Aug 2012, at 15:18, Anil Madhavapeddy wrote:

> On 21 Aug 2012, at 07:01, Richard Mortier <Richard.Mortier@xxxxxxxxxxxxxxxx> 
> wrote:
>> i get that there are a number of different ways of implementing this, and of 
>> designing the apis to be used; but i don't yet completely understand why 
>> it's useful to abstract them all behind a single monad, and then allow the 
>> programmer to choose their own implementation.  and i certainly don't see 
>> that programmers are likely to be in a position to make an informed choice 
>> based on the performance impact of the implementation selected without going 
>> to a *lot* of work (possibly repeatedly).
>> though it does suggest, at least to me, that some sort of sensible automated 
>> performance simulation/monitoring framework would make sense, and would 
>> require a wrapping of this stuff in a monad of some kind. 
> Purely for portability, and not tie the core parsing unnecessarily to one
> of the (many) concurrency libraries out there.  One of the problems/features
> of Lwt is that it affects all the types so much by using it, due to Lwt.t
> going everywhere that could potentially block.  At this this way, it's a 
> somewhat more abstract one that can be ported to Async's Deferred.t or be
> replaced with a unit when it's not needed (i.e. if someone adds deferred
> cothreading to OCaml directly).

ok, i buy the portability argument to some extent, though i thought that we 
were trying to keep Lwt out of the core parsing libraries anyway, restricting 
it to "polluting" just the server/client code itself? 

having said all that, the discussion is rather moot if you've done it already 
:)  certainly, there's nothing lost by having another layer of abstraction so 
that the server and client code can abstract over the threading library.

(part of the reason i'm replying this notwithstanding the point above is to try 
and keep some idea of where the design is heading in my head given i have no 
time to hack right now... :(



This message and any attachment are intended solely for the addressee and may 
contain confidential information. If you have received this message in error, 
please send it back to me, and immediately delete it.   Please do not use, copy 
or disclose the information contained in this message or in any attachment.  
Any views or opinions expressed by the author of this email do not necessarily 
reflect the views of the University of Nottingham.

This message has been checked for viruses but the contents of an attachment
may still contain software viruses which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.