2,033 karma · joined February 20, 2010
What's changed since 2015 is that we ironed out some of the wrinkles in the language (non-lexical lifetimes, async) but the fundamental mental model shift required to think in terms of ownership is still a hurdle that trips up newcomers.
It is doable, just not as easy as in other languages because a production-grade linked-list is unsafe because Rust's ownership model fundamentally conflicts with the doubly-linked structure. Each node in a doubly-linked list needs to point to both its next and previous nodes, but Rust's ownership rules don't easily allow for multiple owners of the same data or circular references.
You can implement one in safe Rust using Rc<RefCell<Node>> (reference counting with interior mutability), but that adds runtime overhead and isn't as performant. Or you can use raw pointers with unsafe code, which is what most production implementations do, including the standard library's LinkedList.
Similarly, it helps to know who maintains the code you depend on. Is there even a maintainer? What is the project roadmap? Is the tool backed by a company or otherwise funded? What is the company's mission? Without those details, there is a supply chain risk, which could lead to potential vulnerabilies or future technical debt.
Or at least it used to be the answer when I still cared about analytics. Nowadays, friends send me a message when they find my stuff on social media, but I long stopped caring about karma points. This isn't me humblebragging, but just getting older.
The longer answer is that I got curious about Cloudflare workers when they got announced. I wanted to run some Rust on the edge! Turns out I never got around to doing anything useful with it and later was too busy to move the site back to GH pages. Also, Cloudflare workers is free for 100k requests, which gave me some headroom. (Although I lately get closer to that ceiling during good, "non-frontpage" days, because of all the extra bot traffic and my RSS feed...)
But of course, the HN crowd just saw that the site was down and assumed incompetence. ;) I bury this comment here in the hope that only the people who care to hear the real story will find it. You're one of them because you did your own research. This already sets you apart from the rest.
That's the core problem.
The mechanisms mentioned are primarily attack detection and mitigation techniques rather than prevention mechanisms. Bugs can't be exploited as easily, but they still exist in the codebase. We're essentially continuing to ship faulty software while hoping that tooling will protect us from the worst consequences.
Couldn't one argue that containers and virtual machines also protect us from exploiting some of these memory safety bugs? They provide isolation boundaries that limit the impact of exploits, yet we still consider them insufficient alone.
It's definitely a step in the right direction, though.
The paper mentions Rust, so I wanted to highlight a few reasons why we still need it for people who might mistakenly think this approach makes Rust unnecessary:
- Rust's ownership system prevents memory safety issues at compile time rather than trying to mitigate their effects at runtime
- Rust completely eliminates null pointer dereferencing
- Rust prevents data races in concurrent code, which the paper's approach doesn't address at all
- Automatic bounds checking for all array and collection accesses prevent buffer overflows by design
- Lifetimes ensure pointers are never dangling, unlike the paper's approach which merely tries to make dangling pointers harder to exploit
So, we still need Rust, and we should continue migrating more code to it (and similar languages that might emerge in the future). The big idea is to shift bug detection to the left: from production to development.- Floorp (https://floorp.app) - Zen (https://zen-browser.app) - Mullvad Browser (https://mullvad.net/browser) - LibreWolf (https://librewolf.net) - WaterFox (https://www.waterfox.net)
Besides that, there's also Brave and perhaps Chromium.
I don't mind making quick decisions, but the execution should be deliberate. One of the best things of working for myself is that all-hands meetings are pretty short. I have an idea, I ask a few friends about their opinion; then, I set to work - it's simple.
But what I don't do is wreak havoc along the way. For I know, that the time to fix what I might break never comes.
This started off as a rant with a friend a few days ago. We both lamented the sorry state of the web, particularly web browsers. There's a monoculture that we both have trouble understanding. As a result, the tone might be a bit rough around the edges.
To anyone who's using Chrome: I understand. It's a decent browser, and switching to a different one is work. However! If everyone is thinking that way, we'll be stuck with whatever Google decides browsers should look like, tracking and half-baked quasi-standards included.
Take that as a friendly encouragement to go out and give FF another chance. We urgently need more diversity in the browser space. Brave and Vivaldi are good, but they are still a flavors of Chrome. I actually believe, that if you give Firefox an honest attempt, you might be surprised at how refreshing it can feel. They really turned it around in the last few years.
Yes, there are problems. Yes, you'll have to find workarounds. But you are developers. You can figure this out! Writing browser extensions isn't that hard, and a lot of things (including the UI) are very customizable in FF.
struct Foo;
struct Bar;
mod tests {
use super::*;
}
Apart from that, I use globs very rarely.- Their approach is closer to game development than I expected; same focus on predictable performance.
- They run their main loop at 1kHz on Linux. Hardware is a Compute Module 4 from Raspberry Pi.
- Non-software engineers on their team picked up Rust quickly. That's not what you usually hear about Rust.
- They can handle a rotor failing mid-flight. The drone keeps flying.
They open-sourced some interesting crates too. Worth checking out if you're into embedded Rust. Links in the show notes.
Search hasn't been an issue for me yet. It feels instant and I like that I can use my keyboard for browsing search results in one view, just like in Sublime. Might depend on the project size, although I use it on bigger projects, too.
The one thing I'm missing is Git support. After getting used to Gitlens, it's really hard to move back to the command line.