In which circumstances is C++ better than Rust?

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

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • iroha

    Iroha - A simple, enterprise-grade decentralized ledger

  • I can show you a real world example: https://github.com/hyperledger/iroha The C++ version compiles in 3 minutes. The rust version takes 15, and the Rust version isn't even complete yet. Moreover, the target dir grows to sometimes in excess of 50GiB, if you have debug symbols, several features and incremental compilation. C++ by contrast keeps it in the low 8GiB which allows me to mount it to tmpfs.

  • dfdx

    Deep learning in Rust, with shape checked tensors and neural networks

  • The next release of dfdx includes a CUDA device and implements many ops. The same dev created a new crate, cudarc, for a wrapper around CUDA toolkit.

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
  • cudarc

    Safe rust wrapper around CUDA toolkit

  • The next release of dfdx includes a CUDA device and implements many ops. The same dev created a new crate, cudarc, for a wrapper around CUDA toolkit.

  • min-sized-rust

    🦀 How to minimize Rust binary size 📦

  • If you're interested in all the various techniques, https://github.com/johnthagen/min-sized-rust has a comprehensive list.

  • rtic

    Real-Time Interrupt-driven Concurrency (RTIC) framework for ARM Cortex-M microcontrollers

  • RTIC is still going strong, they are working on a 2.0 release at the moment :). There's also now embassy which provides an async runtime (and a ton of other nice things) for embedded as well :)

  • embassy

    Modern embedded framework, using Rust and async.

  • RTIC is still going strong, they are working on a 2.0 release at the moment :). There's also now embassy which provides an async runtime (and a ton of other nice things) for embedded as well :)

  • iced

    A cross-platform GUI library for Rust, inspired by Elm

  • Iced for instance? Or just check https://www.areweguiyet.com/#ecosystem

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

    The distributed financial transactions database designed for mission critical safety and performance.

  • One can doubt, but the systems like that are what I work on & read the most. There can be quite a bit of code in them that doesn't need unsafe, but that doesn't take into account the other half (or maybe more) which would. Things which take advantage of memory efficiency like drivers, memory allocators, schedulers, and databases are good examples of software which would have unsafe everywhere. Having experienced writing code that uses heavy unsafe in Rust, I would still prefer C++ (or really, C) if Rust wasn't explicitly the focus/target.

  • pzero

    A collection of tools for building concurrent systems

  • One can doubt, but the systems like that are what I work on & read the most. There can be quite a bit of code in them that doesn't need unsafe, but that doesn't take into account the other half (or maybe more) which would. Things which take advantage of memory efficiency like drivers, memory allocators, schedulers, and databases are good examples of software which would have unsafe everywhere. Having experienced writing code that uses heavy unsafe in Rust, I would still prefer C++ (or really, C) if Rust wasn't explicitly the focus/target.

  • usync

    Small, fast, synchronization primitives

  • One can doubt, but the systems like that are what I work on & read the most. There can be quite a bit of code in them that doesn't need unsafe, but that doesn't take into account the other half (or maybe more) which would. Things which take advantage of memory efficiency like drivers, memory allocators, schedulers, and databases are good examples of software which would have unsafe everywhere. Having experienced writing code that uses heavy unsafe in Rust, I would still prefer C++ (or really, C) if Rust wasn't explicitly the focus/target.

  • rust

    Empowering everyone to build reliable and efficient software.

  • You have very strange definition of “magic tricks”. Does dyn Trait magic or not? What about trait upcasting or generators?

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