I'm experimenting with #Rust again, and my eyes always bleed with the "lifetime annotation syntax" - why does it have to use an apostrophe 😩 .

&'a mut i32

fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {

impl<'a> System<'a> for LeftWalker {
type SystemData = (ReadStorage<'a, LeftMover>,
WriteStorage<'a, Position>);

But this time I'll try not to rage quit in digust again. I'll stick until this experiment ends. #rustlang

Another one:
- Generics in every language: Vector<MyType>()

- Rust:

Nope:
Vec<u32>::new();

This works:
Vec::<u32>::new();

And this ALSO works:
(Vec <u32)>::new();

So I can't use the universal language of: Vec<u32>::new();

But I can do (Vec <u32)>::new();

#Rust #rustlang

What kind of syntax is that? For the past 28yrs I used more than 12+ langs in every kind of project & the ugliest language I've seen is Rust.

Yes, EVEN UGLIER THAN ERLANG, at least Erlang is consistent and makes sense.

@alfredbaudisch Are you sure on `(Vec <u32)>::new();` this doesn't compile for me 🤔

@alfredbaudisch That's a bug in your LSP, see how it thinks it's a bool? It's interpreting the < and > as comparisons.

If you actually compile it then you get the errors you should be https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=b83316313aed20276a5fd9a8b5f7a8c8

Rust Playground

A browser interface to the Rust compiler to experiment with the language

@salsagal found the full code, it compiles, but yeah as a bool: https://play.rust-lang.org/?version=stable&mode=debug&edition=2015&gist=6953e52ea50aaea2e25468796e3c9511

But that's the point of my rant (ugly ass syntax):
- Every language that has generics, at least C-based languages follow Vec<type>()

Rust when faced with `<` thinks it's a comparison operator, so you need: `Vec::<type>`

Rust Playground

A browser interface to the Rust compiler to experiment with the language

rust/tests/ui/parser/bastion-of-the-turbofish.rs at master · rust-lang/rust

Empowering everyone to build reliable and efficient software. - rust-lang/rust

GitHub