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

[MirageOS-devel] remove Str

I'm wondering why MirageOS ships an OCaml runtime with the Str module.
Str is an imperative, stateful regular expression module distributed
with the OCaml runtime (thus no opam package on its own).  It comes with
~550 lines of C code which are not in the best shape (according to
friends who tried fuzzers/static analysis tools on that code).  I've
heard from others that developers should stay away from Str, and there
are alternatives:

On the one side astring, and if you need full regular expressions there
is the fine re library written purely in OCaml.

The mirage.runtime ocamlfind package, which is part of every MirageOS
unikernel, embeds astring (next to logs). For simple string processing
(such as split), there is no need to use the big regular expression
hammer anymore.

https://github.com/mirage/mirage/issues/663 removes the strstubs from
being part of the OCaml runtime shipped for MirageOS unikernels (in both
ocaml-freestanding and mirage-xen-ocaml opam packages). In case your
unikernel uses Str, it will be a link error -- this is how Travis found
the occurence of Str in the mirage-skeleton dhcp example (see further
notes in the issue above).

This is a breaking change and will be properly documented with the
MirageOS3 release notes.

Now: are there any users of Str we would like to execute on top of
MirageOS?  For me it is a very similar case as Unix and Threads, there
is no good reason to support these interfaces.

Please discuss either here on in the issue if you're against this
removal.  Support can be expressed by +1 emojis in the issue mentioned

Thanks for your attention,

(from the >I remove code< department)

MirageOS-devel mailing list



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