News for hackers. Stuff that matters.
Re:Rust in QEMU Roadmap by quotemstr on Tuesday December 03, 2024 @05:07PM (#42312111)
Lisp is a non sequitur. C++ can do the same "weird things" C can. There is literally no advantage whatsoever of choosing to wear the C hairshirt instead of using C++. Not a single one.

Sure, Rust is better than C++ in some ways. You can have a legitimate debate about C++ versus Rust. There can be no debate about C versus C++: the latter is better in every single way.

> unnecessary excess of C++.

Is the unnecessary excess of C++ in the room with us right now?

Again, you don't have to use any part of C++ you don't like. A few minor spelling differences aside, it remains a superset of C. Using C++ not C will not hurt you in any project whatsoever.

Re:Rust in QEMU Roadmap by crabbone on Wednesday December 04, 2024 @09:13AM (#42317564)
I don't know... I basically already answered your question: C++ has way too many things to remove. People working on projects like QEMU don't want exceptions, smart pointers, classes, virtual methods, templates, lambas etc. So, it's more effort to remove all of that / make sure your code doesn't accidentally use any of that.

C is simpler because you don't need to remove any of that stuff, because it's not there to begin with.

My argument about Lisp doesn't say that anyone should use Lisp instead, it just points out that people making the choice between C and C++ aren't concerned by how easy it is to build new languages using the language building tools of C or C++ because both are very bad at it. Had the objective of building a new language been the primary objective of such projects, they'd be using a language with superior language building tools (not necessarily Lisp, there are many alternatives, it's just that neither C nor C++ are good at it).

Re:Rust in QEMU Roadmap by bonzini on Thursday December 05, 2024 @09:50AM (#42328718)
Well, smart pointers and (sort of) templates and lambdas are in Rust. I definitely want smart pointers.
Re:Rust in QEMU Roadmap by crabbone on Thursday December 05, 2024 @10:41AM (#42329220)
Not when you need your own allocator. Anything that tries to manage memory w/o you knowing about it will be working against you.
Re:Rust in QEMU Roadmap by bonzini on Thursday December 05, 2024 @04:53PM (#42333231)
Smart pointers are not really about managing memory, they're about managing lifetimes. Even things like the Rust RefCell are smart pointers.
Re:Rust in QEMU Roadmap by crabbone on Friday December 06, 2024 @05:44AM (#42338472)
Rust lifetimes is a mechanism to manage memory.