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

Re: [MirageOS-devel] mirage configure & dynlink (was: V1 vs V2 mirage-types)



On 18 Nov 2014, at 19:03, Nicolas Ojeda Bar <no263@xxxxxxxxxxxxxxx> wrote:

> Hi list,
> 
> Very much related to the ongoing thread of V1 vs V2 is the tool
> `mirage configure`.
> Its role is to generate code to match particular implementations to
> signatures.  Right now this tool requires global knowledge of all the
> mirage libraries and needs to be updated in concert with any change in
> the set of exported signatures.
> 
> It seems to me that it would be better for each mirage library to
> manage its own code generation.  In this world, `mirage configure`
> would be a library of combinators used to write these code generators
> and the individual code generators would be loaded dynamically (using
> dynlink & findlib) at configure time.
> 
> I haven't thought through this idea, but I was wondering what other
> people thought about it.

not really a module/ocaml expert but my two penn'orth anyway: it does seem 
attractive to disperse the code generation to the libraries rather than 
centralising it in the mirage tool. this seems a good way to elide the whole 
V1/V2 thing entirely.

the question that occurs to me is: is there enough commonality in the code 
currently being generated that some kind of standard protocol can be defined?  
(i guess this is the set of combinators?)  after a quick glance through a 
sample main.ml it seems this might be possible, though i might easily be 
missing something. the kind of generated code in there appears to be of four 
forms:

let vn () = Vn.connect "n"
module M = Server.Main(V1)(V2)...(Vn)
module D = Dd.Make(Dm1)...(Dmn)
let d () = 
        v1 () >>= function `Error e -> fail (Failure "v1") | `Ok v1 -> 
        v2 () >>= function ... ->
        ... ->
        return (`Ok (v1, v2, ..., vn))

which looks like everything should knows what it depends on so you could 
specify the way things get built up in the config.ml and then call the 
per-library code generators.


-- 
Cheers,

R.




Attachment: signature.asc
Description: Message signed with OpenPGP using GPGMail

_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

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