C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Common ABI specification

From: Jonathan Wakely <cxx_at_[hidden]>
Date: Fri, 27 Jan 2023 20:06:07 +0000
On Fri, 27 Jan 2023, 19:24 samuel ammonius via Std-Proposals, <
std-proposals_at_[hidden]> wrote:

> Hello,
>
> I have a proposal that I hope could make C++ possible
> to mix with different compilers and programming languages
> without having to use *extern "C"*. It specifies things like
> name mangling and how "this" is passed to methods, since
> these things usually get in the way of mixing languages and
> compilers with C++. It doesn't (shouldn't) interfere with any
> other language features. I've written a small draft in plaintext
> that's attached to this email. Thanks.
>


Sorry, but this is never going to work. Your mangling scheme is fatally
flawed (why not choose one of the existing scheme that actually works?)

> In this case, "radius" will have the symbol "geometry_circle_radius"

So how would you mangle a global variable called "geometry_circle_radius"?
You can't use valid identifiers as mangled names.

I'm sorry, but this proposal fails to address nearly every important aspect
of name mangling. Even if we could specify a standardized mangling scheme,
it wouldn't look like this.

And doing that would not be a pure extension with no impact on the current
language, because it would require incompatible changes from at least one
existing, widely-used compiler.

Received on 2023-01-27 20:06:23