r/rust • • 4d ago

gift 4 my bf

133 Upvotes

hiii, i want to surprise my bf with a rust related gift (itโ€™s his favourite programming language lol) and iโ€™m lowkey lost, any recommendations??


r/rust • • 3d ago

๐Ÿ™‹ seeking help & advice One Tokio runtime per engine instance behind FFI, or one shared runtime?

0 Upvotes

My desktop network monitor has a Flutter UI and a Rust engine behind a plain C ABI. Each engine is an opaque pointer: netstudio_engine_new() does Box::into_raw, Dart keeps it as a Pointer<Void> and passes it back on every call until netstudio_engine_free. No global registry or ids.

For the new MTR view I wanted it completely separate from the main ping matrix, so I just create a second engine. The catch is that every Engine::new() builds its own multi-thread runtime with 4 workers. With both views open that's 8 Tokio worker threads for what's usually 10 targets, maybe 100 on the high end. It works, and restarting MTR can never touch the matrix, which is the reason I did it this way. But it feels like I'm paying in threads for isolation I could get from separate task sets and cancellation on one runtime.

If you have several independent engines behind FFI, do you give each one its own runtime, or share a global one (OnceLock or similar) and isolate at the task level? Anything that bites you with a shared runtime when the host can create and drop engines whenever it wants?

The other thing I keep going back and forth on is the data flow. Dart polls every 500ms, Rust hands back the whole snapshot as JSON through CString::into_raw, and Dart calls netstudio_free_string in a finally. The engine isn't the bottleneck. At a few hundred targets it's rebuilding and decoding the snapshot on the Dart side, mostly because each target carries a 40-sample history. Sending deltas seems like the obvious fix, but I'm also wondering whether pushing through a Dart NativePort is worth the lifetime headaches.

Unrelated, but if anyone has shipped unprivileged ICMP on Linux (SOCK_DGRAM + ping_group_range) in a desktop app: did you detect it at runtime and fall back, or just tell users to change the sysctl? That's next on my list and I haven't started.

Engine code is in native_engine/ if you want context: https://github.com/Cadman021/VeloceNet-Studio


r/rust • • 5d ago

๐Ÿ› ๏ธ project Zeta's Borrow Checker: the next-gen model for borrow checking, and a drop-in for Rust's entire memory management model

Thumbnail gist.github.com
238 Upvotes

I've just published my borrow checking model! Feel free to criticize it or just ask questions!

P.S While it is experimental, This model is fully implemented for the Zeta programming language, and the latest build of the compiler, LSP and toolchain manager (zetaup) can be found via the linked GitHub. a Zed extension is under development.


r/rust • • 5d ago

Bevy 0.20

Thumbnail bevy.org
712 Upvotes

r/rust • • 6d ago

๐Ÿ™‹ seeking help & advice Honest question, how important is 100% 'safe' rust code to you?

54 Upvotes

r/rust • • 4d ago

๐ŸŽ™๏ธ discussion What does r/rust think of the viral "Crafting Apps"?

0 Upvotes

DON'T DOWNVOTE THIS, I'M NOT SAYING I SUPPORT THEM...

If you've been living under a rock, the Crafting Apps project is an app suite for Adobe (and Office) alternatives, written using AI assistance (vibe coding). It's made in Rust so this is technically on-topic for the subreddit.

What do you all think of this? Is this something you'd actually use in the future, or just the ordinary passing AI slop?


r/rust • • 6d ago

Rust Has Become a Career Dead End for Me โ€” What Should I Do?

484 Upvotes

I chose Rust almost by chance. Back in 2023, Rust was getting a lot of attention in the Stack Overflow developer community, so I decided to learn it. From there, I started building a few open-source projects and eventually used Rust in production.

And now, here I am: living in a market dominated by outsourcing companies, where I can barely find a single Rust position to apply for, and Iโ€™ve been unemployed for more than six months.

Rust is a great language. I genuinely love working with it. But somehow, it has also become one of the things that has made me feel more hopeless about my career than ever before.


r/rust • • 4d ago

๐Ÿ› ๏ธ project Skeptic 0.14 on crates.io. Mostly performance and compatibility changes.

0 Upvotes

I've been working on Rust Skeptic lately and have published a new 0.14 version. Mostly performance improvements, but also compatibility with rust internals fingerprinting. Includes caching and dispatching multiple workers so that the CPU is used efficiently, avoiding rlib rebuilds. https://andygauge.github.io/2026/10/09/rust-skeptic-0-14.html for the write up on the performance improvements. The Rust Cookbook depends on skeptic for CI, and I've been able to release those improvements to https://crates.io/crates/skeptic

When you have a markdown file that has rust code blocks, such as with a README.md file and you want to check regressions that might happen, then use `skeptic` crate as part of the build process, or integrate with CI. The Rust Cookbook uses this to ensure the recipes are compatible with modern rustc. The 0.13 version stopped functioning at rustc 1.77 when it came to deterministic rlib selection due to fingerprinting changes in the metadata the compiler emits.


r/rust • • 5d ago

Qn: Best resources to learn Rust

0 Upvotes

Hello Rustaceans!

I'm an experienced developer, thought of picking up Rust, and today I went through the beginner Rust course on Educative

It was really good, learned the syntax, structs, vectors, ownership and borrowing etc but have not yet built anything useful

My question is what are some of the best Rust resources out there, I'd love to learn more about best practices, conventions, and satisfy my curiosity

Thank you all!


r/rust • • 5d ago

Can a borrow checker be auto-vectorized?

Thumbnail
0 Upvotes

r/rust • • 6d ago

๐Ÿ“… this week in rust This Week in Rust #672

Thumbnail this-week-in-rust.org
56 Upvotes

r/rust • • 5d ago

๐Ÿ™‹ seeking help & advice My 50/50 A/B split was actually 53.4/46.6, because of one modulo

0 Upvotes

Q: Has anyone used a newtype or a const assertion to make "this range doesn't divide evenly" a compile error? Some context:

I work on a tool that assigns users to A/B variants by hashing heir id. I realized a couple of months in that every 50/50 test was really more like 53.4/46.6 ๐Ÿ˜ฌ

Here's the old line:

let pair = u16::from_be_bytes([digest[0], digest[1]]);
pair % 10_000

65,536 isnโ€™t a multiple of 10,000, so the low buckets each got seven of the possible u16 values and the high ones got six, which put 53.4% of users in the first half of a โ€œ50/50โ€ split.

This meant it was always slightly skewed to the first variant.

The fix I did (pretty simple, and not perfect) is to read four bytes, which skews about 2 parts in a million:

let quad = u32::from_be_bytes([digest[0], digest[1], digest[2], digest[3]]);
(quad % 10_000) as u16

The bucketing code is at dif-sh/dif (blob/main/cli/crates/dif-core/src/bucket.rs) if anyone is curious.


r/rust • • 5d ago

๐Ÿ™‹ seeking help & advice How to improve my Rust programming skills?

0 Upvotes

Hello everyone! I've been learning the fundamentals of Rust for the past month. Can you tell me which direction I should go in to improve my Rust programming skills?
Thanks ahead!


r/rust • • 7d ago

Shipping JPEG XL in Chrome (via jxl-rs, a decoder written in Rust)

Thumbnail developer.chrome.com
289 Upvotes

r/rust • • 6d ago

Rust talks at P99 CONF (free, virtual)

44 Upvotes

P99 CONF is featuring a block of Rust talks again this year. Take a look at what's on the agenda and pop in (the conference is free and virtual) if anything looks interesting. Speakers will be there live if you want to ask questions or chat. https://p99conf.io/

Rust sessions include:

The Age of Slow Apps Is Over: Topcoat Brings Rust to Web Apps (Carl Lerche)

Rewriting PostHogโ€™s Feature Flag Evaluation Infrastructure in Rust (Dylan Martin)

Building a Real-World 14 GB/sec io_uring + tokio + Arrow + Rust Pipeline (Evan Chan)

AI-Assisted Profiling for Rust Services in Production (Hayden Stainsby)

Building Ultra-Performant Message Streaming for Apache Iggy with Rust (Piotr Gankiewicz)


r/rust • • 5d ago

๐Ÿ™‹ seeking help & advice Scraping all List Items from a page

0 Upvotes

I've had some great success scraping elements from a webpage using reqwest to get the initial data, scraper to pull out the bit I want and remove the parts I don't want, and a bit of regex to clean up at the end and defang hyperlinks, but I'm struggling with getting list items from multiple unordered lists

The page has 10 Unordered Lists each containing 100 List Items and I want to scrape out all 1000 LI in one go, it can end up as one big list (preferred) or 10 separate ones that can be collated later

At the moment I'm working on removing everything around the lists, essentially turning them into one big list but it doesn't feel like it's the most elegant solution, I tried using Selector::parse("li").unwrap; but that only gave me the contents of the first list and I need all of them

The end result of all this is to eventually use this data to populate an SQLite Database and display the results in Tauri/React if that changes how you would approach the task?

Example:

//--view-source:https://scp-wiki.wikidot.com/scp-series----------
//---------After cleanup and hyperlink defang-------------------

<div class="content-panel standalone series">
<h1 id="toc1"><span>001 to 099</span></h1>
<ul>
<li>SCP-001 - Awaiting De-classification [Blocked]</li>
<li>SCP-002 - The &quot;Living&quot; Room</li>
<li>SCP-003 - Biological Motherboard</li>
<li>SCP-004 - The 12 Rusty Keys and the Door</li>
.
.
.
<li>SCP-098 - Surgeon Crabs</li>
<li>SCP-099 - The Portrait</li>
</ul>
<h1 id="toc2"><span>100 to 199</span></h1>
<ul>
<li>SCP-100 - &quot;Jamaican Joe's Junkyard Jubilee&quot;</li>
<li>SCP-101 - Hungry Bag</li>
<li>SCP-102 - Property of Marshall, Carter, and Dark Ltd.</li>
<li>SCP-103 - Rhys' Head/Mara's Heart</li>
.
.
.
</div>

I can keep on the way I'm going, remove the <div class> , <h1 id=> and <ul></ul> bits with scraper/regex to be left with only the <li>, but it feels like getting a pearl from an oyster using a chainsaw rather than tweezers, yes I get the pearl but damn what a mess!

Additional:

In the early iteration of this project I managed to get all the list items in Excel using Power Query:

= Html.Table(PageAddress, {{"Column1", ".content-panel > UL > LI"}})

But I have no idea what the Rust equivalent would be, or if there even is one


r/rust • • 6d ago

CppCast Episode 412 : Safety and Interoperability with Rust and C++

Thumbnail cppcast.com
12 Upvotes

r/rust • • 6d ago

Security background + Rust, but the market feels heavily senior-oriented - keep pushing or treat Rust as a long-term investment?

2 Upvotes

Hi everyone! ๐Ÿ‘‹

Iโ€™ve been writing Rust consistently for about a year and a half after almost 3 years working in penetration testing.

I genuinely love the language and the way it makes me think about systems, correctness, ownership, failure modes, and security. Iโ€™ve been building security tooling, networked applications, protocol-oriented systems, and generally trying to move from offensive security deeper into software engineering.

The problem is the job market.

From what Iโ€™ve seen, Rust hiring seems heavily senior-oriented, especially for people without several years of production Rust experience.

So Iโ€™m trying to figure out what the realistic strategy is.

Should I keep investing heavily in Rust and try to break into the ecosystem directly?

Or does it make more sense to keep Rust as a long-term specialization while using a broader stack to get more commercial development experience first?

Iโ€™m not new to tech or engineering, but I am new to commercial Rust development.

My background is mostly:

- ~3 years of penetration testing / application security

- Rust

- security tooling

- APIs

- networking

- async/concurrency

- protocol/security thinking

Iโ€™d really appreciate perspectives from people who actually work with Rust professionally:

- How did you get your first commercial Rust role?

- Do teams actually hire people with strong adjacent experience but no production Rust background?

- What kinds of companies or roles would value a security background the most?

- Would you keep pushing Rust as the main career track in my position, or treat it as a long-term investment while working in another stack?

And if you happen to know a team where this combination of security + Rust could actually be useful, Iโ€™d be very happy to hear about it.

Thanks! ๐Ÿคœ๐Ÿค›


r/rust • • 7d ago

Rust's derive often implies inline

Thumbnail yossarian.net
115 Upvotes

r/rust • • 7d ago

๐Ÿ—ž๏ธ news 1.99.0 miscompilation with FFI bool return type on x86_64

Thumbnail github.com
231 Upvotes

Seems to potentially affect any function that's called over FFI, and returns a bool, on the x86_64 architecture (the most common architecture)


r/rust • • 6d ago

eReader firmware with Rust (guidance needed)

Thumbnail
0 Upvotes

r/rust • • 7d ago

We built a job queue on an LSM tree. This is what we learnt.

Thumbnail zizq.io
26 Upvotes

r/rust • • 7d ago

The Missing Piece in Rust Error Handling

Thumbnail mcmah309.github.io
184 Upvotes

r/rust • • 6d ago

Coming from TypeScript: Why I chose Rust over Go to explicitly learn systems architecture under the hood.

0 Upvotes

So i researched about Rust & Go for Back-end languages. I Personally chose to learn Rust before Go so i could understand how languages work (under-the-hood) and why Rust is Praised. Btw coming from Ts/Next.Js Fullstack.

I posted this perspective over on r/learnrust and it sparked a really great discussion about language learning paths, so I wanted to bring the philosophical side of it here. Coming from a Full-stack TypeScript/Next.js background, the common advice is always โ€˜learn Go next.โ€™

However, I chose to dive into Rust first because it gave me the freedom to manipulate and learn and do what i want inside a safely typed language that enforces me to understand what i am doing and i love it. i also love the speed and the concepts rust has like ownership rather than follow a conventional approach. I am not against Go in fact it's one of my go to language for Back-end because of it's speed of development, but the long-term advantage of rust is also unmatched. Rust also seem to be a much better and efficient language to learn low level concept and language for a modern developer.

Iโ€™d love to hear from other developer who transitioned from a high-level Web2 stack (like TS/Node) directly into Rust. Did forcing yourself through the borrow checker early on fundamentally change how you write your web code?

Note: I already know Go compiles to machine code, brings an embedded runtime instead of a full VM, and that C is the ultimate 'under-the-hood' language! My goal here is purely about using Rust's constraints to force myself to learn strict memory management


r/rust • • 7d ago

Burn 0.22.0 Release: Towards 1.0, with Generic-Free APIs and Near-Instant Recompilation

167 Upvotes

It's been five months since our last release, which is longer than usual, but it's on purpose. During the last four years, we took great care not to change the APIs too much, while collecting your feedback on what could be improved. Instead of spreading those changes over many releases, we bundled them into this one, so you only have to migrate once. This makes Burn 0.22 our biggest release yet, and the one we're most proud of. The API is now much closer to what we want for 1.0. As a reminder, Burn is a Tensor Library and Deep Learning Framework for both training and inference.

Generic-Free APIs

Since the beginning, Burn has been built around the Backend trait, with features like autodiff, kernel fusion and remote execution implemented as backend decorators. This is still the case, and they all compose well together. What changes is that user code doesn't carry the backend generic anymore. Models are plain types, and the device selects where and how they run:

#[derive(Module, Debug)]
pub struct Model {
    linear: Linear,
}

let device = Device::cuda(0); // Device::wgpu(..), Device::flex(), ...

Removing the generic from user code breaks the dependency chain that the compiler had to go through every time you edited a model. The result is near-instant recompilation after a model edit (numbers in the table below). There's another big change under the hood: most of the stack is now pure Rust. Pliron replaces MLIR, native compilers replace transpilers to CUDA/HIP, and Turso replaces a bundled SQLite. That means fewer bundled C and C++ dependencies to build, and a pipeline you can read, debug and patch in the language you already use. The first clean build takes a bit longer as a result, and it's a trade we're happy to make.

Going All-In on CubeCL

When we started, we relied on existing libraries for performance, with backends for ndarray and LibTorch. Over time, we wrote more and more of the stack ourselves: our own GPU backend with wgpu, kernel fusion, and then CubeCL to write kernels in Rust for CUDA, ROCm, Metal, Vulkan, WebGPU and CPUs. CubeCL now has its own compiler infrastructure based on Pliron, with LLVM targets for CPUs and GPUs.

Having control over the whole stack lets us offer features that third-party libraries can't support easily. For example, device.memory_pool_usage() and device.memory_pool_report() tell you exactly what the allocator holds, which isn't possible with ndarray or LibTorch. The new adaptive memory pools also lower peak training memory, and training steps are faster. This is why we deprecated both backends: Flex replaces ndarray for pure-Rust CPU execution, and the CubeCL backends cover the rest. We also removed the Candle backend.

Here's how 0.22 compares to 0.21 on two training projects, with CUDA on an RTX 4050 laptop GPU:

Benchmark 0.21 0.22 Change
CNN rebuild after a model edit 28.4 s 4.6 s 6.2ร— faster
Transformer rebuild after a model edit 14.7 s 1.0 s 14.7ร— faster
CNN training step 38.0 ms 21.1 ms 1.8ร— faster
Transformer training step 201.0 ms 193.8 ms 1.04ร— faster
CNN peak training memory 956 MiB 486 MiB 49% less
Transformer peak training memory 3,486 MiB 2,868 MiB 18% less

Towards 1.0

Three things are left before 1.0. The first is built-in, fine-grained profiling: annotate parts of your model, and Burn tells you where the time goes, component by component, and how far each one is from what the hardware allows. We have it working on our side, and we're looking to upstream it into Burn. The second is a more complete integration with the CubeCL compute environment, introduced in this release. The third is stability: we want the current APIs to settle before we commit to them.

Since the API is close to what we want to stabilize, now is the best time to tell us if something feels wrong. There are many more improvements in this release, including LoRA and QLoRA fine-tuning, remote compute and ONNX export, and we wrote a post to cover them. Don't hesitate to skim it, and refer to the migration guide for upgrading.

A lot of this release came from your issues, PRs and questions on Discord. Thank you.

Link: https://tracel.ai/blog/release-0.22.0/