C vs Rust: What are the differences?
What is C? One of the most widely used programming languages of all time. .
What is Rust? A safe, concurrent, practical language. Rust is a systems programming language that combines strong compile-time correctness guarantees with fast performance. It improves upon the ideas of other systems languages like C++ by providing guaranteed memory safety (no crashes, no data races) and complete control over the lifecycle of memory.
C and Rust can be categorized as "Languages" tools.
"Performance" is the top reason why over 52 developers like C, while over 81 developers mention "Guaranteed memory safety" as the leading cause for choosing Rust.
Rust is an open source tool with 37.3K GitHub stars and 5.85K GitHub forks. Here's a link to Rust's open source repository on GitHub.
AdRoll, Twitch, and Redis Labs are some of the popular companies that use C, whereas Rust is used by Dropbox, Sentry, and Roundscope Ukraine Labs. C has a broader approval, being mentioned in 64 company stacks & 251 developers stacks; compared to Rust, which is listed in 39 company stacks and 105 developer stacks.
What is C?
What is Rust?
Need advice about which tool to choose?Ask the StackShare community!
Sign up to add, upvote and see more prosMake informed product decisions
Sign up to add, upvote and see more consMake informed product decisions
Sign up to get full access to all the companiesMake informed product decisions
Sign up to get full access to all the tool integrationsMake informed product decisions
To handle its growing observability needs, Postmates created and open sourced Cernan, a telemetry and logging aggregation server. Ceran is built on Rust and Lua, and can ingest data from many sources and then push or exposes what it’s collected to many destinations, or “sinks.” It can also create or manipulate in-flight data with programmable Lua filters.
Sentry's event processing pipeline, which is responsible for handling all of the ingested event data that makes it through to our offline task processing, is written primarily in Python.
For particularly intense code paths, like our source map processing pipeline, we have begun re-writing those bits in Rust. Rust’s lack of garbage collection makes it a particularly convenient language for embedding in Python. It allows us to easily build a Python extension where all memory is managed from the Python side (if the Python wrapper gets collected by the Python GC we clean up the Rust object as well).
One important decision for delivering a platform independent solution with low memory footprint and minimal dependencies was the choice of the programming language. We considered a few from Python (there was already a reasonably large Python code base at Thumbtack), to Go (we were taking our first steps with it), and even Rust (too immature at the time).
We ended up writing it in C. It was easy to meet all requirements with only one external dependency for implementing the web server, clearly no challenges running it on any of the Linux distributions we were maintaining, and arguably the implementation with the smallest memory footprint given the choices above.
Why Uber developed H3, our open source grid system to make geospatial data visualization and exploration easier and more efficient:
We decided to create H3 to combine the benefits of a hexagonal global grid system with a hierarchical indexing system. A global grid system usually requires at least two things: a map projection and a grid laid on top of the map. For map projection, we chose to use gnomonic projections centered on icosahedron faces. This projects from Earth as a sphere to an icosahedron, a twenty-sided platonic solid. The H3 grid is constructed by laying out 122 base cells over the Earth, with ten cells per face. H3 supports sixteen resolutions: https://eng.uber.com/h3/
Initially, I wrote my text adventure game in C++, but I later rewrote my project in Rust. It was an incredibly easier process to use Rust to create a faster, more robust, and bug-free project.
One difficulty with the C++ language is the lack of safety, helpful error messages, and useful abstractions when compared to languages like Rust. Rust would display a helpful error message at compile time, while C++ would often display "Segmentation fault (core dumped)" or wall of STL errors in the middle. While I would frequently push buggy code to my C++ repository, Rust enabled me to only even submit fully functional code.
Along with the actual language, Rust also included useful tools such as rustup and cargo to aid in building projects, IDE tooling, managing dependencies, and cross-compiling. This was a refreshing alternative to the difficult CMake and tools of the same nature.
At FlowStack we write most of our backend in Go. Go is a well thought out language, with all the right compromises for speedy development of speedy and robust software. It's tooling is part of what makes Go such a great language. Testing and benchmarking is built into the language, in a way that makes it easy to ensure correctness and high performance. In most cases you can get more performance out of Rust and C or C++, but getting everything right is more cumbersome.
Rust is used in Shirogane (https://github.com/Marc3842h/shirogane).
Shirogane is a osu! beatmap mirror built for shiro. We use Rust because of memory safe but still low level and high performance.
been programming in c for over a decade, since learning it in college. still use it for various low level projects. used it recently to develop an embedded application for a custom board.
The core of the arcapos applications is written in C, so are most of the Lua modules (bindings to various hardware or protocols).
The Sqreen PHP agent is both a PHP extension, built in C, and a daemon built in Python.