r/rustjerk • • 20d ago

MOD APPROVED "AI" does not satisfy the borrow checker.

220 Upvotes

Good day, fellow jerkers.

For some time, /r/rustjerk has had a rule against low effort content, which notably includes anything generated by "AI".

Watching the general discourse on the subreddit over time, it seemed to me that the community was generally in agreement in their views on "AI", but lately I've seen an increasing number of posts that are thinly veiled promotion of "AI" content under the guise of making fun of it. So I thought it would be a good idea to revise and clarify the rules around this.

/r/rustjerk is an anti-"AI" subreddit. The reasoning for this is simple: "AI" generated content is by definition trained on data that has been mutably borrowed more than once simultaneously, which is a violation of Rust's ownership and borrowing rules.

You can post things making fun of "AI" or people who use and support it, as long as it does not contain identifying information about the creator or the project itself, such that the post might drive legitimate traffic to the content. In many cases this might make it impossible to post such content, because the real project could be trivially found by searching the web for its name or tagline. In such cases, the content is simply not fit for /r/rustjerk. Ownership and borrowing is at the core of Rust's safety guarantees, and we must make sure to do whatever we can to uphold these sacred regulations.

The following text has been added to rule 5 to clarify this stance:

If you're posting something made by "AI" to make fun of it, make sure you've obscured any identifying information that might drive legitimate traffic to it. When in doubt, just don't post anything related to "AI".

Feedback on this wording is welcome, but it is not up for litigation whether or not "AI" content or pro-"AI" sentiments are allowed in /r/rustjerk. If that's your cup of tea, you are welcome to make your own subreddit with different rules, akin to how crab memes are welcomed on /r/rustjerkjerk.

Thank you for your time and attention. You may now continue masturbating.


r/rustjerk • • 2d ago

Never(!) thought I'd say this, but thanks for Nothing, Scala

Post image
232 Upvotes

Look I'm a tired dad I need to get these puns out of the system occasionally


r/rustjerk • • 3d ago

Upcoming rust contender??? C with generics: crust

13 Upvotes

I was watching tsoding's crust stream and I thought it would be so funny if I extended c to have generics like rust. Here is the result of that abomination:

#include <stdio.h>

// you can define your own operator in fortran .op. style with a trait
trait<T> DotP {
    // for parsing reasons any dot-op must have whitespaces around it in any context
    T .dot. (Self self, Self other);
}

// using a very similar syntax to rust, you can add generics to structs
typedef<T> struct {
    T x;
    T y;
    T z;
} Vector<T>;

// and by appling the trait to your struct (with generic parmeters)
// you can define what your operator should do.
impl<T> DotP<T> for Vector<T> {
    T .dot. (Self self, Self other){
        return self.x * other.x + self.y * other.y + self.z * other.z;
    }
}

int main(void) {
    // by concretly defining which type you want to use as the generic
    // you create in generated c a struct with that/those type(s)
    Vector<float> fv = {1.0, 2.0, 3.0};
    printf("Dot product of fv^2: %f\n", fv .dot. fv);
    Vector<int> iv = {1, 2, 3};
    printf("Dot product of iv^2: %d\n", iv .dot. iv);
}

// The generated c code looks something like this:

// /* Generated by typedc. */
// #ifndef TYPEDC_SIMPLE_GENERICS_H
// #define TYPEDC_SIMPLE_GENERICS_H
//
// #include <stdio.h>
//
// typedef struct float_Vector float_Vector;
// typedef struct int_Vector int_Vector;
//
// struct float_Vector {
//     float x;
//     float y;
//     float z;
// };
//
// struct int_Vector {
//     int x;
//     int y;
//     int z;
// };
//
// int main(void);
// static inline float float_dot(float_Vector self, float_Vector other);
// static inline int int_dot(int_Vector self, int_Vector other);
//
// int main(void) {
//     float_Vector fv = {1.0, 2.0, 3.0};
//     printf("Dot product of fv^2: %f\n", float_dot(fv, fv));
//     int_Vector iv = {1, 2, 3};
//     printf("Dot product of iv^2: %d\n", int_dot(iv, iv));
// }
//
// static inline float float_dot(float_Vector self, float_Vector other) {
//     return self.x * other.x + self.y * other.y + self.z * other.z;
// }
//
// static inline int int_dot(int_Vector self, int_Vector other) {
//     return self.x * other.x + self.y * other.y + self.z * other.z;
// }
//
// #endif /* TYPEDC_SIMPLE_GENERICS_H */

https://github.com/HyperRays/typedc


r/rustjerk • • 3d ago

/r/playrust just installed rust, any tips?

Post image
549 Upvotes

r/rustjerk • • 6d ago

why wont my program compile

Post image
347 Upvotes

r/rustjerk • • 8d ago

Me seeing the news about Discord

Post image
251 Upvotes

r/rustjerk • • 10d ago

rawdogging

77 Upvotes

r/rustjerk • • 11d ago

When you need to go "unsafe { }"

Post image
95 Upvotes

r/rustjerk • • 12d ago

saved you one character

Post image
275 Upvotes

r/rustjerk • • 15d ago

Kojima

Post image
1.5k Upvotes

r/rustjerk • • 17d ago

thanks rust-analyzer, i'll consider it

Post image
439 Upvotes

let's circle back on this later


r/rustjerk • • 22d ago

Written in 95% safe Rust

Post image
271 Upvotes
// finally, memory safety!

mod gc {
    use std::sync::LazyLock;
    use dlopen::raw::Library;

    type Malloc = extern "C" fn(usize) -> *mut std::ffi::c_void;

    static LIBGC: LazyLock<Library> = LazyLock::new(|| {
        Library::open("libgc.so").unwrap()
    });

    static GC_MALLOC: LazyLock<Malloc> = LazyLock::new(|| unsafe {
        LIBGC.symbol::<Malloc>("GC_malloc").unwrap()
    });

    pub struct GcPtr<T>(*mut T);

    impl<T> std::ops::Deref for GcPtr<T> {
        type Target = T;
        fn deref(&self) -> &T {
            unsafe { &*self.0 }
        }
    }

    pub fn alloc<T>(value: T) -> GcPtr<T> {
        let address = GC_MALLOC(std::mem::size_of::<T>()) as _;
        unsafe { std::ptr::write(address, value) };
        GcPtr(address)
    }
}

#[cfg(test)]
mod tests {
    use super::gc;

    #[test]
    fn doesnt_crash() {
        assert_eq!(*gc::alloc(123), 123);
    }
}

r/rustjerk • • 22d ago

This is fun

Post image
115 Upvotes
use std::alloc::{alloc, dealloc, Layout};
use std::slice;

fn main() {
    [0].into_iter()
        .chain(
            (0..6).into_iter().map(|i| 1 << i)
        ).for_each(unsafe_shenanigans)
}

fn unsafe_shenanigans(length: usize) {
    unsafe {
        let layout: Layout = Layout::array::<i32>(length).unwrap();
        let pointer: *mut i32 = alloc(layout).cast();

        let arr: &mut [i32] = slice::from_raw_parts_mut(pointer, length);
        arr.fill(1);

        println!("{:?}", arr);

        dealloc(pointer.cast(), layout);
    }
}

Output:

[]
[1]
[1, 1]
[1, 1, 1, 1]
[1, 1, 1, 1, 1, 1, 1, 1]
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]
[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]

When do I get my Rust software developer job?


r/rustjerk • • 24d ago

"Rust would have fixed this"

Post image
831 Upvotes

r/rustjerk • • Oct 14 '26

Why is my good looking rust code not working?

Post image
335 Upvotes

Hello, imn't new to rust. This rust code looks really good i must say. However, it is literally the opposite of working right now?
Current output:

4 is odd!

I just don't understand whats going on... Can some rustishn fix this devious error for me? thanks.
playground link


r/rustjerk • • Oct 14 '26

Rust devs hate this one simple trick

Post image
406 Upvotes

r/rustjerk • • Oct 10 '26

Forked Evolution.

18 Upvotes

1 year ago , This proposal was posted in derails. Some people started to harass, got very upset, report it to github until the accounts were suspended. I don't think they even used the official way, because none of the account received a termination notice. (maybe a Github employee or copilot after being flooded by complains.)

Anyway, 1 year later, the plan was executed by AGENT DHH in Rails world.

I'm bringing you today a more futuristic project ForkedEvolution.

Project is young, so feel free to join.

AMA.


r/rustjerk • • Oct 09 '26

"AI" bad Claude couldn't take the abuse.

Post image
575 Upvotes

r/rustjerk • • Oct 09 '26

thoughts on the new syntax?

77 Upvotes

r/rustjerk • • Oct 09 '26

Cargo = C arg on

24 Upvotes

I just realized that cargo almost spells "C arg on".

Rust's package manager is one letter away from telling me to turn C on.

The memory-safe language really said C arg on.

I can't unsee this now.

It wasn’t intentional; it just popped into my head, quite literally


r/rustjerk • • Oct 09 '26

Has the situation improved or should I stick with Gasoline for now?

Post image
248 Upvotes

r/rustjerk • • Oct 09 '26

/r/playrust Nothing Safe

Post image
303 Upvotes

r/rustjerk • • Oct 06 '26

Everyone has errands,

46 Upvotes

but only rustaceans have okands


r/rustjerk • • Oct 06 '26

A poem about Rust.

0 Upvotes
Hello dear dev, and welcome to Rust
This poem may help you getting started
It may give you a quick intro of this language
That was never designed to be easy

Just as life, .rs is hard
Snakes and crabs are pretty opposite
One manages all for you, and is quite fun to learn!
The other makes you rethink all your life choices

It's not wrong to say
That we all need a guide to become expert
Remember I said that this may help you?
It's supposed to protect you.

"From what?" you may ask, fellow Python-ist
From all the horrors that this language hides
Beneath the friendly face, and a cool logo
A dark borrow-checker lies.

But once you get past this,
Rust will become heaven
Because once you start developing,
You'll die from hatred.

Never forget, fellow dev,
That this poem is just to laugh
But I promise you, one day
You'll think: "Was it right though?"