title: Array vs Record, Dynamic Subscripts vs Static Field
body: <p>So, I've studied programming languages using the book of Robert W. Sebesta, &quot;Concepts of Programming Languages&quot;. There is one interesting paragraph that compares <code>heterogeneous array</code> to <code>record</code>. Apparently, the access time of an array is much slower because subscripts are dynamic, in contrast to static field names.</p>
  <p><strong>Question:</strong> So why is it faster? Does it have something to do with the utilization of Stack and Heap memory?</p>
  <p>page 265, chapter 6:</p>
  <blockquote>
  <p>Records are used when the collection of data values is heterogeneous
  and the different fields are not processed in the same way. Also, the
  fields of a record often need not be processed in a particular order.
  Field names are like literal, or constant, subscripts. Because they
  are static, they provide very efficient access to the fields. Dynamic
  subscripts could be used to access record fields, but it would
  disallow type checking and would also be slower.</p>
  </blockquote>