Settings

Theme

Rewriting Kafka in Rust

wangjunfei.com

30 points by chuckhend 6 months ago · 6 comments

Reader

zamalek 6 months ago

> 1. Avoid Turning Functions into async Whenever Possible

> Consider the following example:

Has the author benchmarked this? They are essentially replicating what the compiler does already: the compiler doesn't put each statement/expression into its own state, states occur on the boundaries of awaits.

  • saghm 6 months ago

    I wouldn't even feel confident in assuming that the compiler wouldn't inline the function they've defined, a one-liner that's only called from a single location. It wouldn't surprise me at all if the compiler produced exactly the same code for the two examples.

  • surajrmal 6 months ago

    I think he's trying to suggest not making a few function without any await statements async. He doesn't suggest implementing your own futures manually.

dkersten 6 months ago

> it has become evident that C/C++ is gradually becoming a sunset language, nearing its twilight. Its successor, Rust

C and C++ will outlast us all and there are many other languages vying to be the successor, not just Rust.

remram 6 months ago

I have never seen a site stretching words like this. Increasing the spacing between words is already going away (thankfully), but increasing the spacing between characters... why?

https://imgur.com/a/smQo87s

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection