Skip to content
0:00 / 0:00

#rust#unsafe#gecko

Grappling unsafe in real world rust projects is impossible

coshvji cujmlqef

576 subscribers • 1 video on Hallway

YouTube
  • Recommended by 2 people: 2 in engineering communities.
  • Linked in the descriptionmozilla/gecko-devtearosccebe/fast_io
  • An opinion. It argues one side of a question engineers disagree on.

Intermediate. Assumes working knowledge.

990 views4 years ago2 recommendations

Programming languagesRustLanguage design and type systems

An analysis of the usage of the unsafe keyword in the Firefox Gecko codebase to argue against the idea that unsafe code is rare.

We often hear rust evangelists (C++ violates human rights guys like Alex Gaynor) said unsafe is rare and easily reason about since you can just grapple all unsafe in rust code (because they believe it is rare so you can easily do that). github.com/mozilla/gecko-dev/search?q=unsafe I made a statistic in gecko (which is the browser engine of firefox). They have 1605 in 8262 (19.43%) rust source files that use unsafe. 20006 unsafe keywords in total. This is nowhere truly rare. Tell me how are you grappling with all unsafe usage if you have 20% of rust source files that use unsafe (a lot of files just use unsafe for all functions)? Join discord if you have any question discord.gg/vMKhB9Q The program i wrote to count files. github.com/tearosccebe/fast_io/blob/master/examples/0009.fil…

Why it's here

2 people recommend this

What people say. Linked to argue that the unsafe keyword is too common in real-world Rust projects to easily audit.

u/dmyrelotin r/programming • Recommends

On “This shouldn't have happened: A vulnerability postmortem - Project Zero”

Whatever reason it is, it disapproves the idea you can easily grep out bugs from unsafe. link to this video

u/bisixyfin r/programming • Recommends

On “This shouldn't have happened: A vulnerability postmortem - Project Zero”

link to this video

u/bisixyfin r/programming • Recommends

On “This shouldn't have happened: A vulnerability postmortem - Project Zero”

link to this video