← Home ← Back to /g/

Thread 107074850

30 posts 8 images /g/
Anonymous No.107074850 [Report] >>107075062 >>107075157 >>107075226 >>107075230 >>107075317 >>107075633 >>107079837
It's like they invent new syntax every time they define a function
Anonymous No.107074880 [Report] >>107079837
wtf is this shit???
Anonymous No.107075062 [Report] >>107075119
>>107074850 (OP)
>heres your new systems programming language bro
Anonymous No.107075119 [Report]
>>107075062
>>heres your new systems programming language bro

*pulls trigger
Anonymous No.107075157 [Report]
>>107074850 (OP)
This looks like an ergonomic nightmare to write.
Anonymous No.107075226 [Report] >>107079597
>>107074850 (OP)
for what purpose add too much sugar syntax if it makes code unreadable?
Anonymous No.107075230 [Report] >>107079858
>>107074850 (OP)
>stream::channel(50, move |mut output| async move
wtf
(also shouldn't a stream be in a channel not the other way around)
Anonymous No.107075317 [Report]
>>107074850 (OP)
This is the ugliest language I've ever seen
Anonymous No.107075335 [Report] >>107076046 >>107079892
Why the fuck does rust encourage the programmer to overuse the expression BS. It's not even remotely useful and all it does it make you have to track what an entire block does instead of just looking at
code
...
function(meaningfulname);
Anonymous No.107075451 [Report] >>107075596
>le syntax is too complex!
i'm not a huge fan of the "rewrite it in rust" movement but this is actual normie cope. i don't even write rust and the only two things i didn't immediately understand in this snippet was `stream::channel(50, move |mut output| async move {` and `'static + Hash + Copy + Send + Sync + Debug`
if you actually write code in this language everything in this snippet is obvious
Anonymous No.107075596 [Report] >>107076866
>>107075451
except you literally have no idea what stream::channel takes because I guess the programmer didn't feel the need to name it even though he could have done
leeeeeet name = {block}
stream::channel(name)
Anonymous No.107075633 [Report] >>107076257 >>107077787
>>107074850 (OP)
1. If you can't understand this you are retarded
2. this code is also retarded, he could have just used a format or const format.
Anonymous No.107076046 [Report] >>107076906 >>107077754 >>107079555
>>107075335
everything Rust does is useful
literally the most rationally-designed language in its niche of systems programming
the only scuffed part of Rust is boxed async closures
Anonymous No.107076257 [Report] >>107077711
>>107075633
Nobody can understand it if they don't use Rust. I had to look up what 'static is, apparently it's a "lifetime" thing.
Anonymous No.107076866 [Report] >>107077533
>>107075596
maybe stop writing code in notepad++?
i just hover over a function in RustRover and immediately a window with documentation opens that shows what the types of each argument are
also autocomplete and inlay hints
also how is this the language's fault and not the programmer who wrote that library?
Anonymous No.107076906 [Report]
>>107076046
>everything Rust does is useful
well, it is keeping most of the trannies and their overhyped drama away from real programming languages so there's that
Anonymous No.107077533 [Report]
>>107076866
1) none of that tells you the name of the expression, only the programmer can
2) why waste an action and run a program for something that should be immediately visible if you knew how to properly write programs.
Anonymous No.107077711 [Report] >>107079925
>>107076257
'static tells the compiler that the reference will be valid for the whole life of the program, this makes sense as this is a function returning references to const string literals.

Anyway you don't need to understand lifetimes to understand what this code does.

If just that keyword breaks your understanding your are indeed retarded.

Still it's bad code but not hard code.
Anonymous No.107077754 [Report] >>107079848
>>107076046
>muhhhh you need all that syntactic complexity chud
You can replace lifetimes with capabilities (or regions) and remove the borrowing semantic by using linear types and implicit rebinding. But anyway, most the time the lifetimes can be inferred by the compiler Rust enforces the annotations because it's Rust.
>An idiot admires complexity...
Anonymous No.107077787 [Report]
>>107075633
>1. If you can't understand this you are retarded
this
Anonymous No.107079555 [Report] >>107079683
Rust... my love... so beautiful. So perfect.
>>107076046
tsmt
Anonymous No.107079597 [Report] >>107079983
>>107075226
>sugar syntax
This phrase is so fucking gay. I imagine it was coined by a lisping homosexual
Anonymous No.107079683 [Report]
>>107079555
trips of truth
Anonymous No.107079837 [Report]
>>107074850 (OP)
>>107074880
I don't get it. I don't use rust but the code snippet you posted seems entirely self-explanatory. Which part of it is confusing you?
Anonymous No.107079848 [Report]
>>107077754
>linear types
are you that schizo who goes into every programming language thread and says it's shit because it doesn't use linear types and/or doesn't use linear types enough?
Anonymous No.107079858 [Report]
>>107075230
Stream is a module/namespace, not an object.
Anonymous No.107079892 [Report] >>107079896
>>107075335
nothing beats expressions, especially with type hints, and more especially with nvim-lsp-endhints (picrel).
if that filters you, that's on you.
Anonymous No.107079896 [Report]
>>107079892 (Me)
obligatory this is not real code, just a showcase.
Anonymous No.107079925 [Report]
>>107077711
>'static tells the compiler that the reference will be valid for the whole life of the program
this is not what it means in bound position just to be clear, in case the other anon was referring to the other occurrence.
Anonymous No.107079983 [Report]
>>107079597
>lisping homosexual
There's no such thing as a "lisping" homosexual. LISP is a language for the white male, not for freaks.
Try to find a single tranny/faggot/negro in this photo from the European Lisp Symposium. Protip: you can't.