Where does the “main” function in programing languages came from?

By Xah Lee. Date: .

Where does the “main” function in programing languages came from?

This article explores where does the main concept came from, and why is it needed.

Programing language like C, C++, Java, etc has the concept of a main function, where it is the starting point of program execution.

prog lang main 2023-11-08 073716 6TwK
prog lang main 2023-11-08 073716 6TwK

Languages Without Main

Scripting languages sans main:

Compiled languages sans main

Preliminary Explanation

Here's some preliminary explanation on history of the main concept or why it is there.

prog lang main 2023-11-08 FTPX
prog lang main 2023-11-08 FTPX
prog lang main 2023-11-08 m5kf
prog lang main 2023-11-08. https://cs.stackexchange.com/questions/160004/why-do-we-use-main-function-in-almost-all-the-programming-languages
prog lang main 2023-11-08 Jqc7
prog lang main 2023-11-08 Jqc7 Entry point

Where did C lang's main came from?

Here's a sketch of history of where did C get its main.

Is main good idea?

The real reason main is invented

prog lang main 2023-11-08 QRYB
prog lang main 2023-11-08 QRYB Linker (computing)

Programing Language Design