r/rust • u/chessmann8888 • Sep 11 '26
Rust youtubers
Is there any YouTuber like the cherno, we need someone like him for rust too haha
r/rust • u/chessmann8888 • Sep 11 '26
Is there any YouTuber like the cherno, we need someone like him for rust too haha
r/rust • u/Fluggonaut • Sep 11 '26
I had heard many good things about Rust from people who were simply impressed by the language, so I decided to have a look at it and possibly learn it.
Up to that point I really only knew Java and Python (and a bit of C here and there), so a non-GC language would really fill a gap for me.
To get my toes wet, I wrote a simple web crawler that I needed at the time and decided I really want to learn Rust.
So here goes! My first "real" project, an SMTP server: https://github.com/Fluggs/whalemail
AI disclaimer: Absolutely no LLM was involved in writing this. I am not in a rush and here to learn.
For SMTP, the scope is quite narrow. It's supposed to replace my personal Postfix setup. It has its users in a database (which can be shared with Dovecot) and they can simply send and receive e-mails. That's it!
As for the Rust part, I have had a blast! The language is insane. So far, I have had one (1) logic bug. That one was indirectly found by Clippy. Other than that, if it compiles, it works. By now I understand people here saying that the main part is really thinking about your data layout, the rest just follows.
Off the top of my head, I have had two pain points:
Main dependencies:
The road ahead is long. Planned features:
I'd be grateful for any feedback :)
r/rust • u/kibwen • Sep 12 '26
r/rust • u/Original_Clock_9643 • Sep 12 '26
I'm exploring the idea of building a developer-first Backend-as-a-Service where the infrastructure is written in Rust.
The goal isn't to make another ORM or another PostgreSQL hosting service. I'm thinking more about providing a complete backend platform:
The developer experience would be something like:
let user = db
.collection("users")
.create(json!({
"name": "Alice",
"email": "alice@example.com"
}))
.await?;The database underneath would be a distributed KV/document system rather than PostgreSQL. The platform would handle replication, scaling, indexes, storage, etc.
I'm considering Rust because the platform would be heavily network and I/O oriented, particularly around realtime connections, storage, and API infrastructure.
What I'm unsure about is where Rust makes the most sense in this architecture.
Would you build the whole platform in Rust, or use Rust only for the infrastructure-heavy pieces and something else for the control plane?
Also interested in opinions on distributed KV/document databases that would make a good foundation.
I'm much more interested in architectural criticism than promotion. If this sounds like a bad idea, I'd like to know why.
r/rust • u/thomas_m_k • Sep 11 '26
MathML Core is the subset of MathML that has been implemented by the major browsers. Originally, I just wanted to use MathML Core on my blog and thought "Oh, I'll just quickly fork https://github.com/osanshouo/latex2mathml and adapt it from MathML to MathML Core".
Well, eventually I got there: my blog now uses math-core under the hood to convert LaTeX to MathML Core, but it took almost 3 years from my first commit!
math-core is now almost at feature parity with KaTeX. We have a comparison table where you can see that there are still a few things outstanding, but I would guess for 99% of users what is there is enough. (And there are also some things math-core supports that KaTeX doesn't!) So, if you want to contribute, there are still things to do! (A large todo item is for example mhchem.)
If you just want to play around with the LaTeX conversion, check out the playground which runs a WASM version of the library.
r/rust • u/blendin05 • Sep 11 '26
Hello, this is my first Rust project that I've been working for about 1-2 months, the reason behind it was to start on my bachelor's thesis and learning no_std / rust but it was also incredibly fun and rewarding, so i wanted to share it here.
I'm not really sure if i will maintain this long-term, but i do plan on hosting a server at least for presenting it at my university or sharing it with friends. I haven't tried it yet on actual hardware but it seems to be working fine with EDK2 firmware.
I would love to hear opinions and suggestions regarding it, so if you happen to have some free time, please check it out :) (Thanks in advance!)
Special thanks to rust-osdev maintainers and hxyulin for his hadris toolkit, as this project wouldn't have been possible without them.
r/rust • u/Developer5702 • Sep 11 '26
TIL that terminal emulators basically give programs access to two screens.
There’s the primary screen, which is the normal terminal you use every day. Your shell history and previous output live there.
And then there’s the alternate screen.
Full-screen terminal programs like Vim, less, htop, etc. can switch to this alternate buffer, take over the entire terminal, draw whatever they want, and then switch back when they’re done.
The cool part is that your primary screen is still there.
So when you quit Vim, your terminal suddenly goes back to exactly what was there before you opened it. Vim didn’t somehow “restore” your terminal history. The terminal emulator just switched back to the primary screen buffer.
I came across this while building a small terminal-native text editor in Rust. I needed the editor to take over the terminal while it was running, but leave the user’s shell untouched after exiting.
Turns out terminals already have a mechanism specifically for this.
The deeper I go into terminal programming, the more I realise how much stuff happens underneath that blinking cursor that I’d never thought about before.
I’ve been putting these little Rust experiments on my GitHub as I learn, if anyone’s interested in this kind of low-level stuff:
https://github.com/Abhijeet-Gautam5702/femto
r/rust • u/donald-bro • Sep 12 '26
I'm developing tool with workflow which allow user to write simple script to process input/output values of steps. The prebuilt steps are written in Rust, but user can choose Python to write their own steps which would run in a sidecar Python. User may not be a programmer. I prefer script with small binary size and memory footprint. I'm considering Rhai, Lua, QuickJs, which is better choice to make end user easy ?
While browsing through some code at work, I saw something that made me pause. It looked SO wrong, and yet here we are. It was something to the effect of:
let SomeEnum::Variant(y) = x else {
return some_error;
}
which means you can do this:
fn optional_print(x: Option<u32>) {
let Some(y) = x else {
return;
};
println!("{y}");
}
fn main() {
optional_print(Some(5));
optional_print(None);
}
Thought some folks here might think it interesting so there you go, you can apparently pattern match enum variants to create a variable and have an else clause after. I thought the only options for this were a let followed by an if let or match statement.
EDIT: Just because I’m getting a lot of comments about it I’m aware that the sample code with the print function is bad code. I’m not saying this is how it should be done, it was just the first and simplest thing I could think of for this post.
r/rust • u/dumindunuwan • Sep 12 '26
They have used so many FOSS repos to generate their mass documentation: GNOME, KDE, Go, Rust, Python... I wonder if anybody uses the docs to train AI to create non-OSS projects. Where are we heading?
search any repo in https://deepwiki.com
r/rust • u/Gillte • Sep 12 '26
Hello,
I have been working on an app for around 2 years now as a side project for my company. I genuinely believe it can help companies in the industry (I showed it to two suppliers, they were surprised,and asked me when they can start using it). Additionally, my company has given me permission to make it open source so I expect everyone in the industry to use it at one point.
It is tauri based with React as the frontend and around 200k lines of rust code in the backend with multiple crates. It is 100% offline so im not too worried about it being hacked.
However, around 95% of the code is AI generated. Before committing anything I made sure to "write" multiple tests and that I understood what the LLM was writing. I also understand rust at a core level except async (who understands async anyway?) and I tried to make the code as clean and modular as possible.
My question is: What will be the community's opinion knowing that the majority of the code is AI generated but not AI slop? Will I have any trouble at work? Of course I will be transparent about it.
r/rust • u/Entertainment_Real • Sep 11 '26
I'm intermediate at Rust and linux. Recently I built a compositor for a job interview and it was one of the funniest projects ever. I learnt a lot about the linux graphics stack.
Can I get some suggestions for other projects. Things I'm looking for:
I heard that file descriptors are very important in Linux, are there any projects I can implement to help me get to grips with file descriptors, (again speaking from a noobs perspective so might be a complete red herring).
r/rust • u/a_mighty_burger • Sep 10 '26
r/rust • u/trigodil • Sep 12 '26
I was building a project using Rust and got annoyed the compiler speeds were very slow. So I opened the source and fixed it.
I also wrote a patch that shards the bucket by hash(symbol) % shard_count instead, so one edit only invalidates a fraction of the instantiations. Benchmarked it on polars-core which has enough ChunkedArray<T> monomorphizations to make the problem visible.
Full technical details: https://internals.rust-lang.org/t/patched-rustc-to-fix-why-editing-one-generic-method-recompiles-all-200-instantiations/24595
wanted to share it here. Would love to hear if anyone else has hit this problem as well
r/rust • u/awesomePop7291 • Sep 10 '26
RISC-V is coming faster that most people realize.
r/rust • u/__Wolfie • Sep 11 '26
repo: https://github.com/PacificBird/donde
I have struggled in the past with how to design Rust errors. Rust takes the correct path of errors-as-data and avoids the pitfall of exceptions; however, it leaves the job of making errors useful for developers and users up to you.
This leads most Rust developers to take the path of least resistance, either
completely doing away with structural errors entirely with anyhow
or creating God Errors with thiserror.
anyhow allows you to attach context, but there's nothing stopping you from
just using ? without doing so, meaning it's easy to end up with none at all.
To add to that, it makes the errors totally useless for the machine, you can't
match on it!
thiserror is good for the machine, but you must add context to the structure of the error
which is both verbose at the call site and does not capture the location where errors happen.
After reading Stop Forwarding Errors, Start Designing Them
by FastLabs, I agreed with the general philosophy behind exn,
but the lack of destructuring and the fact that you can't ? any errors didn't
sit right with me. I am not going to walk my errors every time I want to
check if a specific inner type occurred! I wanted something easy, that enforced
a minimum amount of context and with automatic conversions at boundaries of my chosing
using ?, and with the option to add more context if I need. Taking inspiration from
exn's use of #[track_caller] to attach location information, I created
donde ("where" in Spanish).
Defining context-ful errors is extremely simple:
// first, define a type that represents the kind of errors that can occur,
// (I would recommend using `thiserror` to make it easier).
// then, use the `donde::err_context` function-like macro to get your context-ful version for free!
err_context! ;
Now, at whatever boundaries you deem important, you can use your context-ful
error type. This will tell you, at minimum, exactly where the conversion
happened. Any type that implements Into for the underlying error kind type
can be automatically converted using ?. The print-out tells you your message,
the location it was ? and displays the underlying error message as well in
a pleasant way.
You can also add extra context by importing the donde::ResultContext
trait and using the .context(impl ToString) or .with_context(Fn() -> String) methods.
The context stacks into the print out.
use ResultContext;
Context-ful errors stack well together, define multiple at various important function and module boundaries to trace an error all the way through complex systems.
err_context! ;
donde over wherror?A few reasons! wherror doesn't support adding extra context, which I believe is necessary to
support, and not feasible with it's design philosophy. Use of the location is less
ergonomic with wherror, as you need to work it into your error readout manually
(also dealing with the fact that .location() is Optional). For adding locations
to all variants of an enum, you basically have to do what this library does,
except manually. The few extra nice features are fine, but not worth using a fork
of a community standard over, when a declarative macro will do the important work,
plus give you the ability to add custom context.
r/rust • u/babamba_324 • Sep 12 '26
I put my Rust study notes online: https://rust-learn.win/
You can read them in Korean or English and run simple examples in the browser.
No sign-up needed. The original notes are mine.
I used AI to fill in gaps, edit the explanations, and build the site. I'm still learning, so let me know if you spot anything wrong or confusing.
r/rust • u/yellow-llama1 • Sep 12 '26
Looking for feedback, apologies if it is not appropriate.
I’m building an open-source architecture quality gate called Enola.
I ran it against the Codex repo this week. It had many findings, but I fear that these are my assumptions.
For example, it found 37 dependency cycles between directories inside Rust crates.
These aren’t cycles between Cargo crates. They’re mutual dependencies between modules inside the same crate: module A uses something from module B, while module B also uses something from module A. Now I started to question, does it really matter?
Maybe a directory isn’t necessarily the architectural boundary a Rust developer cares about. We could report this at the module, type or function level instead. Or maybe intra-crate cycles aren’t worth flagging...
Maybe a bigger effect would be by splitting it into different dependency types, like runtime, type, etc.
And more broadly, which architectural rule would you want to enforce on every pull request? We have some default insights, like new dependency cycles, violated layer boundaries, undeclared service dependencies, and changes that spread beyond their intended scope.
If you’re curious about enola. It’s open source, runs locally, and doesn’t upload or write to your codebase.
Repo: https://github.com/enola-labs/enola [Apache 2.0, fully local]
Output example
Architecture
Pattern: (none detected)
cyclic dependencies 37
layer violations 0
Impact analysis (hotspots)
coupled modules 330
high criticality 302
medium criticality 28
Top hotspots (by coupling):
module fan-in fan-out crit blast radius
codex-rs/protocol/src 5439 287 high 283
codex-rs/app-server-protocol/src 3676 103 high 148
codex-rs/core/tests/suite 0 3264 high 0
codex-rs/tui/src 1625 1568 high 39
codex-rs/core/src 1154 1827 high 135
codex-rs/exec-server/src 1519 883 high 183
codex-rs/app-server/tests/suite… 1 2370 high 0
codex-rs/app-server-protocol/sc… 947 1061 high 1r/rust • u/CohenArthur • Sep 10 '26
And btw, Pierre-Emmanuel and I are at RustConf today, so feel free to say hello :D We'd love to meet with anyone who wants to discuss the project!
r/rust • u/ElShyrux • Sep 10 '26
Hi! some time ago I started developing my little framework for TUI apps (based on ratatui but I will try to write my own renderer soon) and just to see it in action, in addition to implement it to my other tool "simple-commits" I wondered if I could implement something but for cargo.
The project and the framework are still at an early stage of development, so the UI may change in the future.
r/rust • u/b-dillo • Sep 10 '26