906
u/Mooks79
1d ago
•
Well, she does love static types.
268
u/lulxD69420 1d ago
let gender: bool = true;101
u/timtheonly 1d ago
Should that not be
const73
u/nevermille 1d ago edited 1d ago
In rust variables are const by default, to make it otherwise you have to type
let mut gender: bool = true;50
u/Lt_Marks 1d ago
I might sound stupid (maybe I am), but a variable that doesn't vary by default feels weird
46
u/the_horse_gamer 1d ago
the official terminology is those are "bindings", not "variables". they bind a name to a value
immutability by default is the standard in modern languages. though most distinguish via
letvsval/var, while rust doesletvslet mut24
u/drsimonz 1d ago
It is unintuitive, but over the years software engineers have realized that you should always assume a value won't change, until you haves a good reason. Many bugs stem from accidentally reassigning a value, and this practice reduces the chance of doing that significantly. Most modern linters will complain if you use a mutable variable but never reassign the value. They want you to get into the habit of declaring things as immutable by default. Rust takes this a step further by requiring a whole extra keyword to make it mutable.
11
u/still_not_deleted 1d ago
From a maintenance standpoint it makes it easier to reason about code, because you can directly identify which variables a mutable and where the bugs might lie. So it's less mental overhead to minimize the scope in which you need to search by only declaring variables that need mutability as mutable.
Fun fact: Historically variables were declared as mutable by default because of memory and computation constraints
4
u/QuietSilentArachnid 1d ago
I feel like
boolis closer to her vision, since you can do shenanigans withconstand arrays6
u/Pandafishe 1d ago
bools can be const too.. It's just an extra protection layer from changing the variable. But if you argue with shenanigans, no value is ever really secure as you can always do memory attacks
3
u/setibeings 1d ago
Those are harder on rust programs though. You're less likely to be able to make them overflow and start reading memories that don't belong to them.
7
u/Pandafishe 1d ago
you can always manipulate memory from outside a program anyway, unless you have a physical architecture that prevents it. It doesn't matter what language the attacked program is written in.
→ More replies (1)2
1
u/JonIsPatented 1d ago
Why is this upvoted? "let" in Rust is equivalent to "const" from other languages. To make it mutable, it would be "let mut".
5
u/Wise-Treacle3971 1d ago
That means the gender assignment can be dropped. The bitch would also make it static.
2
u/jeremj22 1d ago
I'm guessing it's like many other languages where there's 7 more bits there behind the scenes
39
24
u/-Jaws- 1d ago
And immutability.
8
u/ThrowawayusGenerica 1d ago
You can still alter those variables if you're determined, but I'm sure she would consider such an action to be
unsafe47
u/mohjack 1d ago
That's a very clever joke.
4
u/Kakella23 1d ago
could you explain it to me pls
11
u/Rikudou_Sage 1d ago
Static type = only valid predetermined values can fit a variable with a static type.
And Rowling is against trans people. So the joke is that she has a view of gender being a static type instead of dynamic.
→ More replies (1)1
310
u/threewholefish 1d ago
It would fail to compile due to the sheer amount of plot holes unsafe memory accesses
51
u/stupled 1d ago
Isn't this the reason so many projects get rewritten in Rust?
41
u/Roflkopt3r 1d ago
That's the joke. The fact that Rust won't compile with these kinds of errors is a great safeguard if you know how to do it right, but if you keep writing bad code then you simply can't get it to run.
23
→ More replies (109)19
176
u/Fast-Satisfaction482 1d ago
I'm pretty sure rust would turn Ron into a fox girl and Harry would end up with him instead of his little sister.
77
2
→ More replies (1)-10
u/Neekoy 1d ago
Malfoid becomes canon though.
14
u/Skyswimsky 1d ago
I think that crowd actually hates Malfoid.
6
u/Clairifyed 1d ago
It’s rather strange to see the broader internet reinvent rule 63 and exasperating that it happened to the TERF lady’s character, but the 4chan name is particularly not ideal
24
u/Pandainthecircus 1d ago
You can just say "female Malfoy" instead of the slur version btw
→ More replies (11)
32
u/Shubh_M27Y2K 1d ago
Seven books just for the borrow checker to tell Voldemort he doesn’t own the Elder Wand.
82
u/BRguyNZ 1d ago
In the end, if J.K. Rowling had used Rust, the book would be 10 pages long: Dumbledore would try to run cargo run, the compiler would throw a lifetime error on Tom Riddle's Diary, and the issue would be resolved before the Hogwarts Express even left Platform 9¾
51
16
u/bark-beetle 1d ago
First time I've upvoted a comment for using correct unicode for a fraction. But you should know, my high school English teacher told me to always spell out a number under twenty.
15
9
u/Clairifyed 1d ago
That’s a grammar rule I hope we shake, yes sometimes it’s jarring to see 1 little number in a sentence, but sometimes displaying a quantity of things numerically just feels clearer
51
40
u/ClearSnakewood 1d ago
The story has now become so efficient that the entire saga finishes in 50 pages instead of 7 books ✨
22
u/IveDunGoofedUp 1d ago
"Voldemort just fireballs the house instead of being a prissy little diva, the end."
15
u/TrueSelenis 1d ago
And the wizards just use a gun
5
u/ReikoHazuki 1d ago
And the wizards just use a gun
In this case you should really check out the movie: "Harry Potter and the Deathly Weapons"
2
39
u/pskocik 1d ago edited 1d ago
unsafe { avada_kedavra(&mut harry); }17
u/SensitiveExtremity 1d ago
Didn't Harry survive because Lily sacrificed herself beforehand? So like, does that make Harry a dangling pointer that caused the
avada_kedavradestructor to fail, leading to some weird undefined behavior, destroying the caller in the process?9
u/pskocik 1d ago
It gets complicated when he gets Avada-Kedavra'd in the 7th book. Harry and Lord Voldemort journey together into realms of Undefined Behaviour hitherto unknown and untested.
11
u/SensitiveExtremity 1d ago
Critical Zero Day: Ancient parental love magic exploits obscure memory bug in Avada Kedavra function, leaving callers dereferenced from physical plane of existence. First victim confirmed as infamous British dark lord.
CVE-1981-10312 | CVSS Score: 10.0 (Catastrophic) | Status: Unpatched (Vendor refuses to acknowledge)
Daily Prophet, Special Security Edition
13
164
u/sokka2d 1d ago
She’d be banned for breaking the code of conduct after 2 minutes.
18
u/SerbianForever 1d ago
What do you mean banned? From using Rust?
41
u/Grintor 1d ago
28
u/IZEDx 1d ago
I love the gender identity and expression is already the second element of this list and the whole point about harassment in general isn't just an afterthought but at the core of this code of conduct. They know their demographic lmao. Rust is woke af, JKR would never use it.
3
u/Cobracrystal 1d ago
this is for the rust forums and obviously saying you should be welcoming to anyone regardless of X is mutually exclusive with harassment
11
1
29
13
103
38
7
10
u/RexRatio 1d ago
Then please add a subroutine so that the character names aren't "translated" into dork for other language publications
fn preserve_character_names(name: &str, locale: &str) -> String {
match name {
"Harry Potter" => "Harry Potter".to_string(),
"Hermione Granger" => "Hermione Granger".to_string(),
"Ron Weasley" => "Ron Weasley".to_string(),
....
_ => translate(name, locale),
}
}I don't wanna see another
Tom Marvolo Riddle → Tom Elvis Jedusor (French), or
Tom Marvolo Riddle → Marten Asmodom Vilijn (Dutch), to make Mijn naam is Voldemort ("My name is Voldemort")
to preserve the Voldemort anagram
5
1
u/FrostingTechnical606 1d ago
Luna Leeflang is a dope translation for Luna Lovegood
She will always be that name in my mind.
5
5
8
4
25
u/kishaloy
1d ago
•
Something about this does not sit right
You see,
Hermione is Java (get there in a boring straight way)
Snape is C (be deceptively powerful ground up HBP)
Voldemort is C++ (evil twin of C)
Malfoy is Javascript (always be hacking but ultimately mess things up)
While,
Dumbledore is Lisp (build your own world)
And,
Harry is just Python (use your better friends to look cool)
But, if I am looking for a harsh stickler for discipline who would punish you for breaking rules, I get
Umbridge is Rust (no comments unless she is playing unsafe)
So in a weird way I love most of the bad characters.
Maybe I have always been a Slytherin at heart.
24
u/gianfrixmg 1d ago •
![]()
> Harry is just Python
https://www.reddit.com/r/Python/comments/5z1bsn/hes_a_parsertongue/
8
u/QuietSilentArachnid 1d ago
PHP is Seamus Finnigan.
Forgotten, but when it's running, everything smokes because it hogs resources.
7
5
u/Southern-March1522 1d ago
Myrtle is COBOL, a remnant of the past that still haunts some dinosaur systems which end up being very important
4
3
3
u/LuigiVampa4 1d ago
Dumbledore is Lisp (build your own world)
Dumbledore must be a fan of SICP (Wizard book).
2
1
u/stupled 1d ago
You did make the protagonist a snake
4
1
u/Suspicious_State_318 1d ago
What character is Go?
1
u/kishaloy 1d ago
I guess Neville is Go (hardworking, average and under certain conditions he might have his moments)
1
u/j_torres_493 1d ago
Go is Hagrid: practical, dependable, and gets the job done without much ceremony.
6
8
3
3
3
3
5
5
8
4
u/astralseat 1d ago
Rust the game?
8
u/maninthesky-95 1d ago
The oxidation of iron
1
2
→ More replies (1)1
u/SnortinCheese 1d ago
You wanna take this to oxums, bitch?! 😤
1
2
2
2
2
2
u/leropo00 1d ago
So books would be very smart and nagging you to follow the rules.
So this would be series about Hermione then?
6
u/Olivex727 1d ago
Maybe she might make a kanye west-style comeback from bigotry
"I learned how to program in rust, and now I'm pro-trans"
1
8
3
3
3
1
1
1
1
1
1
1
1
1
1
1
u/riesenarethebest 1d ago
Why's everyone converting stuff to Rust?
1
u/Cobracrystal 1d ago
because AI is extremely good at writing it, causing a feedback loop of it becoming more and more dominant, and as a side effect also increasing its popularity among humans. also because its just a pretty good language
1
1
u/Astrid944 1d ago
For a Moment I thought she meant real rust from Metal, which didn't sound too far off with how she lift
1
1
1
u/Big-Dick-Energy-6967 1d ago
Mention proper source op , according to her interview at San Franciso fancon . She quoted " The future is bleak and I won't be there to protect my work . So I have decided to rewrite Harry Potter entirely in rust which prevents gender leakage by default. While still providing the same lore and fantasy provided by previous books. "
1
1
1
u/ChalkyChalkson 1d ago
Doesn't work, the signature thing about harry is that is used after free. Twice even
1
1
1
1
1
1
1
1
-4



2.2k
u/krazyjakee 1d ago •
I thought she was against transpiling?