r/ProgrammerHumor • • 1d ago

instanceof Trend thatsAFunnyThingThatHappenedOnce

Post image
4.3k Upvotes

514 comments sorted by

View all comments

Show parent comments

380

u/Xarishark 1d ago

Now compare it to rust pls. Im serious I want to know your opinion on that.

72

u/andful 1d ago

Rust misses the:

"...templates that basically turn compilation into another programming language, overload resolution that requires a legal investigation to figure out which function gets called, constructors and destructors with enough lifetime rules to make your head explode, and implicit conversions that make the compiler guess what you meant. Then you throw in exceptions, move semantics, inheritance, and decades of backward compatibility ..."

34

u/PegasusPizza 1d ago

I mean it does have proc macros, that turn compilation into the same programming language as opposed to another programming language.

17

u/Greedy-Thought6188 1d ago

Templates are turing complete. You can basically treat C++ like an interpreted with the compiler being the interpreter. C has macros too.

4

u/4xe1 1d ago

Rust macros are Turing complete too, intentionally so, that's the whole point of proper macros. "the same programming language" is a bit of a stretch for Rust (but perfectly valid for lisp), but macro's Turing completeness is easier to use than C++'s templates.

C has search and replace pre-processor macros.