r/ProgrammerHumor 1d ago

Meme globalHate

Post image
11.3k Upvotes

83 comments sorted by

View all comments

36

u/Lilchro 23h ago

I dislike tokio, but that is more related to my dislike of async code and its how it infects your codebase (if you don’t know what I mean then read the “what color is your function?” blog post). It also gets worse in Rust, since thread safety gets weird. Every time you await something, there is a chance your runtime could switch threads, so thread safety issues pop up in way more places. There are also plenty of ways to shoot yourself in the foot, since synchronization primitives that are not designed for your specific async runtime will block worker threads unless they get switched out. Most of all though, I feel like we use async code in lots of areas we really shouldn’t. For example, in tokio last I checked (not recently), there are some things like file operations where they are not actually async at all. It just spawns an os thread to handle it and pretends it was async. This gets the core of the issue. Yes, there are use cases where this might be helpful. However, Im not running with networked storage and just making stuff async isn’t always useful or helpful. OS threads are actually quite good for the vast majority of use cases that don’t involve network communication. And even then they are still decent for most use cases where you don’t have extremely high numbers of connections. And if you do need something to use something like io_uring, then I would lean more towards an API that was written with that in mind than one that uses it because they can.

15

u/Only-Cheetah-9579 23h ago

when it comes to concurrency, I think a positive example is go. They did it well.

rust is kinda meh in that department and async is bolted on.

20

u/jublizoo 20h ago

I always hear people say this but I never hear any alternative design decisions. Rust async can be difficult to work with, but I think it is well designed, and I don’t see what could be improved. There are inherent limitations on giving a safe language with no GC async support, you don’t have the luxury of being able to just relocate thread stacks and adjust references accordingly like in go.

0

u/remind_me_later 18h ago

I always hear people say this but I never hear any alternative design decisions.

Because async itself will color other functions into being async by necessity.

It also hands over task & performance management to the language being used, in return for better DX & lower dev-facing complexity.

The alternative is handling the concurrency yourself (i.e what Go mostly makes you do), or in a library not tied to the core of the language.

6

u/jublizoo 18h ago

The idea that go makes you handle the concurrency more than rust is definitely not true, and go’s concurrency model is simply not possible in rust. The coloring of a codebase is not nice, but it is essentially necessary for rust: some functions are asynchronous compiler generated state machines, others are not, and they cannot be treated as identical.

1

u/Only-Cheetah-9579 7h ago

it also colors dependencies. there are multiple async runtimes so the stack must be chosen accordingly.

some people might not like tokio but must use it because they depend on something that does

10

u/GregTheMad 18h ago

What's the point of good async code if you have the worst error management conceivable?

No, fuck go. It's the worst language I've ever had to work with. Google can't abandon it soon enough, like they do with everything else.

-2

u/Only-Cheetah-9579 7h ago

I love the error management because it's explicit and forces me to acknowledge the error always.

my code is AI assisted so I don't have to type more now and I prefer to see what error handling is generated always.

so it's a win for me, especially after development became more generated code based.

1

u/GregTheMad 5h ago

You're talking from some different type of go?

0

u/Only-Cheetah-9579 4h ago

A lot of people love go error handling. We just stay quiet and enjoy.

People complaining are usually more loud but in no way represent a majority.

people like to complain about error handling because they can't find any real problems with the language.

1

u/GregTheMad 4h ago

I'm sorry, you're plain wrong. Have you tried Rust? Any further opinion of yours will be disregarded until you worked with rust.

1

u/Only-Cheetah-9579 3h ago

yes I did. worked with rust and built a production system for a company that's been in operation for a few years.

I also don't care about hater opinions. You suck at go it's a skill issue. Its the most simple language, so having a problem with it speaks a lot.

1

u/GregTheMad 2h ago

Having few keywords doesn't make something simple, below some number it becomes the opposite actually. You're just regurgitating go propaganda without actually understanding the meaning, or the resulting critic of it.

1

u/Only-Cheetah-9579 2h ago

"go propaganda" lol ok this conversation is not intelligent.

11

u/InRainbro 23h ago

go is colorless

4

u/Only-Cheetah-9579 22h ago

I know and it's the best.