Programming Languages – Subscript Binding and Array Categories

arrayprogramming-languages

I am learning "Programming languages principles" and there is a lot of information about stuff which make up a programming language . Unfortunately every material I came across until now has a lot of technical jargon involved and is very difficult to understand (Atleast for a beginner sincerely trying to understand the topic on his own by reading the material) .

Can anyone explain me the "Subscript binding and array categories" in general .. The classification says there are five kinds of arrays –
1.Static array
2.Fixed stack-dynamic array
3.Stack dynamic array
4.Fixed heap dynamic array
5.Heap dynamic array

This is what I could understand from the definitions (almost on every article on this topic I came across) .

Static array – subscript ranges are statically bound and storage allocation is static.
I understood that the space for the array is allocated in memory at compile time (before run time) .

Fixed stack-dynamic array – subscript ranges are statically bound, but the allocation is done at elaboration time during execution.
Now I didn't understand anything . What is meaning of the italicized phrases

Stack-dynamic array – the subscript ranges are dynamically bound, and the storage allocation is dynamic โ€œduring execution.โ€ Once bound they remain fixed during the lifetime of the variable.
I dont understand what is meant by being 'bound' ?

I should be able to understand the remaining two definitions if I understand these three .

I know I am asking a lot .
Thanks ๐Ÿ™‚

Here's a link I recently came across which I find useful for this topic . Anyone interested in this topic , check it out . ๐Ÿ™‚

Best Answer

To elaborate DeadMG's answer, it sounds like they mean:

  1. Static array: an array whose size is known, and whose storage is allocated, at compile time. In C, you might write at global (file) scope:

    int static_array[7];
    
  2. Fixed stack-dynamic array: you know the size of your array at compile time, but allow it to be allocated automatically on the stack (the size is fixed at compile time but the storage is allocated when you enter its scope, and released when you leave it)

    void foo()
    {
      int fixed_stack_dynamic_array[7];
      /* ... */
    }
    
  3. Stack dynamic array: you don't know the size until runtime, eg. C99 allows this:

    void foo(int n)
    {
      int stack_dynamic_array[n];
      /* ... */
    }
    
  4. Fixed heap dynamic array: same as the 2 except using explicit heap allocation

    int * fixed_heap_dynamic_array = malloc(7 * sizeof(int));
    
  5. Heap dynamic array: you can probably guess this:

    void foo(int n)
    {
      int * heap_dynamic_array = malloc(n * sizeof(int));
    }
    

Is this the same book as Concepts of Programming Languages? Because again, these aren't a useful classification of types, they only address the allocation mechanism. Once you pass any of these "different" things into a function, their classification under this scheme is irrelevant.