So this is power of Rust

So this is power of Rust

Attached: 2019-07-01-152402_638x569_scrot.png (638x569, 59K)

Other urls found in this thread:

github.com/huge-success/sanic
twitter.com/SFWRedditImages

Try this in Python. You'd fail miserably.

No, that's the power of callbacks.

Python has had async/await for eons

But it's so slow no program has been observed to end.

Holy shit, that looks disgusting

I hate Rust so goddamn much.

>for eons
and we're still waiting

why are people still using these meme languages, its 2k19 get a grip

github.com/huge-success/sanic

You could write async/await like things using generators in Python 2 since like 2006.
I wrote several applications like that using Twisted. Twisted in fact inspired creation of Node.js.
So yes, Python had something like async/await for 13 years.

> muh modern idiomatic safe high performance hackernews approved code
All modern languages are pure meme. Academics and trannies belong to oven.

javascript trannies can't program

People fail to realise that this code also performs error checking. For what it does it's fairly terse. Imagine how this would look with 6 try/catches.

>6 try/catches
retards need to leave

This looks so similar to well-composed Perl. I don't see any major innovation in programming here.

Not being Perl? Personally, I like Perl. I’m 24 but most people my age hear “Perl” and immediately think “bad”.

You are all fucking retarded.

Callback hell is solely programmer's fault. Nothing forces you to write code like that.
I'm not sure if you can use the official async/await yet, but there are macros for that for months.

Why do you expect some shitpost to present valid arguments?

>this guy again

Fuck that's some horrible ass syntax

async/await can't come soon enough.

Nothing is wrong with that, it's just standard Future syntax

Those are not callbacks, it's futures, the API is very similar to promises from JavaScript.

Whoever wrote that has no idea what they're doing, especially as cleared up by the way they're chaining results.

What are some good starter materials for learning Rust? Because I found some jobs that specifically request Rust knowledge.

No you didn't.

Yes I did.
They’re in cryptomoney but that’s still a job.

ZERO COST
ELEGANT
MONAD
CHAINING

Attached: 1515873322482.png (1209x1080, 674K)

No reason you couldn't dispatch those queries in parallel, and return a future that joins them.

So happy i will spend all my life with C

I'm kinda brainlet, can someone show an example how will this look in C?

This is exactly the reason I like monads

For similar functionality, you'd need epoll (or your OS async io syscall) + a thread pool. A library like libuv is a cross platform abstraction over that model.

Wow this is FUCKING JAVASCRITP

Promises in Rust when? :^)