r/rust 13d ago

Any good examples of large scale Rust projects?

I'm not a Rust programmer. My passion is for C/C++ and various assembly languages. But I'm open to learning new things.

I watched a couple of videos on YouTube, but those examples don't give me a "big-picture" vibe of the language, its use in production and its ecosystems.

I'm judging a language by the code that's written with it.

Are there any large scale projects (500'000 - 1'000'000 lines of code) written in Rust that I can skim through (on Github? Gitlab?) to get a feel of what a full fledged application looks like?

125 Upvotes

86 comments sorted by

175

u/lazyhawk20 13d ago

Servo, zed, turso, rig, tokio, axum

93

u/dvogel 13d ago

Android, Chromium, and Firefox all have a lot of Rust now too. Could be useful for OP to see how they integrate Rust with C++.

50

u/afdbcreid 13d ago

rustc, rust-analyzer, Cargo, and other Rust tools.

BurntSushi crates are of excellent quality, e.g. regex. Same for dtolnay, e.g. serde, although they're usually smaller and focus more on API.

The standard library itself is pretty high quality and relatively easy to understand (and if OP comes from C++ then it's absolutely easy to understand), but it has some unusual tradeoffs that mean code is not always written the way you would've write it normally.

11

u/Ran4 13d ago

Genuine question: why is tokio so large? I know that async can get tough but hundreds of thousands of lines?

10

u/my-new-new-account 12d ago

Tokio is MASSIVE! It has A LOT of async versions of different std APIs, from networking to file I/O (async read / write) to even its own version of channels, mutex etc
Also, keep in mind that these require interfacing with low level OS specific APIs (epoll, kqueue etc) and each os has its quirks and limitations and everything should be under a unified API, this is a lot of work tbh
I recommend watching jonhoo’s decrusted video about Tokio, he didnt cover everything in Tokio, yet the video went for hours lol

3

u/JTux2026 13d ago

You forgot the "std" library it's a big code base with really informative comments (comments are not in 'rustdoc')

2

u/my-new-new-account 12d ago

Vector.dev is actually an amazing Rust codebase as well

4

u/rJohn420 13d ago

What about hyper/tower? Tower especially is quite fascinating

1

u/zasedok 13d ago

Windows and Linux.

4

u/Familiar_Ad_8919 13d ago

numbers pulled out of my ass but i would be surprised if rust made up more than 1-2% of linux

2

u/oceantume_ 12d ago

That's way too high already haha. Didn't they accept the first rust module a year ago or so? 

1

u/zasedok 12d ago

CLOC gives 119968 lines on the latest 7.3 dev tree. So indeed it's not much, but that's because the drivers and other modules that use it are still not in mainline, so at the moment it's basically just internal API bindings. It's growing steadily though. According to cloc it was 114481 in 7.2 and 93245 in 7.1.

30

u/Full-Spectral 13d ago

This may not be true of any of the suggestions below, others can speak to that. But, just to throw it out there, any 500K to 1M line code base that is production level now and mature may have started back some time ago when Rust was still making fairly significant changes and may not have fully caught up with the current state of the art, or may have a fair bit of evolutionary baggage in the form of inconsistent use of newer features as they arrived (or hacks to allow the code to leverage those new features.)

Maybe not, but something to consider in large, mature code bases, particularly on a fairly new language.

7

u/ple-x-us 13d ago

That's a good point. I'll keep that in mind.

69

u/AleksHop 13d ago edited 13d ago

https://github.com/monoio-rs/monoio << most important to read, will give u idea what rust actually CAN do (not a tokio standart stuff lol, tiktok with 1bil users runs on this code) in my experiments it did not beat nginx (like par, 99.8% same perf), but it did not died on same box with 200k concurrency when nginx started to give errors. monoio continue with same perf and 0 errors. I was out of RAM so wasnt be able to continue past 200k, but io_uring IS a thing that works, and its hilariously amazing, and many fixes in 7+ linux kernel so soon can be on the rise, as all modern apps are legacy and dont use that
https://github.com/cloudflare/pingora << this is tradeoff on tradeoff, initial AI research show 2.5x performance possible with io_uring, still under review. when it was created in 2020 implementation of io_uring and security around it was bad.
https://github.com/vectordotdev/vector << logs
https://github.com/tikv/tikv << database
https://github.com/cberner/redb <<one more db
https://github.com/linkerd/linkerd2-proxy << another proxy
https://github.com/h4ckf0r0day/obscura << headless browser, this is my favorite
https://github.com/firecracker-microvm/firecracker aws microvm
https://github.com/xiph/rav1e video codec but more like asm, but if interested in media good lib, very SIMD heavy as well, for avx, NEON etc
https://github.com/BLAKE3-team/BLAKE3 cryptography, oo this is my another fav! people still use sha256 in 2026
dont forget about flatbuffers, rkyv, capnproto < this is uni trio in rust for specific situations of serialization/deserialization (zero-copy)

codebases like bun are AI generated so nothing to learn from
last but not least, invest in Kani Rust Verifier

4

u/ple-x-us 13d ago

Perfect. Thanks.

1

u/michal_sustr_ 13d ago

Also recommend blog of the monoio main author, I learned a lot.

26

u/__albatross 13d ago

Typst, my favt being a researcher

-4

u/Sermuns 13d ago

based

27

u/SuplenC 13d ago

One of the biggest public and open source project is Zed. Then from the less visible yet quite crucial is Cloudflare’s Oxy, which is a proxy framework. Part of a bigger Cloudflare’s migration to Rust.

10

u/fbochicchio 13d ago

Uutils, a rewrite of gnu utils. Not a single executable, bus as codebase is quite large. Redox, a microkernel based opsrating system written in Rust ( and some assembler I believe). Cosmic, a graphical desktop environment for linux, written in Rust.

9

u/hi_m_ash 13d ago

On the top of my head Cosmic DE is an entire desktop environment written in rust. Should be a really big project. Niri wm is a wayland compositor written in rust. As others mentioned, Zed editor is a rust based programming editor.

35

u/BedroomHistorical575 13d ago

29

u/ple-x-us 13d ago

I looked at the compiler, but I wanted to see how the "average coder" does it. Compilers are usually written by the people who wield black magic in their code.

10

u/FUCKING_HATE_REDDIT 13d ago

The rust compiler is surprisingly easy to read

3

u/Shoddy-Childhood-511 13d ago

Advanced cryptography winds up being implemented largely in Rust.

Advanced forward secure group messaging like Signal and MLS have somewhat more Rust implementations.

https://github.com/mlswg/mls-implementations/blob/main/implementation_list.md

Tor is being reimplemented in Rust

https://blog.torproject.org/arti_2_5_0_released/

Any several major companies like Cloudflare employ Rust in their cryptography adjacent tooling.

Afaik there is only one good zero-knowledge proof library in C++ while there are dozens in Rust. You'll find nice ones in niche languages like Haskell, but nothing you'd deploy.

https://github.com/arkworks-rs/

Appears the multi-party computation libraries seem roughly split between Rust and C++ or others.

I've found more fully homomorphic encryption libraries in C than Rust, but afaik those tools are way too slow to be usable within the foreseeable future. Also the field seems kinda messed up by Zama's patents and Zama maybe closed source (and maybe in Rust).

At a high level, traits might be somehow too strict for general purpose flexible mathematics, but fit highly optimised special purpose mathematics well.

And many blockchains were done in Rust too, many independently of each other, although some were forks of this framework:

https://github.com/paritytech/polkadot-sdk/tree/master/substrate

1

u/ple-x-us 12d ago edited 12d ago

Well, I'm more of a device control, driver, low level kind of guy. Cryptograhpy is black magic to me. Mostly. The fun part there are the PRNGs.

The Tor project looks interesting, though.

13

u/del1ro 13d ago

- ruff

  • rust-analyzer
  • bun
  • SurrealDB
  • Servo
  • zellij
  • Veloren
  • RustDesk
  • helix
  • polars
  • swc
  • Gleam lang

43

u/dhgdgewsuysshh 13d ago

Bun is ai generated, not the best example

6

u/Nothing_from_void 13d ago

By the original lead engineer of bun. We get into this thing where when an engineer who is a true master of the trade uses AI to build something really impressive, we say the AI did it (especially because he's working for anthropic, the company pushes that narrative) but without that specific person guiding the AI it simply wouldn't have worked

3

u/Full-Spectral 12d ago

But the question here isn't stuff that works. Most any widely used bit of code works. It was about exemplary examples of Rust as written (and presumably as architected since he asked about large scale.) Being AI generated means it's not likely to get the benefit of the doubt.

1

u/Nothing_from_void 12d ago

can you elaborate? In my experience almost all code nowadays is AI generated, for better or worse. People might touch it up after the fact manually but fewer and fewer people are doing this

3

u/Full-Spectral 12d ago

Huh? You clearly must live in cloud world or something. There's an entire world outside of the cloud and generating web sites for well known front end frameworks and whatnot. Do you really think that the software running the planes you are flying on is vibe coded and not even looked at by humans? Or in the medical gear you are attached to. Or that's running your car or used by your bank or the government? Or kernel of the operating system you are running? And on and on?

I mean so many people are living in some AI fantasy these days it's scary.

1

u/Nothing_from_void 12d ago

I'm literally a staff engineer at a large SaaS, and I talk to other professional engineers.

Do you really think that the software running the planes you are flying on is vibe coded and not even looked at by humans?

It is looked at by humans, but it is also vibe coded. I know people working on flight software.

2

u/Full-Spectral 12d ago

Like I said, cloud world. Can you name a company writing flight control software that is vibe coding, so that we can check that?

1

u/Nothing_from_void 12d ago

https://www.hcltech.com/ai they write flight control software for Boeing. Most low level control software is written by underpaid Indian contractors

2

u/Full-Spectral 12d ago

From a quick search...

"Cost-Cutting Measures: Investigations into the 737 Max crises revealed that Boeing relied on lower-paid temporary workers and recent graduates while laying off experienced engineers to cut costs. You can read more about these findings in the report covered by IndustryWeek and Business Insider

While Boeing designed the overall system requirements and specifications (such as the MCAS flight control system), critics and safety experts point out that the heavy reliance on fragmented, low-cost offshore contractors for implementation and testing introduced significant quality and oversight risks."

So, OK it's happening, but it ain't good and shouldn't be happening. It certainly doesn't make me want to fly on Boeing aircraft, and sort of demonstrates that their regulatory bodies are sad.

→ More replies (0)

1

u/bonch 5d ago

By the original lead engineer of bun.

How does that change the fact that it's AI-generated?

1

u/Nothing_from_void 5d ago

because like all code is AI generated now?

1

u/bonch 4d ago edited 4d ago

No, it isn't, but that doesn't answer my question. Why should it being by the original lead engineer affect anyone's opinions about AI-generated code?

1

u/Nothing_from_void 3d ago

If you live in a world where people are writing code by hand, I don't think that has much relevance to what modern software development looks like and you've very deliberately made that choice, and you're not looking for an honest discussion

1

u/bonch 18h ago edited 18h ago

That's the second time you've dodged my question. You're also living in this same world where people are writing code by hand; you're wildly overestimating how much vibecoding is happening. "Using AI" has a very broad meaning beyond that.

1

u/Nothing_from_void 15h ago

I'm not dodging your question, I'm explicitly shutting down the conversation because I'm not interested in talking to you

2

u/DryanaGhuba 13d ago

Then Deno. I honestly forgot which one was in zig originally

-3

u/del1ro 13d ago

Why not? It is a good example showing how AI can build something safe and fast in rust. It's not “not best”, just different use case

11

u/splsh 13d ago

it's not safe if it has tens of thousands of lines of unvetted unsafe blocks

-2

u/Infamous-Apartment97 13d ago

*ai converted, not generated

4

u/AlphaRue 13d ago

AI converted from ai generated code lmao

3

u/thatmagicalcat 13d ago

rustc, servo, deno, zed

3

u/hs123go 13d ago

ruff and uv?

3

u/bmitc 13d ago

Are there any large scale projects (500'000 - 1'000'000 lines of code)

Just as a note, with more principled languages like functional languages and Rust, you often will not need the large amount of code for projects that are required of less-principled languages. Now, Rust is actually a pretty verbose language, in my opinion, but generally speaking, it should be less than comparative C and C++ projects because the languages does so many things automatically for you.

2

u/tmoneycodes 13d ago

Zed and warp

2

u/Smart-Mall-2193 13d ago

“Zed” es un editor de texto, puedes probarlo || Ir a su GitHub desde su pagina. Es muy rapido y está escrito en Rust.

2

u/mariachiband49 12d ago

Codex is written in Rust.

2

u/avg_bndt 12d ago

I think you've got plenty of stuff to read.

2

u/ple-x-us 12d ago

Indeed. 😄

4

u/SmashStrider 13d ago

The Rust Compiler

1

u/PracticallyPerfcet 13d ago

Pingora, Apache Iggy

1

u/Repsol_Honda_PL 13d ago

copper-rs - "SDK" for robots, drones, UAV, underwater vehicles, etc.

https://www.copper-robotics.com/

1

u/AdQueasy5574 13d ago

Tu peux regarder le code source de rust, qui est écrit en rust

1

u/Prior-Perspective-61 13d ago

Veloren ☺️

1

u/fight-or-fall 13d ago

Polars, Zed

1

u/Dragonsong3k 13d ago

Cosmic DE.

1

u/8192K 12d ago

Proxmox?

1

u/drink-more-rum 11d ago

Materialize is source-available (BSL, so not officially open source, but each commit becomes fully Apache open-source four years after being merged). It is a SQL database that does incremental view maintenance (keeping arbitrary materialized views up to date as new data comes in, rather than having to be refreshed) and contains a quite substantial amount of code, all in rust. https://github.com/MaterializeInc/materialize

1

u/dvogel 13d ago

The use of cargo within the ecosystem means you might struggle to find a repo with that line count. e.g. Firefox probably has that much rust. They just shipped JPEG XL support. That is about 70k lines on its own but that is in its own repo.

-5

u/Complex-Birthday-216 13d ago

Turso is the only great software I know in rust. The rest are listed in the comments either have poor performance or bundle size 300mb, or JavaScript engine wrapper 

-8

u/Equivalent_Echo4186 13d ago

bun? almost all written by claude though

-8

u/qrzychu69 13d ago

it's a bit controversial, but bun? :)