Yurttas/PL/IL/docs/il.html

From ZCubes Wiki
Jump to navigation Jump to search




imperative languages


  • Imperative languages are based on the fully specified and fully controlled manipulation of named data in a step-wise fashion.
  • A data declaration binds a name to a type and possibly to a value.
  • Typical basic types are integers, characters and real numbers. New types can be made using type constructors. Examples of type constructors are enumerations, arrays and records.
  • Types are name-equivalent if they have the same names, and structure-equivalent if they have the same values and allow the same operations. Coersions and casts allow minor evasions of the type system.
  • Two features in a language are orthogonal if they can be combined freely without restricting each other in any way.
  • Internal state is modified through assignment statements, external state through output statements. The values used derive from expressions.
  • The main flow-control mechanisms are sequencing, selection, repetition, and routine invocation.
  • Run-time errors can be caught by using signals and exceptions. They turn the error into a flow-of-control issue. Both methods have their problems.
  • In program construction, four levels of hierarchy can be distinguished: blocks, routines, modules/packages and programs.
  • Scope rules determine which declaration or declarations define a given name. If more than one declaration is identified, contextual scope rules are needed to disambiguate.
  • Procedures do not yield a value, functions do, and operators are different notation for functions. The main parameter passing mechanisms are call by value and call by reference.
  • A module defines an interface, represented by its specification part. The implementation part is separate and hidden from the interface user. In principle, a separate representation part is needed, but this is generally included in the specification part.
  • An abstract data type (ADT) is a named data type defined solely through routines for creating, manipulating and deleting values of that data type; all internal structure is hidden from the user. It differs from a module in that a module contains a type definition from which items can be declared, whereas an ADT is a type that is used directly to declare items.
  • A generic X-unit is a template to derive X-units from. The derivation process is called instantiation. Generic units can be parameterized.
  • Final program composition is generally done using the system linker. The main problem is ensuring the consistency of the object files linked. The help of some sort of program management system is indispensable here.