What could C/C++ “lose” if they defined a standard ABI?

后端 未结 8 1923
清酒与你
清酒与你 2020-12-01 07:41

The title says everything. I am talking about C/C++ specifically, because both consider this as \"implementation issue\". I think, defining a standard interface can ease bui

8条回答
  •  一整个雨季
    2020-12-01 08:27

    The C (or C++) language specifications define the source language. They don't care about the processor running it (A C program could even be interpreted by a human slave, but that would be unethical and not cost-effective).

    The ABI is by definition something about the target system. It is related to the processor and the system (and the existing libraries following the ABI).

    In the past, it did happen that some processors had proprietary (i.e. undisclosed) specification (even their machine instruction set was not public), and they had a non-public ABI which was followed by a compiler (respecting more or less the language standard).

    Defining a programming language don't require the same skill sets as defining the ABI.

    You could even define a newer ABI for an existing processor, but that requires a lot of work (patching the compiler, recompiling every thing, including C & C++ standard libraries and all utilities and libraries that you need) so is generally useless.

提交回复
热议问题