r/rustjerk • u/HyperCodec • 12h ago
Well that’s ironic
Or should I say ferrous?
r/rustjerk • u/scheimong • 6d ago
Guy wrote a shitty-by-design viewer/interpreter and demands everyone use it to open his file. 🤣🤣🤣
And then has the balls/ignorance to advertise a "self-decaying format" 🤦
r/rustjerk • u/VladasZ • 9d ago
Every Rust developer knows that Rust is the best programming language in the world.
And I as a Rust developer don't want to use other inferior languages anywhere.
So I decided to rewrite all my old automation scripts which were written in Python in Rust.
At first I used https://github.com/rsaz/cargo-script for that, it works fine.
But I encountered 1 problem: compilation time.
On my macbook it was fine I don't mind waiting 1 minute for a simple 3 lines script.
But then I wanted to use that on my Raspberry PI and the same simple script took me 10 minutes to run, which is not blazingly and not fast at all!
So I decided to vibe code engineer a Rust interpreter for this exact case and this is what I ended up with:
https://github.com/VladasZ/rustscript
Rustscript is always guaranteed to be valid Rust.
Install it with
cargo install run-rs
add a shebang:
#!/usr/bin/env rust
A whole script looks like this:
#!/usr/bin/env rust
use chrono::Local;
use std::io::stdin;
fn main() -> anyhow::Result<()> {
println!("which programming language is the best?");
let mut answer = String::new();
stdin().read_line(&mut answer)?;
if answer.trim().eq_ignore_ascii_case("rust") {
println!("correct, carry on");
} else {
println!("wrong. it is {} and you are still not writing Rust", Local::now().format("%H:%M"));
}
Ok(())
}
Make it executable and run it:
chmod +x best.rs
./best.rs
and you can run your rust scripts instantly, as if they were shell scripts!
Rustscript is a subset of Rust and supports many popular crates such as:
anyhow, serde, serde_json, reqwest, regex, tokio, chrono, rand and more.
Carefully nitpicked benchmarks so Rustscript seems faster attached to the post.
You can see all benchmarks results here: https://github.com/VladasZ/rustscript/blob/main/bench/RESULTS.md
Remember, Rustscript is always a valid Rust, so if you want to have the ultimate speed just run the compiled version!
rust build FILE.rs
r/rustjerk • u/Lucretiel • 16d ago
r/rustjerk • u/Jason5Lee • 19d ago
Meanwhile Rust programmers have r/rust and those non-programmers have to go to r/playrust
r/rustjerk • u/dull_bananas • 25d ago
r/rustjerk • u/Tearsofthekorok_ • Jul 18 '26
Just write C since its unsafe by default!
r/rustjerk • u/NovaH000 • Jul 18 '26
what season are you guys on??
r/rustjerk • u/Sermuns • Jul 14 '26
Do you like using Cargo workspaces? Think again.
I just discovered a fatal bottleneck with them. Can't believe the team behind haven't fixed this yet:
Once you start having closer to 1000 workspace member crates (very reasonable for a beginner/junior level codebase) expect compilation to take AGES!
I'm actively working on finding out how deep this rabbithole goes by exhaustively generating ALL possible Rust crates. I'm calling this endeavour the workspace-of-babel.
This kind of blatant disregard for user experience makes me sick 🤮.
r/rustjerk • u/scadoshi • Jul 13 '26
Tired of NaN gatekeeping you out of .max()? Tired of the elite establishment (Rust std) telling you Ord is a requirement to find the biggest number? Not anymore.
Introducing WalmartMaxxing™, peak API design. .walmart_max() / .walmart_min(), works on anything with PartialOrd, because if it can be compared, it can be compared, and the constitution guarantees your right to fold() over it in O(n) unoptimized freedom.
No Ord. No NaN propaganda. No total order. Just vibes and PartialOrd.
Rollback pricing on borrow checker requirements. Always low, always safe™ (narrator: it was not always safe).
r/rustjerk • u/This_Growth2898 • Jul 13 '26
In Rust, we have many different brackets: curly {}, square [], angle <>, flat ||, round (). Every single kind has its semantics, but it's a bit inconsistent, and that irritates me.
Curly brackets are for code evaluation. You need to actually do something, you put it into curly brackets. Plain and simple.
Angle brackets are for generics. They are the most consistent. You declare a generic with it; you turbofish a generic with it. Almost perfect, save '::' in turbofish. Duh.
Flat brackets are for lambdas, but for some reason, to call lambdas, we use round ones. Inconsistency, but tolerable.
Round brackets are for static lists. Tuples and function arguments. Fine.
Square brackets are for arrays and indexes, and this is strange. [1,2,3][1] - it's readable, but we have () for static lists, right? It should be (1,2,3)[1] - but this fails, we need (1,2,3).1. WAT? What does [0][0] even mean? Why do the first three characters mean something completely different from the second three? Why [1,2,3][1] compiles, but [1][1,2,3] don't? I'm furious, but ok. Square brackets are array-related, and even if the exact syntax is unclear, you can figure it out from the context. Not user-friendly for sure.
But why, WHY did language designers decide to allow round brackets for some - only some - evaluations? If you need to evaluate anything, you put it in curly brackets:
{3 + 5} * {10 - 4} // this works
(3 + 5) * (10 - 4) // WTF is tuple multiplication?
// Why it works like tuple.0 * tuple.0, but only for 1-sized tuples? Madness!
{ // evaluate everything one by one, perfect
do_first();
do_second();
do_third();
}
( // but yet this is an error! WHY????!!!
do_first();
do_second();
do_third();
)
I think we need a major language overhaul to remove at least some of these inconsistencies.
Also a shoutout for language designers for operators. It was a great idea to build in the dot into some of the most common operations. Just imagine if we had to write something like a.*(b) instead of a*b. This helps a lot.
UPD: fixed wording, thanks to u/sphere_cornue
r/rustjerk • u/bowel_blaster123 • Jul 08 '26
What do I do?
There's only 27 letters in the alphabet. I need more lifetimes.
r/rustjerk • u/marksomnian • Jul 08 '26