this post was submitted on 15 Nov 2023
226 points (97.5% liked)

Programmer Humor

18970 readers
487 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] [email protected] 5 points 9 months ago* (last edited 9 months ago) (1 children)

For those interested, this is because of how Rust uses value gaps to represent its nullable/enum structures. E.g., like how None for Option NonZeroU8 [sic, can't get formatting to work] is represented internally by a 0 instead of a wrapping structure.

When you have that many layers around a unit, it will start at 0 and bump the internal representation for each Some you turn into a None.

[โ€“] [email protected] 1 points 8 months ago

It's kinda like lambda calculus numbers