DelphiDelphiVCLPythonPython GUIWindows

Everything You Need To Know About C++ ABI Inside DelphiVCL4Python

Everything You Need To Know About C++ ABI Inside DelphiVCL

C++ ABIs or more specifically:  DelphiVCL.Application.CPP_ABI_1, DelphiVCL.Application.CPP_ABI_2, and DelphiVCL.Application.CPP_ABI_3 inside DelphiVCL.Application is C++ ABIs (Application Binary Interfaces, which are implemented under the hood, including how parameters are passed, such as in a register or on the stack).

In windows development software but also especially for Linux, an application binary interface (ABI) is an interface between two binary program modules. Often, one of these modules is a library or operating system facility, and the other is a program that is being run by a user.

ABI defines how data structures or computational routines are accessed in machine code, which is a low-level, hardware-dependent format. In contrast, an API defines this access in source code, which is a relatively high-level, hardware-independent, often human-readable format. A common aspect of an ABI is the calling convention, which determines how data is provided as input to or read as output from computational routines. For example, the x86 calling conventions.

Adhering to an ABI (which may or may not be officially standardized) is usually the job of a compiler, operating system, or library author. However, an application programmer may have to deal with an ABI directly when writing a program in a mix of programming languages, or even compiling a program written in the same language with different compilers.

What do ABIs cover?

ABIs cover details such as:

  • A processor instruction set (with details like register file structure, stack organization, memory access types, …)
  • The sizes, layouts, and alignments of basic data types that the processor can directly access
  • The calling convention, which controls how the arguments of functions are passed, and return values retrieved. For example, it controls:
    • whether all parameters are passed on the stack, or some are passed in registers;
    • which registers are used for which function parameters;
    • and whether the first function parameter passed on the stack is pushed first or last.
  • How an application should make system calls to the operating system, and if the ABI specifies direct system calls rather than procedure calls to system call stubs, the system call numbers.
  • And in the case of a complete operating system ABI, the binary format of object files, program libraries, and so on.

ABI vs API

An API (Application Programming Interface, meaning the method declaration that you as a developer read and code against, including semantics such as passing by value) and ABI (application binary interface, meaning the way this is implemented under the hood, including how parameters are passed, such as in a register or on the stack). Read more here.

Is there a visual representation of ABIs?

Everything You Need To Know About C++ ABI Inside DelphiVCL ABI vs API
Image Source stackoverflowcom computerlanguagecom
Everything You Need To Know About C++ ABI Inside DelphiVCL Diagram of the Linux kernel interface
Image Source Wikipedia by ScotXW

Let’s browse all the properties and methods of the DelphiVCL.Application.CPP_ABI_1, CPP_ABI_2, and CPP_ABI_3 using dir() command:

See the responses in our Windows command prompt:

Everything You Need To Know About C++ ABI Inside DelphiVCL Response 1
Everything You Need To Know About C++ ABI Inside DelphiVCL Response 2
Everything You Need To Know About C++ ABI Inside DelphiVCL Response 3

You can also read short information about the DelphiVCL.Application.CPP_ABI_1, CPP_ABI_2, and CPP_ABI_3 using the print() command:

See the responses in our Windows command prompt:

Everything You Need To Know About C++ ABI Inside DelphiVCL Command prompt results 1
Everything You Need To Know About C++ ABI Inside DelphiVCL Command prompt results 2
Everything You Need To Know About C++ ABI Inside DelphiVCL Command prompt results 3

 

Check out DelphiVCL which easily allows you to build GUIs for Windows using Python.

Related posts
CodeIDELearn PythonPythonPython GUITkinter

How To Make More Than 20 ChatGPT Prompts Work With Python GUI Builders And OpenCV Library?

CodeIDEProjectsPythonWindows

Unlock the Power of Python for Deep Learning with Radial Basis Function Networks (RBFNs)

CodeIDELearn PythonPythonPython GUITkinter

How To Make More Than 20 ChatGPT Prompts Work With Python GUI Builders And NumPy Library?

CodeIDEProjectsPythonWindows

Unlock the Power of Python for Deep Learning with Generative Adversarial Networks (GANs) - The Engine behind DALL-E

Leave a Reply

Your email address will not be published. Required fields are marked *