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 - Power Real-Time Data Analytics at Scale
Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
www.influxdata.com
featured
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com
featured
  • 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.

  • 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.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • 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.

  • wasmtime

    A fast and secure runtime for WebAssembly

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

  • 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.

  • 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.

  • 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.

  • SaaSHub

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

    SaaSHub logo
  • 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.

  • 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

  • Macroquad egui DevTools: Rust Game Debugging UI

    3 projects | dev.to | 2 May 2024
  • Rust, WASM, and LOK

    3 projects | dev.to | 1 May 2024
  • Squawk – A Linter for Postgres Migrations

    1 project | news.ycombinator.com | 30 Apr 2024
  • 3 years of fulltime Rust game development, and why we're leaving Rust behind

    21 projects | news.ycombinator.com | 26 Apr 2024
  • Show HN: I made a spaced repetition tool to master coding problems

    3 projects | news.ycombinator.com | 26 Apr 2024