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

Re: [MirageOS-devel] modifying mirage types

> On 19 Dec 2014, at 02:23, Ania Skorupa <ania.skorupa@xxxxxxxxx> wrote:
> hi,
> can someone kindly help how I can modify and apply mirage types in V1

Hi Ania,

You can use the OPAM pinning workflow [1] to modify mirage-types.  In a 

    git clone git://github.com/mirage/mirage
    opam pin add mirage-types mirage/
    opam pin add mirage mirage/
    # make your changes in mirage/types/
    opam update -u

[1] https://opam.ocaml.org/blog/opam-1-2-pin/

Note that there are actually two OPAM packages for one repository here, which 
is a little unusual.  The `mirage-types` package provides just the type 
definitions, and the `mirage` provides the command-line tool and code generator 
which has many more library dependencies.

> and explain the difference with V1_LWT?

The idea is that the core definitions in V1.ml do not introduce any library 
dependencies.  They instead have abstract type definitions for 'buffer' or 
'ipaddr'.  We then refine these types in `V1_LWT` into versions that are more 
concrete, for instance by assigned `Cstruct.t` to `buffer`.

This might seem pointless since we don't have any non-Lwt implementations, but 
there is ongoing work to provide an Async-based threading library.  In the long 
term, we would therefore have a common V1.ml that is shared among V1_LWT.ml and 
V1_ASYNC.ml (with completely different implementations of the abstract buffer, 
ipaddr or other types from V1.ml).

If you're thinking of adding types into V1.ml, note that they don't have to 
live in there at all until they are stable.  For instance, we provide the HTTP 
type definitions in Cohttp_mirage.Server.S rather than shove them into V1.ml.

Hope that's a little clearer!

MirageOS-devel mailing list



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