Closed peterhoeg closed 3 years ago
Yes, OCaml needs to be configured to not force safe-string (and cannot be more recent than 4.11, for other reasons). If you cannot get one such OCaml from where you normally get yours, you would need to compile it yourself (with the appropriate configuration).
Fortunately on NixOS it's trivial to build a variant of ocaml that doesn't enforce safe strings, but are there any plans to have weidu support safe strings in the future?
There are not, no. The mutable string is probably WeiDU's most used data type, but using Bytes (new mutable string type) is unmanageable because much/most of the standard library still uses String (now immutable) and there is no end to all the type conversions.
Will you take a PR that adds a basic readme that outlines this?
Thank you, but that won't be necessary. I have written compilation instructions, but embarrassingly, I have not made them available (there's an older revision on weidu.org, but it does not mention the unsafe-string bit).
Here are the details in the ocaml release notes:
https://discuss.ocaml.org/t/ocaml-4-10-released/5194
And this is where the
-unsafe-string
parameter is used:https://github.com/WeiDUorg/weidu/blob/devel/Makefile.ocaml#L170-L171
If
-unsafe-string
is removed, compilation blows up with: