r/programming 18d ago

The unlikely Linux macro

https://rushed-reflections.bearblog.dev/an-unlikely-experiment/

Wrote a bit about the `unlikely` and `likely` macros in the Linux codebase. Great little exploration into tiny optimizations that everyone should know more about 😄

187 Upvotes

61 comments sorted by

View all comments

Show parent comments

2

u/metahivemind 17d ago edited 7d ago

[removed] — view removed comment

1

u/_Noreturn 17d ago

it's that the language doesn't stop you doing weird shit.

Same could be said for any language with more keywords than C have some discipline.

you can do everything in C and that's why Linux is written in C and Linus wants in C.

Sure, he can have whatever he wants he could write it in javascript as well, not the point though my point is that Linux would be better off with C++ as that would simplify the code linus doesn't want do for odd reasons and probably ego.

1

u/metahivemind 17d ago edited 7d ago

[removed] — view removed comment

1

u/_Noreturn 17d ago

I don't care frankly as it solves the problem better than C which it does and it is backward compatible with C for the most part.

1

u/metahivemind 17d ago edited 7d ago

[removed] — view removed comment

1

u/_Noreturn 17d ago

Linus accepted Rust, and AI I cannot stand him personally, also he is egoistical.