Re:How I Wrote a Modern C++ Library in Rust
by flukus on Tuesday December 04, 2018 @09:14PM
(#18605226)
> The point is the C lowest common denominator is a bit low. I'd like something that by dropping C we can be a little higher.
I don't think it really raise the bar much. Rust for example isn't an OO language so classes and v-tables won't be included. Go doesn't have templates so off they go. Operator overloading, multi inheritance, exceptions, garbage collection all go.
What your left with is essentially the C ABI. Being this lowest common denominator is why it's the the common ABI just as much as the success of the language.
I'm fine with the ABI having an explicate this pointer (which python already does for classes) which allows C to call/implement classes as well, but it needs to be in the ABI (languages with first class classes can choose to hide the this pointer and v-table).
Operator overloading (which forces name mangling or something like it) is tricky though. As is exceptions. I don't have answers to that.