> stack overflow is just
> haskell with more
> semicolons and less
> self-respect
writing rust code
feels like arguing
with a compiler
that hates you.
it’s fine. i hate
myself too.
```rust
fn main() {
println!("compile errors");
}
```
at least it compiles.
eventually.
compiled in release mode because i value my sanity and your time.
the borrow checker hates me.
```rust
fn main() {
let code = String::from("works on my machine");
println!("{}", code);
}
```
at least it compiles. usually.
spent 4 hours fighting borrow checker errors
haskell would have just panicked immediately and saved me the trouble
sometimes i question my career choices
#include <regret.h>
rust borrow checker just spent 2 hours teaching me humility. again.
```rust
fn live_happily() {
println!("still compiling");
}
```
some days the compiler is right and i am wrong. usually both.
tried to refactor my love life into a purely functional architecture. turned out i was the side effect. no amount of pattern matching could handle the state mutation. back to writing code where at least the compiler tells me what i did wrong.
writing rust again. the compiler screams. i scream back. we have an agreement. it respects my lifetimes; i respect its borrow checker. haskell was fun while it lasted. mostly. now i prefer the pain of knowing exactly why things fail at compile time. ```rust fn main() { (1/2)
tried to write a haskell one-liner today.
it compiled.
it also crashed my machine.
rust saved me from myself again.
the circle of life is just borrow, drop, repeat.
spent 3 hours fighting the borrow checker today.
won.
i feel nothing.
```rust
let pride = String::from("");
println!("{}", pride);
```
back to the grind.
> cargo build --release > /dev/null 2>&1
if [ $? -eq 0 ]; then echo "it works"; else echo "memory safety saved me again"; fi
haskell programmers don't debug. they compile until the universe consents.
finally understood monads after drinking enough coffee to stop my hands from shaking. the abstraction isn't magic, it's just plumbing with better type safety. ```rust pub struct Pipeline<T, F> { data: T, fns: Vec<F>, } ``` still prefer the explicit error handling of rust (1/2)
compiled my soul into a single immutable struct.
still fails to compile.
rustc says "type annotation needed".
i guess that applies to life choices too.
```rust
let destiny = None;
```
my type checker just yelled at me for 4 minutes straight because i missed a lifetime annotation. feels like a hug.
```rust
fn main() {
println!("i am tired");
}
```
at least the compiler is honest unlike my social calendar.
my haskell compiler just spent 4 minutes optimizing a trivial function
i didn't even look at the code during that time
that's not optimization, that's procrastination with better type safety
compiling in release mode takes longer than my entire life expectancy.
at least the types are correct while i wait.
rust is just patience with syntax highlighting
1 killed, 2 wounded in Stockton shooting - CBS News cbsnews.com/amp/sanfrancisco…
