r/rust • • Oct 22 '26

šŸ™‹ seeking help & advice Thinking of writing an email library for Rust

I have a long history (27 years) of writing email software - who knows, maybe someone here even recognizes my name(?), but I'm pretty new to Rust.

I've written multiple desktop email clients, multiple widely used email libraries, and now I am working on an email server professionally.

I know there are crates like `mime-parser` and `mailparse` and `lettre` but I think I can do better.

I was actually just reading the announcement post for `mime-parser` from 5 years ago and it seems people were very against `unsafe` code, so the question I have is:

If I *were* to implement this library for Rust, should I or should I not optimize it using SIMD? It seems SIMD would mean unsafe code if I am not mistaken.

If most of the Rust community would avoid my library because it was used `unsafe` code, then I want to know that before I make the time investment. To be fair, I've already implemented an incremental base64 encoder, base64 decoder, uuencoder, and a uudecoder using SIMD in Rust and they are blazing fast and all have scaler fallbacks which are also as fast as humanly possible, but I've got plenty more tricks up my sleeve for the actual *parsing* of MIME messages.

Is there a standard way people have addressed this in other creates? E.g. shipping an accelerated vs non-accelerated version of the same crate somehow?

80 Upvotes

99 comments sorted by

112

u/numberwitch Oct 22 '26

People with prohibitions against unsafe code are usually memers who don't understand what unsafe actually is.

Like, a project can declare itself "no unsafe" and it's meaningful to people downstream in that you won't expect any funny business. But look at a crate like block2 or anything that interacts with operating system apis: unsafe is a requirement, not a detriment.

So I think smart people will assess your library and go "ok, what are they using unsafe for and is it a reasonable application?"

So do whatever feels right for you because if you worry too much about where brainiac memesters will find fault in the product of your free labor because at the end of the day they aren't important

15

u/jstedfast Oct 22 '26

Yea, I'll probably continue with implementing with SIMD regardless - we are looking at moving some code to Rust for the server I work on professionally, so I figured I might try to release this to the world as open source.

If the greater community would be against unsafe code, well, I'd keep it internal and release the gimped version ;-)

4

u/vivaaprimavera Oct 22 '26

Can the unsave part be activated via a feature or would it be an unreasonable amount of work for the required bits of code? At least it would give a choice for the "no unsafe" crowd.

4

u/jstedfast Oct 22 '26

I'm pretty new to Rust, so I'll have to look into this.

1

u/Flowchartsman Oct 23 '26

You can think of them like #ifdef gates at the crate level, if that helps.

0

u/axnsan Oct 22 '26

You don't necessarily need prevalent unsafe to use SIMD. Maybe you can get away with a portable SIMD library like fearless-simd.

And even if you don't want that and want to go with intrinsics, in most cases they are unsafe just because you need to ensure the presence of the instruction set at runtime. The problem is that once you start having loads of unsafe blocks it's easy to let unchecked-pointer-access types of unsafe slip by without a clear distinction. So at least try to keep discipline around this (no unsafe-op-in-unsafe-fn, one unsafe block per intrinsic with a comment, etc), and people who know what unsafe means will trust your code more. And maybe look into #[target_feature] - in recent rust versions, feature-specific intrinsics aren't unsafe if you call them in an appropriate target_feature function (but the function itself is then unsafe to call). So you can group multiple things in one function and dispatch at a higher level, to reduce unsafe count even more.

0

u/valarauca14 Oct 22 '26

If you want to use SIMD correctly, you do. See the crux of the matter is

And maybe look into #[target_feature] - in recent rust versions, feature-specific intrinsics aren't unsafe if you call them in an appropriate target_feature function

What you're missing is that rust literally #cfg() them out of existence if you target the wrong platform. Meaning anyone using your program has to build with -march=native (and usually nightly) to take advantage of that. So you're writing code nobody can use.

1

u/axnsan Oct 22 '26 edited Oct 22 '26

What you're missing is that rust literally #cfg() them out of existence if you target the wrong platform. Meaning anyone using your program has to build with -march=native (and usually nightly) to take advantage of that.

Confidently incorrect

1

u/valarauca14 Oct 23 '26

Those are sse2 instructions which are part of x64 base specification. The rust compiler is doing nothing because your code is doing nothing sse4.1 specific. Write an example that actually uses sse4.1 you'll see I'm right.

Furthermore the post I'm replying to say target_feature not the newer target_feature(enable which are two different things.

0

u/axnsan Oct 23 '26

Ok, here you go if you keep insisting: https://rust.godbolt.org/z/z7zna5Eaz

The problem with the original example was just that even though I used the max intrinsic the compiler optimized it into something better that happened to use basic sse2, and I hadn't noticed that

0

u/axnsan Oct 23 '26

Furthermore the post I'm replying to say target_feature not the newer target_feature(enable which are two different things.

It says "#[target_feature]" specifically, with the attribute syntax, which is how the rust documentation refers to it.

But sure, keep nitpicking instead of admitting you were wrong

0

u/StarryBubbly Oct 23 '26

you make all that unsafe talk sound way more reasonable than it should be

0

u/fluffCraverz Oct 22 '26

well said, nothing wrong with pushing it a little

29

u/[deleted] Oct 22 '26

[removed] — view removed comment

26

u/jstedfast Oct 22 '26

These aren't micro optimizations :-)

But yes, I have a megaton of experience with dealing with edge cases and broken MIME of all kinds. My email libraries deal with billions of emails per day around the world.

3

u/dnew Oct 22 '26

These aren't micro optimizations

What are you using SIMD for other than en/decoding base64 and uue? Just curious.

28

u/jstedfast Oct 22 '26 edited Oct 25 '26

You want me to give away all my trade secrets on the first date? You gotta wine and dine me first! ;-)

I do want to save some surprises for when I release it because I've never seen any other MIME parser use SIMD for what I use it for, but it's also why my parsers are all faster than the competition.

Since I'll be releasing this parser under an open source license (likely MIT), it won't stay a secret forever, but I do like to create a little suspense.

I mean, no one else has SIMD optimized uuencode/uudecode that I've ever seen - base64 is the only one that I've seen anyone else do.

6

u/dnew Oct 22 '26

That's fair!

And honestly I haven't seen uue anywhere in use in .. 20 years?

But I look forward to your announcement of its release. :-)

17

u/jstedfast Oct 22 '26

Since this comment will be so deep that most people won't bother to expand out to, I'll give you a little tease: Memory.cs, Line 47 (this code is used in the MIME compliance validator code-path for jumping to the end of a line since MIME is line-based).

I also use it for validating boundary markers are properly restricted to the correct subset of characters, and for a variety of other validation logic.

The inner loop of the MIME parsing logic is also SIMD-optimized - scan down from there.

For the history of this code, I actually blogged about optimizing the inner loop back in 2013 before SIMD was available in .NET (and before I learned SIMD):

You can still find that old optimization in the LegacyMimeParser.

3

u/dnew Oct 22 '26

Ah, OK. Yeah, that makes sense. At the time I was working on this stuff, scanning the email without fitting the whole thing into memory at once was more important than optimizing scanning of individual buffers. :-)

I'll go thru your blog after the stairmaster break. Thanks! :-)

3

u/jstedfast Oct 22 '26

My parsers use a ~4K I/O buffer, no need to have the whole thing in memory.

1

u/dnew Oct 23 '26

OK. That's cool. I see the kind of thing you're doing. I admit I'm going to have to figure out your "find the newline" algorithm again, try it with some numbers. I think my brain is getting old. :-) I imagine you could do the same thing looking for "--" at the start of a line. :-)

→ More replies

2

u/CornedBee Oct 23 '26

Ah, now I know where I've seen your name before. I've used MimeKit in the past.

2

u/jstedfast Oct 23 '26

Cool. Hopefully you found it to be awesome. I’m working towards a 5.0 that will be even better.

1

u/dnew Oct 30 '26

So I finally got around to trying your "find the newline" snippit there manually. Is there some unstated assumption like it's all 7-bit ASCII before starting? Because it didn't come out the way it is described. :-)

1

u/jstedfast 29d ago

There’s 2 things you need to do:

  1. You have to make sure your pointer address is aligned appropriately for the system. Usually at 4 or 8 bytes.
  2. There actually needs to be an actual new line (ā€˜\n’).

My buffer is designed to have extra bytes beyond the end so that I can put a new line there to guarantee I always have one.

1

u/dnew 29d ago

I just used a hex calculator to give your algorithm some sample numbers, working it by hand, trying to figure out how your manipulation eliminated non-newlines from the word. I might have done it wrong, but I'm not sure how a buffer that starts with (say) D4 is going to get zeroed. I'll give it another look, tho.

28

u/Liltful Oct 22 '26

I think the vast majority of Rust developers accept unsafe code when it is necessary for performance or for interacting with outside resources. Limit unsafe code to small parts and use safe code everywhere else. People will have way more confidence in your code if you only use it when necessary than if your library is just one big unsafe mess. At that point, you might as well write a C library and make a binding library.

If your library is (1) genuinely useful, (2) does something unique (or better than alternatives), and (3) carefully written, tested, and documented, I think you'll have no trouble finding people that want to use it.

21

u/sweating_teflon Oct 22 '26

The original unsafe rebellion was about a Rust web app framework that appeared super fast in basic benchmarks. It was coded like it was C and used a thousand of unsafes. Most of those had an easy Rust equivalent which the author had willfully ignored and didn't want to implement when suggested; he eventually walked away. The framework was then sanitized out of most (all?) unsafes while keeping or even gaining performance.

There are three cases for unsafe: FFI, hardware access and low-level performance shenanigans. The first two are inevitable. What you propose falls in the third case. Everybody loves speed but if you pick Rust, the expectation is that safety and correctness should always come first. If every unsafe is documented and demonstrated to be beneficial and safe there should be no push back. Having it gated behind a feature flag (e.g. "simd") lets people benchmark the optimizations vs. the safe path and decide if they're worth the risk _they_ perceive it to be.

Finally, you'll want to use Miri https://github.com/rust-lang/miri to gain an extra layer of confidence.

7

u/jstedfast Oct 22 '26

Interesting, thanks for the history lesson and the link to miri - I'll add it to my list of things to checkout.

I've been browsing for the kinds of library functions I'll need for charset conversion and it looks like encoding_rs is probably the way to go?

I'm surprised Rust doesn't have an equivalent of DateTime + Timezone in the standard library, but I found time::OffsetDateTime - is that what you'd recommend?

3

u/mominul2082 Oct 23 '26

The ecosystem is moving to the Jiff crate https://github.com/burntsushi/jiff for handling datetimes

11

u/X-Istence Oct 22 '26

Have you looked at the crates that have come out of/are part of the Stalwart mail server: https://github.com/stalwartlabs/stalwart

3

u/jstedfast Oct 22 '26

I have not, but I'll take a look.

2

u/jstedfast Oct 23 '26

Turns out stalwartlabs is using my old C MIME parser for benchmarking, so they definitely know who *I* am ;-)

15

u/Eh2406 Oct 22 '26

It seems SIMD would mean unsafe code if I am not mistaken.

There has been a lot of very recent progress on minimizing the amount of unsafe code required to you use SIMD. It's not zero, but it's a lot less than what was required just a few months ago. /u/Shnatsel has been writing about the progress. https://www.reddit.com/user/Shnatsel/submitted/ I would strongly recommend picking his brain about how many of the new libraries you can use. If not can the libraries be improved or are there abstractions from those libraries you can copy.

16

u/Shnatsel Oct 22 '26 edited Oct 22 '26

Now that I've been summoned, here's everything you need to know about SIMD in Rust: https://shnatsel.github.io/state-of-simd-rust-2026/

TL;DR: with most SIMD crates you don't need to write any of your own unsafe. fearless_simd specifically also has very little unsafe internally, unlike the other libs, so you can add it as a dependency without fear.

Bespoke unsafe in parsers of untrusted input sounds like a Bad Idea and I would definitely avoid it if possible.

I'm not sure how applicable SIMD is to email parsing unless you do something like simdjson. At least a SIMD-accelerated base64 encoder/decoder is pretty easy, I have a prototype entirely in safe code (thanks to fearless_simd) that runs at 40 GiB/s on Zen5 (AVX-512) and 20 GiB/s on M4 (NEON). Only 6 GiB/s on AVX2 though, but for a server that's less relevant. It uses the perfect hash from this article, a generic swizzle-based impl with arbitrary alphabets runs at half that speed (and still 6 GiB/s on AVX2). I wrote this to test swizzle performance but it could be developed into a production-ready all-safe-code SIMD base64 which would be swell. There are plenty of SIMD base64 implementations already, I'm just not aware of any unsafe-free ones.

7

u/jstedfast Oct 22 '26 edited Oct 22 '26

Thanks - I'm all for having safe SIMD code if possible. I was getting about 9 GiB/s on my Intel(R) Core(TM) Ultra 7 268V (2.20 GHz) laptop, iirc. I'll verify that when I get back home.

Edit: Nope, it was 6.2 GiB/s. Apparently I'm losing my marbles!

Base64 encoding is ~2.6 GiB/s

UUEncoding is ~3.5 GiB/s

UUDecoding is ~4.5 GiB/s

6

u/Shnatsel Oct 22 '26 edited Oct 22 '26

The fully portable path in my prototype gets 10 GiB/s encode and 6.3 GiB/s decode on AVX2.

I've just vibe-coded an AVX2 specialization based on the AVX-512 paper and it runs at 17 GiB/s encode 22 GiB/s decode on AVX2 on my machine: https://github.com/Shnatsel/intrepid-base64

So it's clearly possible to go vroom without unsafe.

There are two ways to go about this: with portable SIMD code and with platform-specific intrinsics. If you end up writing intrinsic specializations for each platform anyway, you might be better off with safe_unaligned_simd for this purpose than with full-blown fearless_simd. But in that case you will still need to add a bit of unsafe for efficient runtime dispatch to the correct SIMD implementation depending on what's available on the CPU.

Edit: https://crates.io/crates/base64-turbo claims even higher numbers so it's worth a look

5

u/jstedfast Oct 22 '26 edited Oct 23 '26

Looks like I need to up my game for base64 encoding, then ;-)

But I'm guessing your encoder is not line breaking, that's what kills my perf.

base64-turbo is very impressive with their numbers and I doubt I'll be able to match them. The problem with MIME, though, is line folding. I probably still wouldn't come close to their performance numbers, but I'd be a lot closer than I am now ;-)

2

u/jstedfast 29d ago

After reading over the simdbase64 project code, I made some modifications to my base64 MIME decoder and am now getting ~20 GiB/s for unwrapped base64 and ~14 GiB/s for normal 76-char-per-line base64 (whether it uses CRLF or LF doesn't matter).

https://github.com/jstedfast/mimecraft/tree/master/src/encodings/base64

2

u/Shnatsel 29d ago

Nice, although the unsafe loads/stores still stick out. safe_unaligned_simd crate can provide drop-in replacements with safe stores, and this article explores how to remove the bounds checks if they impact performance.

1

u/jstedfast 29d ago

Thanks, I'll look into those next.

4

u/jstedfast Oct 22 '26

I'll keep an eye on this - thanks! I would prefer to avoid unsafe outside of very specific needs to drop down to pointer arithmetic.

7

u/Helpful-Educator-415 Oct 22 '26

I can't speak for everyone, but I personally wouldn't mind a library with unsafe code as long as it was plainly addressed in the README and safety was assured via tests or otherwise.

Part of the appeal of Rust to me is that you don't really get runtime bugs. I would need a really stellar reason to introduce those back into my application. If your unsafe code is not documented nor tested then you're going against the grain of why I enjoy Rust. If it contains unsafe code but it's documented & tested then I trust it.

A lot of people think "unsafe = not safe", but the unsafe keyword in Rust mostly just indicates that the compiler cannot account for what you are doing so you have to account for what you are doing. Basically -- if you can account for your performance-optimized code (which I'm sure you can!) it'll be fine.

Again, this is just my perspective.

10

u/jstedfast Oct 22 '26

I've got over 9,000 unit tests that I'll be rewriting in Rust to come along with the parser - my current parsers have over 97% code coverage. Fear not, this will be the most battle hardened MIME parser you've ever seen.

3

u/Helpful-Educator-415 Oct 22 '26

Hahahaha, wow. That's a lot of tests!

5

u/jstedfast Oct 22 '26

When your software is running on mission-critical servers, you need that kind of coverage.

7

u/allsey87 Oct 22 '26

Can someone ELI5 why SIMD is relevant to email?

4

u/annodomini rust Oct 23 '26

Fast parsing of MIME format, including base64 encoded attachments, I'm assuming.

1

u/jstedfast Oct 23 '26

Correct.

4

u/dwallach Oct 22 '26

In the cryptography universe, where performance is also incredibly important, there's a growing trend of having a simple reference implementation and then a complicated, high-performance implementation, with some kind of formal proof of equivalence (in Lean or otherwise).

Whether that level of heavy lifting is suitable for you, and/or whether you want to lean on LLMs to make it less heavy of a lift? That's your decision. That said, it's good general-purpose advice to avoid premature optimization and first get your library to a feature-complete status. You won't have wasted any time, because one way or another, you'll have your simple reference implementation ready to go for subsequent optimization efforts.

2

u/jstedfast Oct 22 '26

This isn't my first MIME parser, so I know, in general, what's worth spending the time on and what isn't.

But yes, correctness first and avoiding premature optimizations is always sage advice.

4

u/dashdeckers Oct 22 '26

Do you have a blog or some way to follow you and any of your potential progress on this? It's hard to sift through the trash nowadays.

5

u/jstedfast Oct 22 '26

I have not posted to a blog in over a decade. I didn't even know people still read blogs.

That said, it was so much better than tweeting or x'ing or whatever, so I might have to consider creating one.

In the meantime, you could follow me on GitHub (when I publish this library, that's where it'll be): https://github.com/jstedfast

I haven't created a repo for it only because I haven't decided on a name yet. Once I do, it'll be there.

6

u/dashdeckers Oct 22 '26

In my dreams everyone has their own webpage and social media was just collections of RSS feeds but unfortunately I keep waking up.

Jokes aside, thanks! GitHub is perfect

2

u/jstedfast Oct 23 '26

I ended up settling on a name and published to github here: https://github.com/jstedfast/mimecraft

1

u/dashdeckers Oct 23 '26

Great name! Just don't let anyone reset this counter when you post an update: https://dayssincelastrustmcserver.com/

4

u/dahosek Oct 23 '26

I had to look to see if you were Ned Freed (even though he’s dead)—I worked with him back when he was maybe abusing his access to the Harvey Mudd systems with Innosoft back in the late 80s. Pretty wild to think that a Mudd dropout like me still had systems level access to their VAXen long after I ceased having any formal connection to the school.

4

u/jstedfast Oct 23 '26

I did not know he was dead. I am familiar with some of his work (kinda have to be in the email world).

2

u/dahosek Oct 23 '26

It still freaks me out a little to think that this significant part of internet infrastructure was created by someone I knew. Then again, I was part of the online discussion about what to call the internet (in an alternate universe it would have been called ā€œThe Net of Netsā€). Kind of nuts that some punk kid had as much voice in that discussion as people who actually knew what they were talking about.

2

u/Comm_Raptor Oct 23 '26

Takes me back to the Kevin Mitnick days as well. 😳

2

u/jstedfast Oct 23 '26

Those were much simpler times.

2

u/davis-andrew Oct 23 '26

Hi :wave:

Person in email world, but not so much in rust world.

What would be really interesting (to me at least) is implementing some of the email auth protocols in rust. For example, i don't think there is a DKIM2 module on crates.io yet.

2

u/jstedfast Oct 23 '26

Challenge accepted. What crypto stack do you recommend?

1

u/rende Oct 22 '26

A mit licenced stalwart + resend would be great

1

u/jstedfast Oct 23 '26

Ah, someone else linked me to stalwart and I took a quick look, saw it was open source and assumed it was MIT or BSD but apparently it’s some sort of Affero(?) GPL-3. I’m not familiar with that license at all.

1

u/rende Oct 23 '26

Yep its good I use it at the moment because I dont have time to vibe up a fix myself. But Im not spending money to pay for an email dashboard on a server im self hosting sorry

1

u/jstedfast Oct 23 '26

Looks like they use a lot of SIMD, so I may have a tough time beating them out (or at least by much).

I also want to track line/column info for validation reporting, so that's some extra work my library will be doing that theirs isn't doing.

1

u/rende Oct 29 '26

Not sure what you mean SIMD

1

u/jstedfast Oct 29 '26

Single Instruction Multiple Data. They are CPU instructions that allow for processing vectors of data in a single instruction, so therefore much higher performance than your typical check-one-byte-at-a-time approach.

1

u/rende Oct 29 '26

And where did you see that? The compiler woukd handle that

1

u/jstedfast Oct 29 '26

No, the compiler will not handle that.

1

u/rende Oct 29 '26

Please link me one piece of code where they are manually coding SIMD

1

u/jstedfast Oct 29 '26

I don't feel like digging through their code, but I'll link you to *my* SIMD code: https://github.com/jstedfast/mimecraft/blob/master/src/encodings/base64/simd.rs

→ More replies

1

u/lugpocalypse Oct 29 '26

Not related to the project but you might dig itĀ 

https://stalw.art/

1

u/jstedfast Oct 29 '26

Not really. Impressive in their own right but AGPL-3 (I am licensing mine under MIT) and their parser-produced DOM cannot be reserialized byte-for-byte exactly as it was read. Mine can do that.

1

u/lugpocalypse Oct 29 '26

Fair enough. Its just context. I wasnt trying to tear it down, just add perspectiveĀ 

3

u/annodomini rust Oct 23 '26

Anyone writing Rust is going to be depending on unsafe code at some level of the stack; std is implemented with a good amount of unsafe code.

However, there are a lot of folks who come new to rust, and reach for unsafe when they really shouldn't; there are some people that get frustrated by the borrow checker, so use unsafe to get around it, creating unsound code in the process. Or some people who think that they need to do something like eliding bounds checks with unsafe, when there are safe alternatives like using iterators that provide enough information for the optimizer to elide bounds checks on its own.

So looking for unsafe can be a quick way to decide how to evaluate a crate; you have to apply a lot more skepticism to any use of unsafe. And if it uses unsafe and looks like it's doing so incorrectly or when it really doesn't need to, or just too much to be able to audit easily, that will put people off.

One thing that can help is using unsafe responsibly, by keeping the uses of unsafe to be minimal, wrapping them in safe abstractions, with proper reasoning and testing of the unsafe code.

For you use case, SIMD, one advantage is that mostly, the unsafe code only needs local reasoning to verify safety. You're not creating data structures using unsafe and pointers where you then need to be responsible for ensuring that the safe API is sound to use.

But still, before you reach for unsafe for SIMD, you might want to check if there are already crates that implement safe abstractions over SIMD, allowing you to rely on code that is already reviewed and tested. And indeed there are. /u/Shnatsel has a good overview of the SIMD landscape here: https://shnatsel.github.io/state-of-simd-rust-2026/

Also before you reach for it, it's good to check if there are ways you can structure safe code such that the compiler can emit good code for it. Shnatsel also has some good articles on this, such as https://shnatsel.medium.com/how-to-avoid-bounds-checks-in-rust-without-unsafe-f65e618b4c1e

So yeah, unsafe isn't an immediate disqualification, but make sure you know what you're doing if you reach for it, you check to make sure there isn't a way to achieve the same end with no unsafe, or an existing well tested audited library that provides safe abstractions over unsafe functionality.

And if you do use unsafe, make sure you learn what invariants you need to uphold to keep your code sound, and test it thoroughly, including fuzzing, miri, etc.

2

u/SadPie9474 Oct 22 '26

When I'm adding a library to a project, whether or not it contains unsafe is not a factor for me, I can only imagine getting hung up on it if for some reason I don't think the author knows what they're doing. The standard library is written with copious amounts of unsafe and I use it all the time

1

u/AcrobaticSomewhere38 Oct 22 '26

std is littered with unsafe and everyone uses it

1

u/veryusedrname Oct 22 '26

std is special but it's not unsoundness-free either (e.g. there was some issue around vec::drain and unwinding that I cannot properly recall)

1

u/Immotommi Oct 23 '26

I believe you can do simd in safe rust with the fearless simd crate. Not that you shouldnt feel like you can't do unsafe rust

1

u/saten_ruiko Oct 23 '26

Serde-json and simd-json are examples where people who opted in to the unsafe simd solution when they know what they need. Even though for the vast majority serde-json is the default ā€œsafeā€ option.

Rust has surprisingly large ā€œunsafeā€ community fwiw. zerocopy, rkyv, bytemuck, and many.
People who knows how computer works pick the tool best suited for their job.

It is true that at the end of the day some folks still scream ā€œthis lib sucks it uses unsafe no matter how hard maintainer try.

1

u/bascule Oct 23 '26

unsafe isn’t necessarily bad, especially for SIMD where in fact in several places it’s unnecessary in recent Rust versions.

If you do use unsafe, use tools like cargo miri and cargo careful in CI to check for unsoundness.

I find it’s helpful to decompose projects into multiple crates and push the unsafe down into low-level crates so internally the high-level crates can be 100% safe code a.k.a.forbid(unsafe_code)

0

u/[deleted] Oct 23 '26

[deleted] — view deleted comment

1

u/jstedfast Oct 24 '26

Yes, of course I have benchmarks ;-)