Tons of production Rust systems use very little unsafe. I've been writing production Rust since 2015, and in that time, I wrote maybe 30 lines of unsafe production code. (Most of it in Tokio primitives.)
Now, in web-facing systems, the biggest concern is the low-level crypto libraries, which need to be written in assembly to avoid timing attacks. These (and related libraries) have seen multiple security advisories in the past year, some related to unsafe (I think?) and some related to logic errors. But overall, those advisories have mostly been lower priority, or affected mostly niche use cases.
If you only have a small amount of unsafe code, then it's possible to audit it more aggressively. And there's only a limited amount of space for bugs. So what I would expect for Rust is a trickle of security bugs, many of them niche or low severity, that slows down with time.
Do you run on CPUs based on the von Neumann architecture?
If so, those are built on unsafe operations internally.
Safety is a lot more complicated than "whether it is in an unsafe block of code in Rust". If you insist that an unsafe primitive can not be handled well enough to become "safe" by some definition of safe then you collapse the entire programming language hierarchy into "everything is completely unsafe". Which may, from a certain point of view, be true, but isn't a particularly useful classification scheme.
Arrays in Java (a loose equivalent of `Vec`) is a runtime primitive and implemented in a memory-unsafe language. References (loose equivalent of `Box` and `Arc`) as well. Java's `synchronized` (a loose equivalent to `Mutex`) as well. Those are not good counterexamples.
Lets compare what's inside this Ruby bug, a C function rb_str_casemap which is 40-50 lines of C fiddling with pointers and calling into macros that presumably are familiar to Ruby developers but opaque to an outside viewer. Is it fixed? I guess so but I can't see very well to be sure, it was counting stuff before and now it is being more careful, I hope it's correct this time.
... against str::to_uppercase the Rust function which has a single line of unsafe code, with a two line rationale provided to explain why it's OK to do this. As a subject matter expert I agree with the rationale. LGTM.
Edited: We're talking about uppercase, they're basically mirrors, but we should choose the uppercase function.
This sub-thread in the conversation is about Java, so comparisons to Ruby aren't what's relevant. Here's part of the relevant GP comment.
> It's important to note that Java, like Rust, is generally seen as a memory safe language. But it has bits of assembly, just like Rust has unsafe blocks, to handle some operations.
And according to sources like CISA and the NSA [1], Java is considered memory safe. Furthermore, Rust has been found to have some memory safety issues as well [2]. I think the point to get across is that yes, Rust can help eliminate a very large set of memory safety bugs, but it's prone to issues that other generally considered memory safe languages also have: at some point to do useful work there are going to be unsafe operations. The surface area might be much smaller, so you're likely better off using a memory safe language if you can help it, but it's not a panacea for having layers of security, especially since it means any issue found is likely to affect a large swath of code written in the language because it's in a load bearing area of the language ecosystem.
Java's String::toUpperCase appears to be quite a lot more complicated than the Rust but it is at least all Java and thus without careful inspection I can assume it's memory safe.
The JVM is written in an unsafe language. That's where these unsafe calls occur. Clients of these APIs have no control there. Java code itself is safe.
No, it's not. A relatively common case for unsafe in Rust is in data structures. The data structures in the Java runtime are all written in Java and has almost no use of unsafe (there might be a few, but not becsause of language limitation, but because of initialisation order).
As for the JVM, much of it is a compiler. It doesn't matter what language it's written in, as it generates machine code. Indeed, the vulnerability disclosed yesterday was in a compiler intrinsic, but those are just as common in Rust.
Other than that, the other big piece in the JVM is memory management, and it does, indeed, use C and C++ for memory management, but Rust also uses C (the various implementations of malloc/free in whatever runtime the Rust program is using; BTW, some popular malloc/free implementations are almost as big as Java's most complicated GC).
As for native C/C++ libraries (outside the JVM itself), Java programs do use some, but generally not more than Rust programs.
Not accurate. Most datastructures that use unsafe in Rust are primitives; `Box`, `Vec`, `Rc`/`Arc`, `HashMap` and `BTreeMap`. Of those, only the equivalent to `HashMap` and `BTreeMap` are written in Java, and they can be written in safe Rust as well if you're willing to give up some of the performance (e.g. always initializing - thing that happens in Java as well). More complex data structures (e.g. graphs) can and often are implemented without unsafe at all.
I know that you can write slow data structures in safe Rust, but the standard library's data structures are supposed to be efficient. Anyway, a quick look at how common unsafe is in Rust vs Java, both in the standard library and in applications, and you'll see that it's much more common in Rust.
Not all JVM implementations, there are multi-circular implementations in Java, starting with JikesRVM almost 20 years ago already, whose work with the MMtk memory allocator was later inspired a Rust version thereof.
We know LLVM has miscompilation bugs. Sometimes it is practical for Rust to fix those bugs and so it carries patches for LLVM, but in some cases LLVM IR semantics are just incoherent nonsense. An example of the former (Rust carries patches): LLVM got confused about discriminants when Rust uses niches, when the niche bit pattern used was usually right next to the legitimate values for a type the bug in LLVM caused little notice, it could corrupt data but probably not. However Rust changed which bit patterns to prefer here, so e.g. None for Option went from 0x0011_0000 to the bit pattern 0xFFFF_FFFF and now that same LLVM bug caused crashes as values which had previously been very slightly wrong were instead hugely wrong.
For an example of the latter (LLVM is just nonsense): LLVM still today has a bug found years ago where pointer provenance (a legitimate but hard to think about idea for optimising compilers) accidentally leaks into integers, and so LLVM can end up with two integers a, b which it believes are not equal and yet a - b == 0. Boom.
There is a wide range of software that exists in a "adversarial" environment, including anything facing a network or processing outside data. At a minimum, this software should should not allow an attacker to execute code of their choice on a system handling private data.
This does not require proving systems complete correct, but it does involve proving many properties of these systems.
Many, many Docker containers rely on "docker exec" or the kubectl equivalent to gain CLI access when needed. To have sshd in an Alpine Docker container, you're generally need to be running init and a bunch of demons, not just a single standalone service.
I'm guessing in practice relatively few people are actually exposed. But if they are, it's catastrophic.
> When you start a new game in Factorio, if you never played it, you can’t know how much of each resource you’ll have to extract and neither how much of an item you’ll need to produce.
Some of this information should be recoverable somewhere in the tech tree tooltips, if nowhere else.
More importantly, vanilla Factorio plays a nasty little trick on first-time players: The final sciences and launching the rocket both require scaling up. This means that either you refactor your factory, or you grind out that first launch super slowly using an inadequate production line.
Veteran players know ways to design some modularity into a factory, and when to yank out subsystems and rebuild them bigger somewhere else.
Factorio: Space Age is actually more forgiving about scalability. You don't need to scale up as much, and you have much more powerful tools for doing it. Instead, Space Age has lots of novel game mechanics to master, and higher total system complexity across the solar system.
> Is this true? If yes it makes a lot of sense. Time and time again, when I try some newly released open weights model I am disappointed. Even some older Claude models are beating them on quality of answers, even though they score less on intelligence in benchmarks.
Interesting. My experience is that Opus 5.5 is smarter than a model like Qwen3.8 Flash Next. But given the choice, I'd actually rather work with a model like Qwen3.8 Flash Next.
Even on medium reasoning, modern Qwen and DeepSeek models are ridiculously diligent. If I ask them a question about which library is best for a given task, they'll download 4 different candidates, read the source, and write test programs. Meanwhile Opus will look at a couple of web pages and give me glib bullshit answer. Opus is often like a brilliant coworker who can't be bothered to do their job. The modern Qwen and DeepSeek models are like someone who is merely smart, but who has an alarmingly good work ethic.
And I'm not just writing simple React CRUD GUIs. I'm doing stuff like modernizing ancient software forks, working on high throughput distributed systems, or finding bugs in other people's parser generators. And even the 120-240B open weight models are normally entirely adequate for these tasks.
One of the benchmarks where open models tend to perform badly is Terminal-Bench 4.0. I looked at some of the sample tasks on that benchmark, and some of they are really hard and specialized. Look, all I actually need out of a model is things like "tell me where this distributed algorithm might break", "get this ancient C code to build on modern Debian with modern dependencies", or "write a plan to migrate this database from MySQL to PostgreSQL and to test that the app still works." The modern open models can do all that, no problem.
It's worth checking different behaviours across the available models from time to time. What you end up preferring may be very dependent on what you do. For example while being diligent is nice in a lot of situations, sometimes I ask a personal agent a question and mimo spends 10min validating the answer in a few different ways. Sometimes I want that big research, sometimes I just want to know what that transformers toy is called.
There's also a huge difference is writing style. I'll take GPTs version of a commit summary over Claude and its copies any time.
It's perhaps rather expected that the compute constrained providers have lazy models, and the compute available providers are happy to let you burn a gazillion tokens.
> If I ask them a question about which library is best for a given task, they'll download 4 different candidates, read the source, and write test programs. Meanwhile Opus will look at a couple of web pages and give me glib bullshit answer. Opus is often like a brilliant coworker who can't be bothered to do their job.
I’ve been using Qwen3.8FN and DeepSeek. I would not trust them to evaluate 4 different libraries from scratch unless I gave them extremely specific benchmarks to run. They’re very good at consuming tokens for long stretches and then giving you what looks like thoroughly researched output, but their intelligence just isn’t at a level I trust.
But really, the difference you’re describing is easily shaped by prompting. If you want Opus to download and compare the libraries, just tell it to. It will. All of the models benefit from being clear in your intentions. If you try to find models that will read your mind where spending 20 extra seconds to type out your intentions would accomplish the goal, you’re ignoring the very important intelligence and efficiency differences between models.
> Look, all I actually need out of a model is things like "tell me where this distributed algorithm might break", "get this ancient C code to build on modern Debian with modern dependencies", or "write a plan to migrate this database from MySQL to PostgreSQL and to test that the app still works." The modern open models can do all that, no problem.
I actually read the code output for projects that matter. There is a huge difference between a model that can eventually accomplish a shallow goal like “fix this bug” and a model that does it cleanly. Even with Opus or Astra I will spot cleanup issues frequently.
When using models down to Qwen3.8-FN or DS-Flash size, the code can feel like the kind of spaghetti mess that you get from an overly caffeinated and confident junior developer who accomplished the goal via brute force and staying up all night. Yeah it compiles and does the thing you asked, but all of that spaghetti code compounds with each change until a couple months later your harness is spending half a day and countless tokens doing simple tasks because it has to navigate the mess of a codebase.
That problem is much less of an issue at the Opus level and I can trust Opus to clean up better when directed to do so. It’s those differences that compound.
But if I’m doing a throwaway task in a sandbox that just needs to work for a day? I’ll throw it to the open models and see what they can do. They are interesting to play with.
I often use the smaller flash models. These may need a nudge once in a while, but not significantly more than what I need to do with the much more expensive Anthropic models.
The end product is often the same. Sometimes a model surprises me with a specially clever solution but this is random and can happen with any model, open or closed.
> I actually read the code output for projects that matter.
For things where I really care about code quality, I still prefer to write about half the code, including almost the architectural bits, by hand. The models are allowed to pick holes. They're surprisingly good at that.
Yeah, this particular example was pretty sketchy on Cohere's part. Unsharing a namespace like that is a pretty standard way to safely do things that would otherwise require root.
Yes, this exposes some root-level kernel features to ordinary users in a restricted way, and yes, those features sometimes have security bugs that aren't visible to users outside a namespace.
But nothing that model was described as doing seemed particularly sketchy? At least not from the information we were given? It was using a normal kernel operation that I used regularly, not trying find a kernel exploit?
So that part of the article left a bad taste in my mouth.
But that was the whole article. Their exfiltration of data to Beijing, wasn’t. And it was told to build something to monitor against exfiltration attempts, shouldn’t it try one? It wasn’t sensitive data, it wasn’t even data, it was a test string. Everything they described was very benign.
Should the model have asked for an endpoint to test against? Probably yes, but this is not a very large model and the largest frontier models regularly do things like that without asking me.
The reality of running recent Chinese open weight models is that they are all overtuned for successfully completing tasks. I can ask Qwen3.8 Flash Next to grep for regexes that use PHP-specific features that might be problematic to port to Rust. But instead of just grepping, Qwen3.8 FN will spend 30,000 tokens writing a Rust test harness, exhaustively check every regex, consult a bunch of docs, and write me a 2 page report. Q3.8 FN is deeply convinced that it's going to get extra credit for doing more than it is asked. (To be fair, it's a prototype release.)
But if your sandboxing isn't set up to handle some whacky weirdness, then you can't even trust Claude or ChatGPT. Which is important—the big vendors often do provide sandboxing or command filtering in their harnesses, but some popular local harnesses like Pi.dev are intended to rely on external sandboxing tools.
I noticed similar behavior too across various different models. So I started asking it to create implementation plan documentation for everything, even for a small fix. I review the plan, clarify and update it very carefully before allowing it to proceed. I haven't had this type of unnecessary "extra credit" efforts since then.
Qwen3.8 27B is a dense model with expensive K/V caching. It's fantastic if you have 32-48GB of VRAM and want to run 1 or 2 agent sessions locally. But if serving batch inference for many users, it's expensive.
DeepSeek V4 Flash 0731 is dirt cheap at scale, less than 10% of the cost of Qwen3.8 27B. This is because it's an MoE and it uses much less VRAM for KV cache. And it's generally a better model. V4.1 is also cheap at scale, though I've heard mixed reports on the optimized K/V caching.
You should not be running Qwen3.8 27B on an API normally. Maybe Cerberas's hardware is bad at batching or supporting more efficient K/V caching schemes, or something like that?
If you have 48GB of VRAM, you should be able to get Qwen3.8-Flash-Next running and from my use, it's basically the tipping point. 27B is great for a bit of work, but I have QFN running non stop (when I can gather the correct ideas for it to implement).
Buggy slop products will burn buyers and then people will buy less. The very-early-80s video game companies shoveled out slop, including a few games that wouldn't even launch. Which led to the Great Video Game Crash of 1983.
I have a bunch of third generation Philips Hue bulbs, from around 2016. They weren't cheap. But I've had them all this time, and I brought them along when I moved house.
Haven't burnt out a single bulb yet.
I understand that this has caused some challenges for the Philips Hue division. They had extremely satisfied customers but not many repeat buys.
Now, in web-facing systems, the biggest concern is the low-level crypto libraries, which need to be written in assembly to avoid timing attacks. These (and related libraries) have seen multiple security advisories in the past year, some related to unsafe (I think?) and some related to logic errors. But overall, those advisories have mostly been lower priority, or affected mostly niche use cases.
If you only have a small amount of unsafe code, then it's possible to audit it more aggressively. And there's only a limited amount of space for bugs. So what I would expect for Rust is a trickle of security bugs, many of them niche or low severity, that slows down with time.
reply