Rust:资料搜集

以下是我感兴趣的的一些库:

字符串处理

  1. 纯 Rust 编写的 SIMD 加速的 UTF-8 验证库:https://github.com/rusticstuff/simdutf8
    • basic API for the fastest validation, optimized for valid UTF-8
    • compat API as a fully compatible replacement for std::str::from_utf8()
    • Up to 22 times faster than the std library on non-ASCII, up to three times faster on ASCII
    • As fast as or faster than the original simdjson implementation
    • Supports AVX 2 and SSE 4.2 implementations on x86 and x86-64. ARMv7 and ARMv8 neon support is planned
    • Selects the fastest implementation at runtime based on CPU support
    • Written in pure Rust
    • No dependencies
    • No-std support
    • Falls back to the excellent std implementation if SIMD extensions are not supported

查看系统 CPU 支持的 simd:

  1. cat /proc/cpuinfo # 关注 flags

benchmark & test tools

  1. Criterion.rs:https://bheisler.github.io/criterion.rs/book/index.html | https://github.com/BurntSushi/critcmp
  2. 内存分析:https://valgrind.org/docs/manual/ms-manual.html | https://blog.csdn.net/u010168781/article/details/83788559
  3. insta: https://github.com/mitsuhiko/insta
    Snapshot tests are particularly useful if your reference values are very large or change often.

    GUI

  4. A data-first Rust-native UI design toolkit: https://github.com/linebender/druid

Rust 社区在 Rust GUI 领域重点尝试的方向
Its main goal is to offer a polished user experience. There are many factors to this goal, including performance, a rich palette of interactions (hence a widget library to support them), and playing well with the native platform.

  1. a new VR, web and native-rendering UI framework for Rust: https://github.com/makepad/makepad

Makepad is a creative software development platform for Rust that compiles to wasm/webGL, osx/metal, windows/dx11 linux/opengl

TUI

https://github.com/gyscos/cursive/wiki/Backends

  1. https://docs.rs/crossterm + https://docs.rs/tui
  2. https://docs.rs/ncurses/latest/ncurses/

    WASM

  3. wasmer: https://github.com/wasmerio/wasmer

  4. wasmtime: https://github.com/bytecodealliance/wasmtime

    DataFrame

  5. polars:https://github.com/pola-rs/polars

    1. Fast multi-threaded DataFrame library in Rust and Python(py 和 Rust 都可以使用的库)
    2. benchmark: https://h2oai.github.io/db-benchmark/
    3. goal: a lightning fast DataFrame library that utilizes all available cores on your machine. Its ideal use case lies in data too big for Pandas but too small for Spark. If you need to process data that does not fit in memory of a single machine (even after filtering), Polars is not the solution to your problem.
    4. book: https://pola-rs.github.io/polars-book/user-guide
    5. 专业支持 DataFrame ,单机高性能,与 py-polars 孪生
  6. peroxide:https://github.com/axect/peroxide
    1. Rust comprehensive scientific computation library contains linear algebra, numerical analysis, statistics and machine learning tools with farmiliar syntax (R, MATLAB & Python syntax)
    2. 功能比较宽泛,亮点是支持其他编程语言语法形式来处理数据,但是各方面的功能都不太深入,对 DataFrame 功能支持很简陋
  7. Connector-x:https://github.com/sfu-db/connector-x
    1. Rust Python 中将数据从 DB 加载到 DataFrame 的最快库(py 和 Rust 都可以使用的库)
    2. 相比于 modin | pandas | dask:ConnectorX uses up to 3x less memory and 21x less time
    3. Rust 文档:https://docs.rs/connectorx
    4. 现有解决方案在下载数据时或多或少会多次冗余数据。此外,在 Python 中实现数据密集型应用程序会带来额外的成本。ConnectorX 是用 Rust 编写的,并遵循“零拷贝”原则。这允许它通过变得对缓存和分支预测器友好来充分利用 CPU。此外,ConnectorX 的架构确保数据将直接从源复制到目标一次。
  8. 列存储相关(arrow):
    1. arrow-rs:官方实现
    2. arrow2

      DataBase

      11 database drivers and ORMs for Rust that are ready for production

      log

      Rust 的 Logging 推荐

      src: https://rustcc.cn/article?id=91b91a60-cbe9-4f8a-a5ec-8825da34457b 内容整理自 Reddit 的讨论:What is the current recommendation for logging in Rust? : rust。 问题简述:除了标准的 log,还有不少选择:env_logger,tracing,slog,simplelog 等等,最佳实践是什么? 来自 Koxiaet 的答复:通常有两类与日志相关的 crate:日志接口和日志消费者。接口提供了想要记录某些东西时调用的函数,消费者处理将结构化日志数据格式化到某个地方(stderr 或文件)。两个主要的接口是 log 和 tracing,后者功能更强大因为它支持结构化日志记录,但前者更普遍。还有另一个结构化日志接口 slog,比 tracing 更古老但用的较少。每个日志接口都有自己生态系统,可以根据自己的需要选择。如果在写一个库,log 是个不错的选择,因为所有的日志记录接口都与它兼容。但如果你确实需要结构化日志记录,则可以改用 tracing,这取决于你的需求,比如你是需要写到文件还是只是终端。 其他网友的推荐:

邮件

  1. 案例文章:How to send emails with Rust
  2. 库:

diff

  1. https://docs.rs/similar/latest/similar/
  2. https://docs.rs/difference/latest/difference/
  3. https://docs.rs/dissimilar

    HTTP Client

  4. https://github.com/algesten/ureq:最简设计、阻塞 IO

  5. https://crates.io/crates/reqwest:广泛使用、异步和同步 IO

    Git Changelog

  6. https://github.com/orhun/git-cliff

  7. https://github.com/rustic-games/jilu
  8. https://github.com/aldrin/git-changelog