Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What was the origin of Variadic Functions?

Did Variadic functions originate from a specific language, from math, from an scientific article...? Any idea?

like image 201
The Student Avatar asked Oct 23 '22 19:10

The Student


1 Answers

There are many mathematical and logical operations that come across naturally as variadic functions. For instance, the summing of numbers or the concatenation of strings or other sequences are operations that can logically apply to any number of operands.

Even though the label variadic functions sounds modern, the concept of what it is may be as old as the wheel. Ok, maybe not that much, but its such a logical evolution that it was probably re-discovered multiple times along the way.

The Watcom compiler may have been the first to have implemented it for the C language:

Variadic functions fall back to the Watcom stack based calling convention.

The Watcom C/C++ compiler is a compiler for the computer programming languages C and C++ that produces executable programs for several platforms and operating systems. The code it produces for MS-DOS executes very fast. It was one of the first compilers to support the Intel 80386 "protected mode". In the mid-1990s some of the most technically ambitious DOS games such as Doom, Descent and Duke Nukem 3D were built using Watcom C. Though no longer sold commercially by Sybase, the Watcom C/C++ compiler and the Watcom Fortran compiler have been made available as the free and open source Open Watcom package with the assistance of SciTech Software

That said, I think this question is better suited to math.stackexchange.com.

like image 70
karlphillip Avatar answered Oct 27 '22 00:10

karlphillip