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

Re: [MirageOS-devel] Problem when writing Twitter API library that can be used on Mirage



On 15 May 2015 at 07:48, Runhang Li <marklrh@xxxxxxxxx> wrote:
> Hi,

Hi Runhang,

> I am writing a better Twitter API library because it is impossible for one
> to use current Twitter library (https://github.com/yoshihiro503/ocamltter/)
> if he wants to make a Mirage unikernel.
>
> I have two questions.
>
> 1. What exactly are the limitation for the libraries I can use when writing
> code? Based on what I know, I feel like I cannot use any library that is
> OS-dependent? For example, can I use Lwt_unix.sleep?

Correct; you cannot use Unix, Lwt_unix, etc. In Mirage, you can use
OS.Time.sleep instead of Lwt_unix.sleep.

Sometimes an existing library can be modified easily (e.g. by moving
non-Unix code into a separate "core" module), so it might be worth
trying that first.

You should also try to avoid using C libraries where possible. e.g.
you'd want to replace curl with cohttp here.

> 2. Since the unikernel needs to make HTTPS request, I'd like to try out
> OCaml-TLS. Is there any recommendation for a good example that can
> illustrate how to use that? What aspects should I be careful of when using
> it?

There are some examples in the tls repository:

  https://github.com/mirleft/ocaml-tls/tree/master/mirage/example

I think there will be more information soon, as I see various
TLS-related releases being prepared.

> All questions and suggestions would be very welcomed.


-- 
Dr Thomas Leonard        http://roscidus.com/blog/
GPG: DA98 25AE CAD0 8975 7CDA  BD8E 0713 3F96 CA74 D8BA

_______________________________________________
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®.