-
If, truly, none of them are appropriate for your needs, that's when it's time to use a custom target (per https://doc.rust-lang.org/rustc/targets/custom.html ) and `build-std` (per https://doc.rust-lang.org/cargo/reference/unstable.html#buil... .) Using a toolchain file to pin your nightly rustc version might be appropriate (per https://rust-lang.github.io/rustup/overrides.html#the-toolch... .)
The last time I played with custom targets was on https://github.com/MaulingMonkey/rust-opendingux-test/tree/m... , using the old `xargo` instead of `build-std`. Notes.md details modifications made to make things work.
-
InfluxDB
InfluxDB high-performance time series database. Collect, organize, and act on massive volumes of high-resolution data to power real-time intelligent systems.
-
-
ripgrep
ripgrep recursively searches directories for a regex pattern while respecting your gitignore
> Rust applications are sometimes (often?) slower than comparable C applications
Could you cite some examples? There are plenty of counter-examples
- ripgrep is 5-10x faster than grep (https://github.com/BurntSushi/ripgrep/blob/962d47e6a1208cf21...)
- Memory-safe implementations of PNG (png, zune-png, wuffs) now dramatically outperform memory-unsafe ones (libpng, spng, stb_image) when decoding images. (https://www.reddit.com/r/rust/comments/1ha7uyi/memorysafe_pn...)
- I don't consider the benchmarks game a worthwhile comparison because they're only writing assembly, but Rust and C are comparable in speed (https://benchmarksgame-team.pages.debian.net/benchmarksgame/...)
- Advent of Code - I came across Rust codebases which solved all of AoC 2024 in under 1 millisecond (almost fully assembly), and also ordinary, idiomatic code in under 100 milliseconds. I don't recall anyone ever posting a C codebase with perf measurements, but I could have missed this.
I'm surprised by the "often", but I'd be interested in any cases where C outperforms Rust. Please share if you've found any.
-
Might not.
Rust has a state of the art sort implementation. There’s nothing faster, in any language - https://github.com/rust-lang/rust/pull/124032.
And sure, it’s possible that someone could write a C program that compares in speed to all the Rust programs I’ve mentioned. C is a Turing complete language after all. I’m only pointing out that it hasn’t happened in practice.
Also check the Android Binder code before (C https://github.com/torvalds/linux/blob/master/drivers/androi...) and after (Rust - https://android.googlesource.com/platform/frameworks/native/...). Same speed but the quality difference, it’s incomparable.
-
Might not.
Rust has a state of the art sort implementation. There’s nothing faster, in any language - https://github.com/rust-lang/rust/pull/124032.
And sure, it’s possible that someone could write a C program that compares in speed to all the Rust programs I’ve mentioned. C is a Turing complete language after all. I’m only pointing out that it hasn’t happened in practice.
Also check the Android Binder code before (C https://github.com/torvalds/linux/blob/master/drivers/androi...) and after (Rust - https://android.googlesource.com/platform/frameworks/native/...). Same speed but the quality difference, it’s incomparable.
-
Git
Git Source Code Mirror - This is a publish-only repository but pull requests can be turned into patches to the mailing list via GitGitGadget (https://gitgitgadget.github.io/). Please follow Documentation/SubmittingPatches procedure for any of your improvements.
I second "Modern C" by Jen Gustedt.
- Get the `cdecl` tool to build intuition about function signatures. What does "int( * ( *foo)(void))[3]" mean?
- Write it yourself.
- Be disciplined. Develop good hygiene with compiler flags, memory/address checks, and even fuzzing.
- Read good source code such as the linux kernel. This is an amusing header file from the linux kernel that defines some banned files. This is wisdom if you choose to follow it: https://github.com/git/git/blob/master/banned.h
- Push the language to its limits. Play with memory and data structures. Inspect everything. This book "Data-Oriented Design" by Richard Fabien is a great to explore as well. It's about organizing your data for efficient processing.
Related posts
-
17 Essential CLI Tools to Boost Developer Productivity
-
Tell HN: My Favorite Tools
-
How can someone who has primarily worked in Web/Mobile development break into systems engineering?
-
CLI from musicforprogramming.net (written in rust)
-
Mfp: a Rust CLI utility for playing music mixes from musicforprogramming.net