Get the latest tech news

Phrase origin: Why do we "call" functions?


On StackExchange, someone asks why programmers talk about “calling” a function. Several possible allusions spring to mind: Calling a function is like calling on a friend — we go, we stay a while, we come back. Calling a function is like calling for a servant — a summoning to perform a task. Calling a function is like making a phone call — we ask a question and get an answer from outside ourselves. The true answer seems to be the middle one — “calling” as in “calling up, summoning” — but indirectly, originating in the notion of “calling for” a subroutine out of a library of subroutines in the same way that we’d “call for” a book out of a closed-stack library of books.

[…] The bulk of the descriptive tape consists of a series of instructions, separated, by control words, into numbered groups called boxes[because flowcharts: today we’d say “basic blocks”]. Notice that Sarbacher defines “call in” as the runtime transfer of control itself; that’s different from how the Fortran II manual used the term. Maybe Sarbacher was accurately reflecting an actual shift in colloquial meaning that had already taken place between 1958 and 1959 — but personally I think he might simply have goofed it.

Get the Android app

Or read this on Hacker News

Read more on:

Photo of functions

functions

Photo of phrase

phrase

Photo of Phrase origin

Phrase origin

Related news:

News photo

Showh HN: Microjax – JAX in two classes and six functions

News photo

Functions Are Vectors (2023)

News photo

The messy reality of SIMD (vector) functions