Programming Languages – What is Meant by Elaboration of a Declaration Statement?

language-agnosticprogramming-languages

Intuitively I understand "elaboration" and have a very mild idea. But I want to know exactly what is elaboration of a declaration?

I came across this word in this context:

Stack dynamic storage bindings are created for variables when their declaration statements are elaborated.

The quote is from "Concepts of Programming languages" Robert Sebesta .

Best Answer

From Robert Sebesta's Concepts of Programming Languages 9th edition:

Elaboration of a declaration refers to the storage allocation and binding process that takes place when the code containing the declaration is executed.

Okay, what does that mean?

Stack Dynamic variables are allocated to the stack. Hardware in the case of native code. Software in the case of a a virtual machine. This means that they are pushed on to the stack when the code containing them is executed. Static variables on the other hand are bound and given values at load time when the program begins running.

How then is this useful? Well, functions generally get sent to the stack when they execute along with the passed parameters. In addition to being faster than the heap, this allows for recursive calls.

As a historical note, Elaboration as a term originated with Algol 68.