The Linux Kernel Prepares for Rust 1.77 Upgrade

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  1. Rust-for-Linux

    Adding support for the Rust language to the Linux kernel. (by Rust-for-Linux)

    Rust is backwards compatible when you stick to stable features, but the kernel uses unstable features that can and do incur breaking changes.

    https://github.com/Rust-for-Linux/linux/issues/2

  2. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  3. min-sized-rust

    🦀 How to minimize Rust binary size 📦

    This is a good guide on building small Rust binaries: https://github.com/johnthagen/min-sized-rust

    This talks about going to extreme lengths on making the smallest Rust binary possible, 400 bytes when it was written, https://darkcoding.net/software/a-very-small-rust-binary-ind...

    The thing is, you lose a lot of nice features when you do this, like panic unwinding, debug symbols, stdlib… for kernel and some embedded development it’s definitely important, but for most use cases, does it matter?

  4. compiler-team

    A home for compiler team planning documents, meeting minutes, and other such things.

    Are you talking about https://github.com/rust-lang/compiler-team/issues/688 ? I think that issue provides a lot of interesting context for this specific improvement.

  5. reqwest

    An easy and powerful Rust HTTP Client

    > If you are equally picky and constrain yourself to parts of the ecosystem which care about binary size, you still have more options and can avoid size issues.

    What's an example of this for, say, libcurl? On my system it has a tiny number of recursive dependencies, around a dozen. [0] Furthermore if I want to write a C program that uses libcurl I have to download zero bytes of data ... because it's a shared library that is already installed on my system, since so many programs already use it.

    I don't really know the appropriate comparison for Rust. reqwest seems roughly comparable, but it's an HTTP client library, and not a general purpose network client like curl. Obviously curl can do a lot more. Even the list of direct dependencies for reqwest is quite long [1], and it's built on top of another http library [2] that has its own long list of dependencies, a list that includes tokio, no small library itself.

    In terms of final binary size, the installed size of the curl package on my system, which includes both the command line tool and development dependencies for libcurl, is 1875.03 KiB.

    [0] I'm excluding the dependency on the ca-certificates package, since this only provides the certificate chain for TLS and lots of programs rely on it.

    [1] https://crates.io/crates/reqwest/0.11.24/dependencies

    [2] https://crates.io/crates/hyper/0.14.28/dependencies

  6. hyper

    An HTTP library for Rust (by hyperium)

    > If you are equally picky and constrain yourself to parts of the ecosystem which care about binary size, you still have more options and can avoid size issues.

    What's an example of this for, say, libcurl? On my system it has a tiny number of recursive dependencies, around a dozen. [0] Furthermore if I want to write a C program that uses libcurl I have to download zero bytes of data ... because it's a shared library that is already installed on my system, since so many programs already use it.

    I don't really know the appropriate comparison for Rust. reqwest seems roughly comparable, but it's an HTTP client library, and not a general purpose network client like curl. Obviously curl can do a lot more. Even the list of direct dependencies for reqwest is quite long [1], and it's built on top of another http library [2] that has its own long list of dependencies, a list that includes tokio, no small library itself.

    In terms of final binary size, the installed size of the curl package on my system, which includes both the command line tool and development dependencies for libcurl, is 1875.03 KiB.

    [0] I'm excluding the dependency on the ca-certificates package, since this only provides the certificate chain for TLS and lots of programs rely on it.

    [1] https://crates.io/crates/reqwest/0.11.24/dependencies

    [2] https://crates.io/crates/hyper/0.14.28/dependencies

  7. magic-wormhole.rs

    Rust implementation of Magic Wormhole, with new features and enhancements

    > Downloading 3GB of dependencies is not a thing that happens in the Rust ecosystem. Reality is orders of magnitude smaller than that.

    Assuming they're talking about the built size of dependencies that are left lying around after cargo builds a binary, they're really not exaggerating by much. I have no difficulty of believing that there are Rust projects that leave 3GB+ of dependency bloat on your file system after you build them.

    To take the last Rust project I built, magic-wormhole.rs [1], the source code I downloaded from Github was 1.6 MB. After running `cargo build --release`, the build directory is now 618 MB and there's another 179 MB in ~/.cargo, for a total of 800 MB used.

    All this to build a little command line program that sends and receives files over the network over a simple protocol (build size 14 MB). God forbid I build something actually complicated written in Rust, like a text editor.

    [1] https://github.com/magic-wormhole/magic-wormhole.rs

  8. tokei

    Count your code, quickly.

    So If we would only count code and not comments, it is only 9489 LoC Rust. Which would be about 0.03% and if we take all lines and not only LoC it would be around 0.05%

    [0] https://github.com/XAMPPRocky/tokei

    [1] https://github.com/torvalds/linux/commit/b401b621758e46812da...

  9. linux

    Linux kernel source tree

    So If we would only count code and not comments, it is only 9489 LoC Rust. Which would be about 0.03% and if we take all lines and not only LoC it would be around 0.05%

    [0] https://github.com/XAMPPRocky/tokei

    [1] https://github.com/torvalds/linux/commit/b401b621758e46812da...

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts

  • Curl removes experimental HTTP back end in Rust

    5 projects | news.ycombinator.com | 22 Dec 2024
  • Build Lightning-Fast Data Processing in Rust: From Single Thread to Parallel Performance

    8 projects | dev.to | 19 Dec 2024
  • Replacing Nginx with Axum

    2 projects | news.ycombinator.com | 18 Oct 2024
  • hyper (Rust) upgrade to v1: Higher-level Server / Client were removed

    2 projects | dev.to | 27 May 2024
  • Super unpopular opinion incoming.

    7 projects | /r/rust | 8 Jun 2023

Did you know that Rust is
the 5th most popular programming language
based on number of references?