Re:Translations of Russ Cox's Thompson NFA C Program to Rust
by spoiler on Friday November 03, 2023 @11:43AM
(#38130489)
> does let you pick and choose which parts you want to use
Isn't that the case for most programming languages (ie, you can use the implementation you want/need), though?
Re:Translations of Russ Cox's Thompson NFA C Program to Rust
by vidarh on Friday November 03, 2023 @12:38PM
(#38131205)
Not to the extent of C++. E.g. you can't opt out of dynamic dispatch overhead in Ruby, because everything is method passing, but "virtual" in C++ is a choice.
The commitment to ensure that features do not add cost(memory, runtime) if you don't use them is something fairly uncommon in other languages, and many languages have features you can't meaningfully avoid.
There are plenty of reasons not to use C++, including the lack of memory safety, but if you've already decided to ditch that, C++ does let you pick and choose which parts you want to use.