CS 331 Spring 2018: A Primer on Type Systems
ARANK

CS 331 Spring 2018  >  A Primer on Type SystemsBy Glenn G. ChappellText updated: 29 Jan 2018Table of ContentsIntroduction to TypingType Systems: Static vs. DynamicSpecifying Types: Manifest vs. ImplicitChecking Types: Nominal vs. StructuralType Safety: Strong [ick!], Weak [ick!], SoundReferencesCopyright & License1. Introduction to TypingThis article introduces types, type systems, and associated terminology—all from a practical point of view. Sections 2–4 describe how type systems can be placed on three axes: static vs. dynamic, manifest vs. implicit, and nominal vs. structural. Section 5 closes with a discussion of type safety.Basic ConceptsA type system is a way of classifying entities in a program (expressions, variables, etc.) by the kinds of values they represent, in order to prevent undesirable program states. The classification assigned to an entity its type. Most programming languages include some kind of type system.Consider the following C++ code.[C++]int abc;In C++, int …

cs.uaf.edu
Related Topics: C++ Python Lua