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.

DREAM:
- Systems programming language w/ the safety of Rust
- a package manager
- the ecosystem/community size of Rust
- C/C++ tooling (debugger and LS)
- C/C++ interop
- ALL OF THAT with a Ruby-like syntax

The answer could be Crystal, but unfortunately it has a tiny tiny ecosystem and Windows is a 2nd class citizen and Crystal has probably the slowest compiler on Earth.

Nim is probably the answer (it's Pascal-like), but Nim loses on tooling.

Other suggestions?

#Nim #NimLang #Rust #RustLang

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

Not everything is ugly with the #RustLang syntax! I just stumbled upon two pieces of #Rust code that I found to be elegant.

I just love pattern matching.

@alfredbaudisch is that elegant in Rust?

@adolfoneto I don't know in terms of what is accepted in the Rust world in general since I'm still not that much involved with it.

But as compared to the rest of the syntax which can be really ugly, alien and esoteric, I personally found those 2 segments to be elegant.

@alfredbaudisch you can do this in a single match, without nesting, too!
@alfredbaudisch I did like elixirs pattern matching a bit more, though. But that model is probably only possible b/c of elixirs more dynamic-ish type system.

@berkes Elixir is the queen of pattern matching, but it's not because it's dynamic, it's because it's a functional immutable language. In Elixir you rarely (or never) use if's, loops and the like, instead, you rely on pattern matching functions and cases, everything is pure.

I'm working w/ Elixir right now & in the screenshot is a function I was looking at, it's all the same function, but with different matches.

(also I work with Elixir full time since 2015, so also I might be biased too)

@alfredbaudisch still Rust looks strange for game development in terms of readability
@tricky_fat_cat that's what always drive me off, but this time I'm moving forward with the experiment.
@alfredbaudisch well, I'm still Rust curious, but last several controversies around it turned me off a little bit. In addition, I still want to try out Godot again, but don't have time to focus on it.

@alfredbaudisch

In my opinion, for the first piece, this is slightly better.

https://paste.rs/VeHxw.rs

paste.rs - Rocket Powered Pastebin - Code

paste.rs is a simple, no-frills, command-line driven pastebin service powered by the Rocket web framework.

@alfredbaudisch agreed! If there is one thing I would take from rust anytime, it's the `match` feature