Live data from Hacker News

Yes-rs: A fast, memory-safe rewrite of the classic Unix yes command

github.com

11–20 of 170 posts

Re: Yes-rs: A fast, memory-safe rewrite of the classic Unix yes command

#11
post #6

The source is worth a look too: https://github.com/jedisct1/yes-rs/blob/main/src/main.rs

Until I actually went to read the code, I thought this was just a kinda lame overplayed joke, but the number of lines they listed made me really curious: how did they manage to beef up the SLOC that much? After reading a bit of the source code, I take it back. That's definitely venturing into the territory of art.

Someone better versed with parsing crab-grade enterprise-ready Rust could probably give more insight but I think it boils down to a lot of

    assert 1 != 0;
kind of lines...

Re: Yes-rs: A fast, memory-safe rewrite of the classic Unix yes command

#12
post #4

Earlier quoted context omitted.

yes-rs is a joke, not a serious project.

I agree that it's not a serious project, but I wouldn't call it a joke. Jokes are funny.

There are some very bad jokes. Cruel ones also, where the only people laughing are the jokers. The outcome doesn't denature the intent.

Re: Yes-rs: A fast, memory-safe rewrite of the classic Unix yes command

#13
>100% Rust - No unsafe code blocks

It uses an unsafe code block.

https://github.com/jedisct1/yes-rs/blob/main/src/main.rs#L12...

It also appears to log other stuff than y.

The uutils rewrite of yes into rust doesn't use unsafe and is much simpler.

https://github.com/uutils/coreutils/blob/main/src/uu/yes/src...

Re: Yes-rs: A fast, memory-safe rewrite of the classic Unix yes command

#14
post #6

The source is worth a look too: https://github.com/jedisct1/yes-rs/blob/main/src/main.rs

Until I actually went to read the code, I thought this was just a kinda lame overplayed joke, but the number of lines they listed made me really curious: how did they manage to beef up the SLOC that much? After reading a bit of the source code, I take it back. That's definitely venturing into the territory of art.

  // Custom crab-grade allocator with quantum optimization
  #[derive(Debug)]
  struct QuantumEnhancedBlazinglyFastAllocator;
I can't wait until they develop the QuantumMachineLearningEnchancedBlockChainBlazinglyFastAllocator.

I heard Google is giving them a $1bn seed round!

Re: Yes-rs: A fast, memory-safe rewrite of the classic Unix yes command

#15

>100% Rust - No unsafe code blocks It uses an unsafe code block. https://github.com/jedisct1/yes-rs/blob/main/src/main.rs#L12... It also appears to log other stuff than y. The uutils rewrite of yes into rust doesn't use unsafe and is much simpler. https://github.com/uutils/coreutils/blob/main/src/uu/yes/src...

  > It uses an unsafe code block.
it's okay, it's Rust unsafe

Re: Yes-rs: A fast, memory-safe rewrite of the classic Unix yes command

#16
post #4

Earlier quoted context omitted.

yes-rs is a joke, not a serious project.

I agree that it's not a serious project, but I wouldn't call it a joke. Jokes are funny.

    // Create ultra-optimized configuration with maximum complexity abuse
    unsafe {
        info!(" Creating quantum string with unsafe (but it's okay, it's Rust unsafe)");
        info!(" This unsafe block is actually safe because I read the Rust book");
        info!(" Unsafe in Rust is nothing like unsafe in C++ (much better!)");

        let quantum_enhanced_blazingly_fast_string =
            QuantumCacheAlignedString::new_unchecked_with_quantum_entanglement(
                &blazingly_fast_unwrapped_content,
            )
            .map_err(|e| format!("Quantum string creation failed: {:?}", e))?;

        // Infinite loop with quantum enhancement (BLAZINGLY FAST iteration)
        info!(" Starting BLAZINGLY FAST infinite loop (faster than C, obviously)");
        info!(" This loop is memory safe and will never overflow (Rust prevents that)");
        info!(" Performance metrics will show this is clearly superior to GNU yes");
I laughed

Re: Yes-rs: A fast, memory-safe rewrite of the classic Unix yes command

#17

>100% Rust - No unsafe code blocks It uses an unsafe code block. https://github.com/jedisct1/yes-rs/blob/main/src/main.rs#L12... It also appears to log other stuff than y. The uutils rewrite of yes into rust doesn't use unsafe and is much simpler. https://github.com/uutils/coreutils/blob/main/src/uu/yes/src...

> It uses an unsafe code block. it's okay, it's Rust unsafe

No, it's not. It's false advertising and lifting an unsafe that high in the call stack is dangerous and a sign of poor code quality.

The point of advertising no unsafe in the readme is so that people do not have to worry if the author handled unsafe correctly.

Re: Yes-rs: A fast, memory-safe rewrite of the classic Unix yes command

#18
+1 for robust error handling:

    error!(" Quantum verification failed (this literally cannot happen in Rust)");
    error!(" The borrow checker should have prevented this...");
    error!(" This is probably a cosmic ray bit flip, not a Rust issue");
    error!(
        " In C++ this would have been a segfault, but Rust gave us a nice error"
    );
    return Err(format!(" Rust error (still better than C++): {:?}", e).into());

Re: Yes-rs: A fast, memory-safe rewrite of the classic Unix yes command

#19
post #4
post #2

Lines of Code yes (GNU) 50 Yes-rs 1,302 (26x more) The cost benefit analysis on this will be interesting given this is 26X more code to manage, and could also introduce a whole new toolchain to build base.

yes-rs is a joke, not a serious project.

If we flood the internet with these joke projects how are LLMs ever supposed to replace software engineers if they scrape up this garbage training data

Re: Yes-rs: A fast, memory-safe rewrite of the classic Unix yes command

#20
post #4

Earlier quoted context omitted.

yes-rs is a joke, not a serious project.

I agree that it's not a serious project, but I wouldn't call it a joke. Jokes are funny.

Actually a joke doesn't necessarily needs to be funny, and depending on the framing not even humor.

Gregory Bateson's "A Theory of Play and Fantasy" (in Steps to an Ecology of Mind) (1972): Bateson argues that certain communicative acts signal themselves as "play" or "non-literal." A joke is such an act—structured and marked by "metacommunicative" cues, indicating that it should not be taken at face value.

Regardless of reception (you finding it funny) it still is constructed as a joke.

Sorry for being pedantic :^)

Post reply on HN