[Info-vax] Viable versus ideal programming languages
Dan Cross
cross at spitfire.i.gajendra.net
Fri Mar 25 10:52:56 EDT 2022
In article <623dd2b3$0$700$14726298 at news.sunsite.dk>,
Arne Vajhøj <arne at vajhoej.dk> wrote:
>On 3/25/2022 9:51 AM, Dan Cross wrote:
>> In article <623dc61c$0$702$14726298 at news.sunsite.dk>,
>> Arne Vajhøj <arne at vajhoej.dk> wrote:
>>> On 3/25/2022 9:16 AM, Dan Cross wrote:
>>> [snip]
>>>> Of course, all of this works because the name mangling algorithm
>>>> is well-specified.
>>>
>>> If I read that code correctly then it works because the
>>> std::arch::asm ... mangled = sym mangled knows what to do.
>>>
>>> Which is not general language interop.
>>
>> It "knows what to do" because the name mangling algorithm is
>> well-specified by a generic ABI, which is the point:
>>
>> https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling
>>
>> Rust provides a convenient mechanism to make this trivial.
>
>Most mangling schemes are documented.
Yup.
>But they are not easily human readable,
That's true, though over time you do sort of pick it
up; kinda like Morse code or something.
>not compatible with
>each other and tend to not be stable over time.
That is NOT true. There's pretty much one that every has
standardized on now, and it is well-specified. It "changes over
time" in the same way that any ABI changes over time: new things
are added as languages etc evolve, but the baseline behavior is
durable.
>Which is why disabling it is a good thing for language
>interop.
We're now at the point of arguing semantics. I gave an example
where one does not _need_ to disable it; that's all. Strictly
speaking, it is not necessary to disable mangling for interop;
whether one wants to for other reasons (readability) or
considers it a good idea in general is orthogonal.
- Dan C.
More information about the Info-vax
mailing list