723
you are viewing a single comment's thread
view the rest of the comments
[-] tiredofsametab@fedia.io 18 points 1 year ago

Now call that C program from some other program in another language.

[-] JasonDJ@lemmy.zip 25 points 1 year ago* (last edited 1 year ago)
with open('program.c', 'w') as f:
    f.write(
"""I'm not actually going to copy down the program... 

But you get the idea of the joke.

Right?""")
[-] bjoern_tantau@swg-empire.de 22 points 1 year ago
[-] tiredofsametab@fedia.io 14 points 1 year ago
[-] Traister101@lemmy.today 1 points 1 year ago

Ah yes now I can... dereference a raw pointer (yes that's essentially the only thing unsafe rust actually enables you to do, it doesn't disable the borrow checker or anything else, it just allows you to play with pointers)

[-] calcopiritus@lemmy.world 1 points 1 year ago
unsafe fn<'a, T>(p: &'a T) -> &'static mut T {
    p as *cons T as *mut T as &'static mut T
}

It is a bit more than just dereferencing raw pointers.

this post was submitted on 12 Mar 2025
723 points (98.4% liked)

Programmer Humor

31576 readers
2047 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 2 years ago
MODERATORS