Repository: ashvardanian/StringZilla (language: rust)

Issue:
Doesn't build under FreeBSD 14-STABLE
```
$ cmake ../
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is Clang 17.0.6
-- The CXX compiler identification is Clang 17.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- C Compiler ID: Clang
-- C Compiler Version: 17.0.6
-- C Compiler: /usr/bin/cc
-- C++ Compiler ID: Clang
-- C++ Compiler Version: 17.0.6
-- C++ Compiler: /usr/bin/c++
-- Build type: 
-- Pointer size: 64-bit
-- Setting build type to 'Release' as none was specified.
-- Performing Test supports_march_native
-- Performing Test supports_march_native - Success
-- Configuring done (1.1s)
-- Generating done (0.0s)
-- Build files have been written to: /home/iron/apps/StringZilla/build
$ make
[  3%] Building CXX object CMakeFiles/stringzilla_bench_search.dir/scripts/bench_search.cpp.o
In file included from /home/iron/apps/StringZilla/scripts/bench_search.cpp:13:
In file included from /home/iron/apps/StringZilla/scripts/bench.hpp:18:
/home/iron/apps/StringZilla/include/stringzilla/stringzilla.hpp:1112:30: fatal error: 'char_traits<const char>' is deprecated: char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. It will be removed in LLVM 18, so please migrate off of it. [-Wdeprecated-declarations]
 1112 |     using traits_type = std::char_traits<char_type_>;
      |                              ^
/home/iron/apps/StringZilla/include/stringzilla/stringzilla.hpp:1921:27: note: in instantiation of template class 'ashvardanian::stringzilla::basic_string_slice<const char>' requested here
 1921 |     void init(string_view other) noexcept(false) {
      |                           ^
/usr/include/c++/v1/__string/char_traits.h:79:8: note: 'char_traits<const char>' has been explicitly marked deprecated here
   79 | struct _LIBCPP_DEPRECATED_("char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. It will be removed in LLVM 18, so please migrate off of it.")
      |        ^
/usr/include/c++/v1/__config:957:53: note: expanded from macro '_LIBCPP_DEPRECATED_'
  957 | #      define _LIBCPP_DEPRECATED_(m) __attribute__((__deprecated__(m)))
      |                                                     ^
1 error generated.
*** Error code 1

Stop.
make[2]: stopped in /usr/home/iron/apps/StringZilla/build
*** Error code 1

Stop.
make[1]: stopped in /usr/home/iron/apps/StringZilla/build
*** Error code 1

Stop.
make: stopped in /usr/home/iron/apps/StringZilla/build
```

Do you need any other info?


Discussion / hints:

Fix patch:
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
new file mode 100644
index 00000000..2b936dbd
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -0,0 +1,100 @@
+name: Report a bug
+description: Something doesn't work as expected?
+title: "Bug: "
+labels: ["bug"]
+assignees:
+- octocat
+body:
+- type: markdown
+  attributes:
+    value: |
+      Thanks for taking the time to fill out this bug report!
+      If you have a small question, it may be faster to ask the maintainers on [Discord](https://discord.gg/4mxGrenbNt).
+- type: textarea
+  id: what
+  attributes:
+    label: Describe the bug
+    placeholder: A short description of what the bug is.
+  validations:
+    required: true
+- type: textarea
+  id: steps
+  attributes:
+    label: Steps to reproduce
+    placeholder: Detail the steps taken to reproduce the behavior.
+  validations:
+    required: true
+- type: textarea
+  id: expected
+  attributes:
+    label: Expected behavior
+    placeholder: A clear and concise description of what you expected to happen.
+  validations:
+    required: true
+- type: input
+  id: version
+  attributes:
+    label: StringZilla version
+    placeholder: vX.Y.Z
+  validations:
+    required: true
+- type: input
+  id: os
+  attributes:
+    label: Operating System
+    placeholder: Ubuntu 22.04
+  validations:
+    required: true
+- type: dropdown
+  id: hardware
+  attributes:
+    label: Hardware architecture
+    options:
+    - x86
+    - Arm
+  validations:
+    required: true
+- type: dropdown
+  id: frontend
+  attributes:
+    label: Which interface are you using?
+    options:
+    - C implementation
+    - C++ bindings
+    - Python bindings
+    - Rust bindings
+    - Other bindings
+  validations:
+    required: true
+- type: input
+  id: contact
+  attributes:
+    label: Contact Details
+    description: How can we get in touch with you if we need more info?
+    placeholder: email@example.com
+  validations:
+    required: false
+- type: checkboxes
+  id: mentions
+  attributes:
+    label: Are you open to being tagged as a contributor?
+    description: Sometimes, a bug report is just as valuable as a patch 🤗
+    options:
+    - label: I am open to being mentioned in the project `.git` history as a contributor
+      required: false
+- type: checkboxes
+  id: duplicate
+  attributes:
+    label: Is there an existing issue for this?
+    description: Please search [our issues](https://github.com/ashvardanian/stringzilla/issues) to see if this bug already exists.
+    options:
+    - label: I have searched the existing issues
+      required: true
+- type: checkboxes
+  id: terms
+  attributes:
+    label: Code of Conduct
+    description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/ashvardanian/stringzilla/blob/main/CODE_OF_CONDUCT.md)
+    options:
+    - label: I agree to follow this project's Code of Conduct
+      required: true
diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml
new file mode 100644
index 00000000..49ddcbbf
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/config.yml
@@ -0,0 +1,5 @@
+blank_issues_enabled: false
+contact_links:
+- name: 💬 Ask on Discord
+  url: https://discord.gg/A6wxt6dS9j
+  about: Real-time communication with maintainers, contributors, and broader community
diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml
new file mode 100644
index 00000000..127d9f52
--- /dev/null
+++ b/.github/ISSUE_TEMPLATE/feature_request.yml
@@ -0,0 +1,62 @@
+name: Request a feature
+description: Something we haven't implemented yet?
+title: "Feature: "
+labels: ["enhancement"]
+assignees:
+- octocat
+body:
+- type: markdown
+  attributes:
+    value: |
+      Thanks for taking the time to fill out this feature request!
+      We have already scheduled a few features for our [next milestone](https://github.com/ashvardanian/stringzilla/milestones).
+- type: textarea
+  id: what
+  attributes:
+    label: Describe what you are looking for
+    placeholder: A short description of what the feature would look like, ideally with code examples.
+  validations:
+    required: true
+- type: checkboxes
+  id: check
+  attributes:
+    label: Can you contribute to the implementation?
+    options:
+    - label: I can contribute
+- type: dropdown
+  id: interface
+  attributes:
+    label: Is your feature request specific to a certain interface?
+    options:
+    - It applies to everything
+    - C implementation
+    - C++ bindings
+    - Python bindings
+    - Other bindings
+    - Other
+  validations:
+    required: true
+- type: input
+  id: contact
+  attributes:
+    label: Contact Details
+    description: How can we get in touch with you if we need more info?
+    placeholder: email@example.com
+  validations:
+    required: false
+- type: checkboxes
+  id: duplicate
+  attributes:
+    label: Is there an existing issue for this?
+    description: Please search [our issues](https://github.com/ashvardanian/stringzilla/issues) to see if this bug already exists.
+    options:
+    - label: I have searched the existing issues
+      required: true
+- type: checkboxes
+  id: terms
+  attributes:
+    label: Code of Conduct
+    description: By submitting this issue, you agree to follow our [Code of Conduct](https://github.com/ashvardanian/stringzilla/blob/main/CODE_OF_CONDUCT.md)
+    options:
+    - label: I agree to follow this project's Code of Conduct
+      required: true
diff --git a/README.md b/README.md
index 3357ffc6..75399383 100644
--- a/README.md
+++ b/README.md
@@ -304,8 +304,14 @@ Consider contributing, if you need a feature that's not yet implemented.
 
 ## Quick Start: Python 🐍
 
-1. Install via pip: `pip install stringzilla`  
-2. Import the classes you need: `from stringzilla import Str, Strs, File`  
+Python bindings are available on PyPI, and can be installed with `pip`.
+You can immediately check the installed version and the used hardware capabilities with following commands:
+
+```bash
+pip install stringzilla
+python -c "import stringzilla; print(stringzilla.__version__)"
+python -c "import stringzilla; print(stringzilla.__capabilities__)"
+```
 
 ### Basic Usage
 
@@ -1129,7 +1135,22 @@ __`STRINGZILLA_BUILD_SHARED`, `STRINGZILLA_BUILD_TEST`, `STRINGZILLA_BUILD_BENCH
 ## Quick Start: Rust 🦀
 
 StringZilla is available as a Rust crate, with documentation available on [docs.rs/stringzilla](https://docs.rs/stringzilla).
-Some of the interfaces will look familiar to the users of the `memchr` crate.
+To use the latest crate release in your project, add the following to your `Cargo.toml`:
+
+```toml
+[dependencies]
+stringzilla = ">=3"
+```
+
+Or if you want to use the latest pre-release version from the repository:
+
+```toml
+[dependencies]
+stringzilla = { git = "https://github.com/ashvardanian/stringzilla", branch = "main-dev" }
+```
+
+Once installed, all of the functionality is available through the `stringzilla` namespace.
+Many interfaces will look familiar to the users of the `memchr` crate.
 
 ```rust
 use stringzilla::sz;
@@ -1186,8 +1207,16 @@ sz::edit_distance_utf8("façade", "facade") // 1
 
 ## Quick Start: Swift 🍏
 
-StringZilla is available as a Swift package.
-It currently covers only the most basic functionality, but is planned to be extended to cover the full C++ API.
+StringZilla can be added as a dependency in the Swift Package Manager.
+In your `Package.swift` file, add the following:
+
+```swift
+dependencies: [
+    .package(url: "https://github.com/ashvardanian/stringzilla")
+]
+```
+
+The package currently covers only the most basic functionality, but is planned to be extended to cover the full C++ API.
 
 ```swift
 var s = "Hello, world! Welcome to StringZilla. 👋"
diff --git a/c/lib.c b/c/lib.c
index 86831014..3a66f6bd 100644
--- a/c/lib.c
+++ b/c/lib.c
@@ -76,11 +76,11 @@ SZ_DYNAMIC sz_capability_t sz_capabilities(void) {
     unsigned supports_avx512vl = (info7.named.ebx & 0x80000000) != 0;
     // Check for GFNI (Function ID 1, ECX register)
     // https://github.com/llvm/llvm-project/blob/50598f0ff44f3a4e75706f8c53f3380fe7faa896/clang/lib/Headers/cpuid.h#L171C30-L171C40
-    unsigned supports_avx512vbmi = (info1.named.ecx & 0x00000002) != 0;
-    unsigned supports_avx512vbmi2 = (info1.named.ecx & 0x00000040) != 0;
+    unsigned supports_avx512vbmi = (info7.named.ecx & 0x00000002) != 0;
+    unsigned supports_avx512vbmi2 = (info7.named.ecx & 0x00000040) != 0;
     // Check for GFNI (Function ID 1, ECX register)
     // https://github.com/llvm/llvm-project/blob/50598f0ff44f3a4e75706f8c53f3380fe7faa896/clang/lib/Headers/cpuid.h#L177C30-L177C40
-    unsigned supports_gfni = (info1.named.ecx & 0x00000100) != 0;
+    unsigned supports_gfni = (info7.named.ecx & 0x00000100) != 0;
 
     return (sz_capability_t)(                               //
         (sz_cap_x86_avx2_k * supports_avx2) |               //
diff --git a/include/stringzilla/stringzilla.hpp b/include/stringzilla/stringzilla.hpp
index 3350a05b..98e1c2ec 100644
--- a/include/stringzilla/stringzilla.hpp
+++ b/include/stringzilla/stringzilla.hpp
@@ -1085,7 +1085,7 @@ struct concatenation {
 
 #pragma endregion
 
-#pragma region String Views/Spans
+#pragma region String Views and Spans
 
 /**
  *  @brief  A string slice (view/span) class implementing a superset of C++23 functionality
@@ -1109,7 +1109,7 @@ class basic_string_slice {
 
   public:
     // STL compatibility
-    using traits_type = std::char_traits<char_type_>;
+    using traits_type = std::char_traits<mutable_char_type>;
     using value_type = mutable_char_type;
     using pointer = char_type *;
     using const_pointer = immutable_char_type *;
@@ -1686,7 +1686,7 @@ class basic_string_slice {
     }
 
 #pragma endregion
-#pragma region C-Style Arguments
+#pragma region C Style Arguments
 
     /**
      *  @brief  Find the first occurrence of a character from a set.
@@ -2538,7 +2538,7 @@ class basic_string {
     }
 
 #pragma endregion
-#pragma region C-Style Arguments
+#pragma region C Style Arguments
 
     /**
      *  @brief  Find the first occurrence of a character from a set.
@@ -2607,7 +2607,7 @@ class basic_string {
 #pragma endregion
 
 #pragma region Modifiers
-#pragma region Non-STL API
+#pragma region Non STL API
 
     /**
      *  @brief  Resizes the string to a specified number of characters, padding with the specified character if needed.


Test patch: