simdutf8
cxx
simdutf8 | cxx | |
---|---|---|
15 | 97 | |
509 | 5,527 | |
0.8% | - | |
1.2 | 9.3 | |
16 days ago | 4 days ago | |
Rust | Rust | |
GNU General Public License v3.0 or later | Apache License 2.0 |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
simdutf8
-
simdutf: Unicode validation and transcoding at billions of characters per second
That's not enough to make it interesting. There's already a porting of it in rust (https://github.com/rusticstuff/simdutf8), and inclusion in the stdlib has already been discussed: the problem is that you can't use simd in all supported targets and conditional compilation/detection is also very tricky.
-
Making Rust Float Parsing Fast: libcore Edition
No, libcore uses simple branching code at the moment, see https://github.com/rust-lang/rust/issues/68455. The issue is still actively being worked on. Note, it's not a simple drop in, and there seem to be even faster algorithms. For now there is https://github.com/rusticstuff/simdutf8.
-
What's everyone working on this week (19/2021)?
I will work on simdutf8, either
- simdutf8 v0.1.2 - Apple Silicon can get very fast UTF-8 validation too
-
simdutf v0.1.1 - A small step for semver, one giant leap for performance.
Now I have to benchmark again, it might be negligable. See also the discussion for this pull request.
-
Show HN: High-speed UTF-8 validation in Rust
Check the benchmarks section (https://github.com/rusticstuff/simdutf8#Benchmarks), second table. simdutf8 is up to 28 % faster on my Comet Lake CPU. However with pure ASCII clang does something magical with simdjson and it beats my implementation by a lot. GCC-compiled simdjson is slower all around except for a few outliers with short byte sequences.
The algorithm is the one from simdjson, the main difference is that it uses an extra step in the beginning to align reads to the SIMD block size.
- High-speed UTF-8 validation in Rust
cxx
-
Rust is having a positive effect in C/C++
There are cxx and autocxx, what else do you propose to do?
-
Interoperability: Swift’s Super Power
I would like to see a comparison of how this compares to Rust. In terms of interoperability it has Cxx (https://cxx.rs) to offer safe bindings to C++ but also has great support for Android, Linux and many other systems. You don't even need to hack together Windows bindings (as explained in the blog post) because Microsoft offers official bindings (https://crates.io/crates/windows). I'm not sure if I'd call it a superpower if any potential interoperability has to be written to be used (compared to it already being available). Or rather, in comparison to what is interoperability a Swift superpower? Certainly not C++ or C which can be used in a far wider set of targets.
-
Rust Cryptography Should Be Written in Rust
We selected Qt as a cross-platform solution. The C++/Rust interface is the clunkiest and ugliest part of the application, and rather complex because some state is shared between several windows in the GUI and several threads in the backend, and any component might modify that state at any time, and updates have to be transmitted to the other components without introducing inconsistencies. Using cxx [1] helped a little, though.
The project began in 2020, and I'm not sure what I'd choose as a GUI framework today – definitely not Qt Widgets, though.
[1] https://cxx.rs/
-
Link a C static library to rust cargo project
If the build process for the C library isn't too involved I recommend using cxx bridge (https://cxx.rs/) and letting cargo handle the build and linking. cxx basically allows you to describe the bidirectional interface (although it sounds like you only need 1 direction, which is fine too) in Rust code and it provides a "good enough" API for compiling C code inside the build.rs file.
-
ffizz: Build a Beautiful C API in Rust
The tooling for the first kind -- calling Rust from another language -- is a bit less developed, and tends to rely on code generation that doesn't necessarily produce a natural C API. cbindgen, uniffi, cxx, and Diplomat all take this course.
-
Best practices in creating a Rust API for a C++ library? Seeking advice from those who've done it before.
I would like to utilize OMPL's functionality in Rust code, so I want to call into OMPL C++ code somehow in Rust. I've seen two (non-mutually-exclusive) options so far: - rust-cpp, which allows you to write C++ code in Rust within the cpp!() macro. - cxx, which allows you to define both sides of the FFI boundary manually (as opposed to bindgen's automatic generation).
-
Hey Rustaceans! Got a question? Ask here (20/2023)!
I'm not sure how to do this in cxx; issues like https://github.com/dtolnay/cxx/issues/447 suggest that this isn't settled yet?
-
Hello r/Rust! We are Meta Engineers who created the Open Source Buck2 Build System! Ask us anything! [Mod approved]
I use non-vendored dependencies for the Buck build in https://github.com/dtolnay/cxx.
-
Microsoft is rewriting core Windows libraries in Rust
There's also the cpp and cxx crates for doing C++/Rust interop, but they probably aren't appropriate to use in all cases. The C ABI is definitely the safest way to go unless you're really trying to marry Rust and C++ code bases, not just writing library bindings.
-
How can I use rust libraries in C++
There's also cxx (can't vouch for it personally but it claims to make things a lot easier) https://github.com/dtolnay/cxx
What are some alternatives?
sqloxide - Python bindings for sqlparser-rs
cbindgen - A project for generating C bindings from Rust code
simdutf - Unicode routines (UTF8, UTF16, UTF32) and Base64: billions of characters per second using SSE2, AVX2, NEON, AVX-512, RISC-V Vector Extension. Part of Node.js and Bun.
rust-bindgen - Automatically generates Rust FFI bindings to C (and some C++) libraries.
encoding_rs - A Gecko-oriented implementation of the Encoding Standard in Rust
autocxx - Tool for safe ergonomic Rust/C++ interop driven from existing C++ headers
bumpalo - A fast bump allocation arena for Rust
uniffi-rs - a multi-language bindings generator for rust
fast_float - Fast and exact implementation of the C++ from_chars functions for number types: 4x to 10x faster than strtod, part of GCC 12 and WebKit/Safari
rust-cpp - Embed C++ directly inside your rust code!
feel
ritual - Use C++ libraries from Rust