Rust from a Gopher – Lessons 3 and 4
levpaul.com
Rust from a Gopher – Lessons 3 and 4
1–10 of 27 posts
Re: Rust from a Gopher – Lessons 3 and 4
#2> The book really led me to believe there are literally two types of strings in Rust
Oh you sweet summer child :) The joys of discovering that on lower levels, a String is not a str is an OsStr but is not a str and why that is are coming back to me.
Also, I particularly like the periodic table of rust types:
https://cosmic.mearie.org/2014/01/periodic-table-of-rust-typ...
This compared to almost any other language should tell you that Rust trades compilation speed for strictness and execution speed. It's really helpful to understand what you need to care about if you don't have a garbage collector working for you.
Re: Rust from a Gopher – Lessons 3 and 4
#3Re: Rust from a Gopher – Lessons 3 and 4
#4Re: Rust from a Gopher – Lessons 3 and 4
#5Yeah, because that knife is made of uranium.
Anyone not handling that uranium as they should, should be shunned, isolated and enclosed in a lead vault.
Re: Rust from a Gopher – Lessons 3 and 4
#6Oh, odd, it's my dark mode addon.
Re: Rust from a Gopher – Lessons 3 and 4
#7> I see a very sharp knife; but this knife is completely and utterly shrouded and encased in tamper-proof, child-proof, thief-proof hardened and sealed plastic shells. Yeah, because that knife is made of uranium. Anyone not handling that uranium as they should, should be shunned, isolated and enclosed in a lead vault.
Ah, so that's what happened to the Actix developer. What a welcoming community!
Re: Rust from a Gopher – Lessons 3 and 4
#8I quite liked the tongue-in-cheek style. > The book really led me to believe there are literally two types of strings in Rust Oh you sweet summer child :) The joys of discovering that on lower levels, a String is not a str is an OsStr but is not a str and why that is are coming back to me. Also, I particularly like the periodic table of rust types: https://cosmic.mearie.org/2014/01/periodic-table-of-rust-typ... This…
So many options in the standard library alone. There are several popular crates which add even more string/buffer types.
Re: Rust from a Gopher – Lessons 3 and 4
#9 error[E0384]: cannot assign twice to immutable variable `x`
--> src/main.rs:4:5
|
3 | let x = 3;
| -
| |
| first assignment to `x`
| help: make this binding mutable: `mut x`
4 | x = 5;
| ^^^^^ cannot assign twice to immutable variable
error: aborting due to previous error; 2 warnings emitted
For more information about this error, try `rustc --explain E0384`.Re: Rust from a Gopher – Lessons 3 and 4
#10> I see a very sharp knife; but this knife is completely and utterly shrouded and encased in tamper-proof, child-proof, thief-proof hardened and sealed plastic shells. Yeah, because that knife is made of uranium. Anyone not handling that uranium as they should, should be shunned, isolated and enclosed in a lead vault.
>should be shunned, isolated and enclosed in a lead vault. Ah, so that's what happened to the Actix developer. What a welcoming community!
My daily grind is Java. And I've seen enough idiots opening the plastic and licking the glow-in-the-dark knife in Java. It always leads to fun and interesting problems.
By fun I mean "Get me out of this hell" and by interesting I mean "I obviously need more drugs to understand this code".
> Ah, so that's what happened to the Actix developer. What a welcoming community!
No. He realized his mistake and isolated himself.
Here is the approximate recollection of events regarding his work on Actix:
-------
Have a safe function that does the same thing as your garbled mess of unholy unsafe abomination.
Use unsafe.
Gotta go fast!
-------
People submit PR to fix your unsafe hell spawns.
Reject!
Gotta go fast.
-------
People call you out on it.
Delete all the code.
No code = fast.
-------
In the end, he had a change of heart set new maintainers and restored the project. Then went off to write code to benchmark in C.
All's well that ends well.