C++ and C Mock Rust's Elaborate Efforts to Recreate Their Native Undefined Behavior
Description
This is a two-panel meme using the 'Look What They Need to Mimic a Fraction of Our Power' format from the animated series Invincible. In the meme, the powerful character Omni-Man is labeled 'C++' and the character he is holding, Invincible, is labeled 'C'. In the first panel, they are looking at a snippet of complex Rust code displayed in a dark-themed editor. The Rust code uses advanced and verbose features like explicit lifetimes, mutable static buffers, and function names like `get_horrible_buffer_mut` and `use_after_free`, satirizing the lengths one must go to in Rust to perform memory-unsafe operations. In the second panel, Omni-Man (C++) is yelling the punchline at Invincible (C): "Look what they need to mimic a fraction of our UBs". The word 'UBs' replaces the original 'power', referring to 'Undefined Behavior,' a class of dangerous and unpredictable bugs common in C and C++ that Rust's design is meant to prevent. The joke is a deeply ironic take on programming language design, where C++ and C veterans sardonically frame their languages' notorious memory safety issues as a form of effortless, raw 'power' that Rust can only achieve through painstaking, explicit effort
Comments
83Comment deleted
The sheer volume of Rust code required to intentionally trigger a use-after-free is an achievement in itself; in C++, we just call that 'Tuesday'
Rust devs: “hold my macro while I surgically expand this lifetime”; C devs: *forgets one free()* - boom, instant UB, zero build-time overhead
After 20 years of C++, you realize the real achievement isn't writing safe code - it's convincing management that the segfault in production was actually a feature request for 'dynamic memory reallocation with user-driven timing.'
Ah yes, the classic C programmer's flex: 'Our language is so powerful, we can corrupt memory in ways your compiler won't even let you compile.' It's like bragging that your car goes faster because you removed the brakes and airbags. Sure, Rust needs lifetimes, borrow checkers, and explicit unsafe blocks to achieve what C does with a simple pointer dereference - but that's precisely the point. When your language's greatest feature is the ability to shoot yourself in the foot at 3 AM on a Friday deploy, maybe it's time to reconsider whether 'undefined behavior' is really the flex you think it is
C++'s RAII fortresses barely chase C's UB demons, who deliver peak perf until they summon nasal hell at scale
C ships UB as a core feature; C++ emulates it with templates, RAII, and three sanitizers; Rust writes an essay in unsafe and black_box - then -O3 still decides your invariants were merely aspirational
Only C ships undefined behavior as a zero-cost abstraction; Rust needs black_box, lifetime acrobatics, and a thesis-length comment to reproduce the same 3am page
https://github.com/ladroid/CppBorrowChecker rust: looks what they need to mimic a fraction of out safety Comment deleted
that's a runtime borrowck... Comment deleted
Yeah, that's the point, lol Comment deleted
It's funny that every time C++ tries to compete with rust's memory system it's either an optional flag that barely works or a library which barely works Comment deleted
Or builtin semantic that requires phd to fully understand Comment deleted
😐 Comment deleted
best version control system every developer must use🤣 Comment deleted
The fact that this is github Comment deleted
"Just write good code" Comment deleted
why does rust syntax make my head hurt Comment deleted
Insufficient troon points, that's normal for regular people Comment deleted
please don't use slurs, thank you Comment deleted
Probably you learned C/C++ first. 😂😂 Then every other syntax looks like a joke. look at Python for ex. It doesn't seem like a code. More like a pusedo-code. How does it even do something 😒😒 Comment deleted
okay that's enough telegram for today Comment deleted
no c and c++ are lovely, what about js? Comment deleted
JS, C#, C3, D, Java and any other similar syntax that makes sense are way to go, just like old days people doing real thing... Comment deleted
JS is a joke tho Comment deleted
But writing code in it makes sense Comment deleted
Writing plugins/mods YES. Writing good code NO Comment deleted
And injecting code at runtime Comment deleted
I'm not gonna write code in like Zig or Rust or you name it.... Comment deleted
Fuck rust Comment deleted
By not mixing spaces and tabs /s Comment deleted
Python is racist Comment deleted
import racismsolver Comment deleted
Missing dependency: racism v1.5 Comment deleted
import("https://m.my.mail.ru/music/artists/Johnny%20Rebel") Comment deleted
import twitter Comment deleted
"oh no my syntax reads too much like speech" like bruh that's the point, or do you want your language to be hard to read and write on purpose? Comment deleted
I think its more qbout syntax thats expressive without reading. Yk like how modern humans took the arrow as a shape to suggest pointing somewhere Comment deleted
…elaborate please? Comment deleted
()=>{} "take that and put it through this logic" { Looks like this is a block of something } Comment deleted
I mean I guess, but the same can be said about python. I find it quite nice to have indentation actually mean something Comment deleted
Its kinda limited Comment deleted
Wtf. What a weird syntax Comment deleted
I wish Rust never existed. It's so annoying Comment deleted
Found the c kernel dev Comment deleted
✔️ Linux = widest platform support ✔️ C = widest platform support ❌ Rust = several popular platforms only Comment deleted
widest platform support doesn't matter if half of the platforms are dead Comment deleted
Not everything is dead (something is just emerging), but they may lack Rust at all, or lag significantly behind the upstream. Comment deleted
They call Linux a successful failure 😂😂 Comment deleted
I hate that rust is now allowed in linux Comment deleted
Let me go one step further. I hate linux too. 😂😂 Comment deleted
I am jsut starting to move to lunix Comment deleted
I miss myself back in 2012 thinking linux is gonna save the world. But now every Linux distros to me looks like the same with a different wallpaper Comment deleted
Rust supports almost every target that LLVM does. Which means that by "C = widest platform support", you mean "GCC = widest platform support", which a) GCC's Rust frontend aims to resolve, b) those platforms do not ever work properly under GCC anyway Comment deleted
not to mention that "Linux = widest platform support" is a dumb take, Linux is a platform itself, duh Comment deleted
Hand crafted assembly has even wider platform support :) Comment deleted
widest platform support is using it as deco like I do with old graphics cards and stuff Comment deleted
GCC and LLVM are not the only compiler frameworks in use, just like x86, ARM, MIPS, RISC-V, POWER and zSystems are not the only CPU architectures in use [that run Linux]. And even if they were the only compiler frameworks, one still needs to port each specific compiler frontend to the target CPU architecture. not to mention that "Linux = widest platform support" is a dumb take, Linux is a platform itself, duh "Platform" really means a combination of CPU and OS. So, in context of Linux as ta specific Os, "platform" refers to CPU architecture. Comment deleted
wow wow. you used "compiler frontend". my respect. Comment deleted
I mean, okay, can't argue with that logic Comment deleted
linux depends on rust nowadays Comment deleted
thankfully it doesnt Comment deleted
it literally contains rust code Comment deleted
has a config opotion to support modules written in rust != depends on rust Comment deleted
sure you can cripple linux if you want. there's just a lot of stuff that's not gonna work if you do Comment deleted
false dichotomy Comment deleted
speak without using jargon of a field you don't understand Comment deleted
this literaly is false dichotomy, not only do you equate not building MODULE with "crippling" linux, you also factually wrong about "this magical lot of stuff" that "not gonna work" how's linux was before they added rust support then?😅 lots of stuff weren't working? im so glad Linus went back on rust devs and purged the code from impertant places, leaving it to only reside in modules Comment deleted
its almost like stuff got rewritten or otherwise updated, y'know? Comment deleted
linux before they added rust support didn't support some newer hardware that now builds on the rust subsystem. I also hear they've refactored some internals, but I'm not sure if that got blocked by the C squad or not real world example: afaik linux won't work at all on M1 macs without rust, just because some essential drivers are written in rust Comment deleted
anyway, I still don't see how this has anything to do with a false dichotomy as you call it Comment deleted
Then it's a Mac users' problem — not the rest of the world. Just like closed-source Nvidia drivers (which therefore cannot be ported to other platforms — both in the sense of CPU and OS) are a problem for Nvidia users only. Comment deleted
source? Comment deleted
nvm i just remembered i don't care Comment deleted
C only wins because of signatures/symbols are use everywhere. Maybe its C++ idk don't remember Comment deleted
I wish engineering never existed, so we could just live in wooden houses and drink ayahuaska to talk to the spirits. but I'm forced to talk to the machine spirit and fix legacy code Comment deleted
me when I'm in a most ridiculous take competition and my opponent is @anonusernametg Comment deleted
real Comment deleted
if you think rust is annoying, just remember about rust users Comment deleted
Double annoying Comment deleted
wtf is this piece of shit Comment deleted
Rust Comment deleted
It's too much work for a simple skill issue Comment deleted
Fr Comment deleted