Is coding in Rust as bad as in C++? A practical comparison

This page summarizes the projects mentioned and recommended in the original post on /r/rust

InfluxDB – Built for High-Performance Time Series Workloads
InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
www.influxdata.com
featured
Sevalla - Deploy and host your apps and databases, now with $50 credit!
Sevalla is the PaaS you have been looking for! Advanced deployment pipelines, usage-based pricing, preview apps, templates, human support by developers, and much more!
sevalla.com
featured
  1. cpp-vs-rust

    Very well-researched article (in my uninformed opinion because I've done virtually no benchmarking). I'd summarize it as, Rust doesn't significantly improve build times over C++ for a project where you need to frequently recompile to test the logic of the code. I gather that the Rust code is pretty idiosyncratic (using raw pointers rather than slices and custom owned and borrowed string containers with i32 length and capacity fields), but I don't know why more idiomatic Rust code would be faster to compile, and it could be very different, so a worse comparison. The results aren't relevant for me because I use Rust mainly for the language features and don't have a project with terrible compile times or the need to often rerun tests, but there might be other C++ projects in the same boat as quick-lint-js that would consider moving to Rust if it compiled faster than C++. Hopefully the efforts of people like u/nnethercote will make that happen.

  2. InfluxDB

    InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.

    InfluxDB logo
  3. rust

    Empowering everyone to build reliable and efficient software.

    My apologies, I misunderstood. The initial implementation of -Zshare-generics happened here. Basically, the exported symbols of a library are changed after-the-fact to include any monomorphisations, but unfortunately this does not do any sharing between sibling crates. There might be followup work there I'm not aware of, but it seems that the fundamental problem here is that crates are separately compiled, so modifying the exported symbols of a crate only really gives sharing between crates where there's a dependency relationship, since they're compiled sequentially.

  4. inox2d

    Native Rust reimplementation of Inochi2D

    For example, on my Inox2D project, I was using serde to deserialize some JSON payload. But that came with some hacks I had to do, like have a temporary struct that gets converted to the final one because it wasn't possible to serialize it by itself, and add extra-dependencies to make the system extensible while also supporting external structures I used like Arena from the indextree crate.

  5. wasmtime

    A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

    The only path forward here would be to bend rustc/MIR for streaming codegen (and then bolt it to something like lightbeam).

  6. rustybuzz

    A complete harfbuzz's shaping algorithm port to Rust

    I understand that this may sound harsh, but I also ported two (far bigger) codebases from C++ to Rust: rustybuzz and tiny-skia. Both of which are production -ready and not just prototypes. And mine not only do not use pointers, but also barely use unsafe in general.

  7. tiny-skia

    A tiny Skia subset ported to Rust

    I understand that this may sound harsh, but I also ported two (far bigger) codebases from C++ to Rust: rustybuzz and tiny-skia. Both of which are production -ready and not just prototypes. And mine not only do not use pointers, but also barely use unsafe in general.

  8. resvg

    An SVG rendering library.

    Just as a point of reference, I have a ~75KLOC project (includes dependencies) called resvg which takes just 4s in the debug mode and 8s in the release mode to build on M1 Pro.

  9. Sevalla

    Deploy and host your apps and databases, now with $50 credit! Sevalla is the PaaS you have been looking for! Advanced deployment pipelines, usage-based pricing, preview apps, templates, human support by developers, and much more!

    Sevalla logo
  10. swift-nonempty

    🎁 A compile-time guarantee that a collection contains a value.

    As an example, you can see this implementation in Swift (https://github.com/pointfreeco/swift-nonempty) by the pointfree.co guys, one is a mathematician, the other an engineer, they love and love to teach functional programming.

  11. quick-lint-js

    quick-lint-js finds bugs in JavaScript programs

    My allocator is 258 SLOC.

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