Björn Tantau to Programmer Humor@programming.dev • 1 month agoPretty straight forwardswg-empire.deimagemessage-square46fedilinkarrow-up11arrow-down10file-text
arrow-up11arrow-down1imagePretty straight forwardswg-empire.deBjörn Tantau to Programmer Humor@programming.dev • 1 month agomessage-square46fedilinkfile-text
minus-squaretiredofsametablinkfedilink0•1 month agoNow call that C program from some other program in another language.
minus-squareTraister101linkfedilink0•1 month agoAh 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)
minus-square@JasonDJ@lemmy.ziplinkfedilink0•edit-21 month agowith 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?""")
minus-square@xthexder@l.sw0.comlinkfedilink0•1 month agoMay I present to you: https://github.com/mame/quine-relay
Now call that C program from some other program in another language.
Rust, to make it safe.
step 1:
unsafe fn()
…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)
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?""")
May I present to you: https://github.com/mame/quine-relay
It’s… Beautiful.