Make simdutf an optional component #379
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR introduces a flag to switch from
simdutf
to a native Haskell (slow) UTF-8 validation. The motivation is thattext
is the first boot library ever to have C++ components, which poses difficulty for GHC build systems. While @bgamari is likely to resolve issues for all major platforms (see https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6485), it's worth to provide a flag to disable C++ for the sake of exotic architectures.As discussed before, ideally we would like not use
simdutf
at all and resort to our own pure C implementation. This work (haskell/bytestring#423) proved to be more time consuming than estimated originally. We decided to undertake it againstbytestring
, so that packages other thantext
(e. g.,text-short
andutf8-string
) could benefit from it as well. However, it means that it will be released at earliest inbytestring-0.11.2.0
, and I would rather not limittext
to the newest release ofbytestring
only. So for a time being the choice will be between native Haskell and C++.