[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


It's like they invent new syntax every time they define a function
>>
wtf is this shit???
>>
>>107074850
>heres your new systems programming language bro
>>
>>107075062
>>heres your new systems programming language bro

*pulls trigger
>>
>>107074850
This looks like an ergonomic nightmare to write.
>>
>>107074850
for what purpose add too much sugar syntax if it makes code unreadable?
>>
>>107074850
>stream::channel(50, move |mut output| async move
wtf
(also shouldn't a stream be in a channel not the other way around)
>>
>>107074850
This is the ugliest language I've ever seen
>>
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);
>>
>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
>>
>>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)
>>
>>107074850
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.
>>
>>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
>>
>>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.
>>
>>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?
>>
>>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
>>
>>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.
>>
>>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.
>>
>>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...
>>
>>107075633
>1. If you can't understand this you are retarded
this
>>
Rust... my love... so beautiful. So perfect.
>>107076046
tsmt
>>
>>107075226
>sugar syntax
This phrase is so fucking gay. I imagine it was coined by a lisping homosexual
>>
>>107079555
trips of truth
>>
File: apu_squint.png (14 KB, 656x527)
14 KB
14 KB PNG
>>107074850
>>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?
>>
>>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?
>>
>>107075230
Stream is a module/namespace, not an object.
>>
File: rust.png (112 KB, 1293x376)
112 KB
112 KB PNG
>>107075335
nothing beats expressions, especially with type hints, and more especially with nvim-lsp-endhints (picrel).
if that filters you, that's on you.
>>
>>107079892 (Me)
obligatory this is not real code, just a showcase.
>>
>>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.
>>
File: file.png (3.63 MB, 2048x1152)
3.63 MB
3.63 MB PNG
>>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.



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.