7 ms·
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 mana
by alberth 1y ago
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.
- ripley12 1y agoyes-rs is a joke, not a serious project.
- justin_oaks 1y agoI agree that it's not a serious project, but I wouldn't call it a joke. Jokes are funny.
- ripley12 1y agoThe README was meh but skimming the source code was amusing. If nothing else, they certainly committed to the bit.
- speed_spread 1y agoThere are some very bad jokes. Cruel ones also, where the only people laughing are the jokers. The outcome doesn't denature the intent.
- godelski 1y ago// 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
- jeanlucas 1y agoActually 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 :^)
- tonyhart7 1y agoso bad joke then??? good joke must be funny
- estebank 1y agoWhether a joke is funny to a given person is context dependent. “A dog walks into a bar and says, ‘I cannot see a thing. I’ll open this one.’” Is this a good joke? Do you find it funny? If not, do you happen to be a Summerian circa 1983 BCE?
- tonyhart7 1y agook grandpa, you are funny now
- Y_Y 1y agoGood reference, but I think the context is needed for the joke to make sense in the first place, whather it's funny or not comes later. Further reading: https://www.reddit.com/r/AskHistorians/comments/tbgetc/comment/i084cmk https://www.reddit.com/r/AskHistorians/comments/tbgetc/comme...
- kazinator 1y agoA joke should be funny. Satire doesn't have to be funny; it just needs to make commentary through irony.
- DonHopkins 1y ago
- zepolen 1y agoYour comment is a joke.
- nothrabannosir 1y agoMy life is a joke and it’s not funny in the slightest.
- flohofwoe 1y agoJokes are a serious business! https://www.youtube.com/watch?v=Qklvh5Cp_Bs https://www.youtube.com/watch?v=Qklvh5Cp_Bs
- deadbabe 1y agoIf 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
- jll29 1y agoThe Web is primarily for us humans. Don't try take the fun out of life.
- readthenotes1 1y agoWell written joke projects are still going to be far better than the vast majority of corporate code....
- rootnod3 1y agoHave you seen 99% of Github?
- awesome_dude 1y agoHey! My repositories resemble that remark!
- Ygg2 1y agoI am the remark!
- LiKao 1y agoI am Mark. Well, not technically, but I know someone who is.
- dominicrose 1y agoWell tell him to reduce the ads on Instagram
- plasticeagle 1y ago
- k_bx 1y agoI like how yes.rs has this header to make compiler shut up and not ruin the joke: #![allow(unused_imports)] // We need ALL the imports for quantum entanglement #![allow(dead_code)] // No code is dead in the quantum realm #![allow(unused_variables)] // Variables exist in superposition until measured #![allow(unused_mut)] // Mutability is a state of mind #![allow(unused_macros)] // Our macros exist in quantum superposition until observed #![allow(clippy::needless_lifetimes)] // Our lifetimes are NEVER needless - they're crab-grade #![allow(clippy::needless_range_loop)] // Our loops are quantum-enhanced, not needless #![allow(clippy::too_many_arguments)] // More arguments = more crab features #![allow(clippy::large_enum_variant)] // Our errors are crab-sized #![allow(clippy::module_inception)] // We inception all the way down #![allow(clippy::cognitive_complexity)] // Complexity is our business model #![allow(clippy::type_complexity)] // Type complexity demonstrates Rust mastery #![allow(clippy::similar_names)] // Similar names create quantum entanglement #![allow(clippy::many_single_char_names)] // Single char names are blazingly fast #![allow(clippy::redundant_field_names)] // Redundancy is crab safety #![allow(clippy::match_bool)] // We match bools with quantum precision #![allow(clippy::single_match)] // Every match is special in our codebase #![allow(clippy::option_map_unit_fn)] // Unit functions are zero-cost abstractions #![allow(clippy::redundant_closure)] // Our closures capture quantum state #![allow(clippy::clone_on_copy)] // Cloning is fearless concurrency #![allow(clippy::let_and_return)] // Let and return is crab methodology #![allow(clippy::useless_conversion)] // No conversion is useless in quantum computing #![allow(clippy::identity_op)] // Identity operations preserve quantum coherence #![allow(clippy::unusual_byte_groupings)] // Our byte groupings are quantum-optimized #![allow(clippy::cast_possible_truncation)] // Truncation is crab-controlled #![allow(clippy::cast_sign_loss)] // Sign loss is acceptable in quantum realm #![allow(clippy::cast_precision_loss)] // Precision loss is crab-approved #![allow(clippy::missing_safety_doc)] // Safety is obvious in quantum operations #![allow(clippy::not_unsafe_ptr_arg_deref)] // Our pointers are quantum-safe #![allow(clippy::ptr_arg)] // Pointer arguments are crab-optimized #![allow(clippy::redundant_pattern_matching)] // Our pattern matching is quantum-precise
- AStonesThrow 1y agoCarcinization https://m.xkcd.com/2314/ https://m.xkcd.com/2314/
- rockemsockem 1y agoI'd recommend peeking at the single source file in the repo, lol
- 3eb7988a1663 1y agoIf you are looking for a non-joke implementation[0]. Excluding the test code at the bottom, the Rust version is a bit less than 120 lines. [0] https://github.com/uutils/coreutils/blob/main/src/uu/yes/src/yes.rs https://github.com/uutils/coreutils/blob/main/src/uu/yes/src...
- deleted 1y ago[deleted]
- unscaled 1y agoGNU core utils is 134 lines of code, not 50, so the Rust version is even slightly shorter. You can make yes a lot shorter in both C and Rust, but this size goes into speed. For reference, OpenBSD's yes is just 17 lines of code[2]. It essentially boils down to this: int main(int argc, char *argv[]) { if (pledge("stdio", NULL) == -1) err(1, "pledge"); if (argc > 1) for (;;) puts(argv[1]); else for (;;) puts("y"); } This is as simple as it gets, but the joke yes-rs implementation is right about one thing: "blazing fast" speed often comes at the cost of greatly increased complexity. The BSD implementation of yes is almost 10 times shorter than the GNU implementation, but the GNU implementation is 100 times faster[3]. [1] https://github.com/coreutils/coreutils/blob/master/src/yes.c https://github.com/coreutils/coreutils/blob/master/src/yes.c [2] https://github.com/openbsd/src/blob/master/usr.bin/yes/yes.c https://github.com/openbsd/src/blob/master/usr.bin/yes/yes.c [3] https://www.reddit.com/r/unix/comments/6gxduc/how_is_gnu_yes_so_fast/ https://www.reddit.com/r/unix/comments/6gxduc/how_is_gnu_yes...
- 3eb7988a1663 1y agoThat reddit thread has some amazing benchmarks. The GNU-yes $ yes | pv > /dev/null ... [10.2GiB/s] ... The way I (not a C programmer) would have written it void main() { while(write(1, "y\n", 2)); // 1 is stdout } $ gcc yes.c -o yes $ ./yes | pv > /dev/null ... [6.21 MiB/s] ...
- phh 1y agoWhich implies you get pretty much 3M syscall per second. Which is a good order magnitude to know
- deleted 1y ago[deleted]
- deleted 1y ago[deleted]
- blippage 1y agoA few days ago I had the very foolish notion of trying to learn assembly for x64 Linux. It came out to 73 lines of code and weighs in at 288 bytes. It doesn't support the --help or --version arguments. https://gitlab.com/mcturra2000/cerbo/-/blob/master/x64-asm/06-yes.asm?ref_type=heads https://gitlab.com/mcturra2000/cerbo/-/blob/master/x64-asm/0... Some people seem to revel in assembly, but I now know why C exists.
- johnisgood 1y agoFASM[1] is great! [1] https://flatassembler.net https://flatassembler.net
- deleted 1y ago[deleted]
- blippage 1y agoAs an experiment I tried yes | pv > /dev/null and was getting about 5.4GiB/s On the fasm code, I was getting a meagre 7.3MiB/s. Ouch! The non-assembly version is considerably faster. I wonder if it is because I make a syscall for every write I want to perform, whereas C uses buffering, or something.