source: doc/theses/aaron_moss_PhD/phd/introduction.tex @ 909aebf

ADTaaron-thesisarm-ehast-experimentalcleanup-dtorsdeferred_resnenumforall-pointer-decayjacob/cs343-translationjenkins-sandboxnew-astnew-ast-unique-exprno_listpersistent-indexerpthread-emulationqualifiedEnum
Last change on this file since 909aebf was 7b61ce8, checked in by Aaron Moss <a3moss@…>, 6 years ago

Started type environment thesis chapter (now after expression resolution)

  • Property mode set to 100644
File size: 4.5 KB
RevLine 
[2a9d12d]1\chapter{Introduction}
2
[514247d]3The C programming language has had a wide-ranging impact on the design of software and programming languages.
4In the 30 years since its first standardization, it has consistently been one of the most popular programming languages, with millions of lines of C code still in active use, and tens of thousands of trained programmers producing it. The TIOBE index\cite{TIOBE} tracks popularity of programming languages over time, and C has never dropped below second place:
5
[0cf9ffd]6\begin{table}[h]
[7b61ce8]7\caption[TIOBE index over time]{Current top 5 places in the TIOBE index averaged over years} \label{tiobe-table}
[514247d]8
9\centering
10\begin{tabular}{@{}cccccccc@{}}
11        & 2018  & 2013  & 2008  & 2003  & 1998  & 1993  & 1988  \\
12Java            & 1             & 2             & 1             & 1             & 18    & --    & --    \\
13\textbf{C}      & \textbf{2} & \textbf{1} & \textbf{2} & \textbf{2} & \textbf{1} & \textbf{1} & \textbf{1} \\
14\CC{}           & 3             & 4             & 3             & 3             & 2             & 2             & 5             \\
15Python          & 4             & 7             & 6             & 11    & 22    & 17    & --    \\
16\Csharp{}       & 5             & 5             & 7             & 8             & --    & --    & --    \\
17\end{tabular}
18\end{table}
19
20The impact of C on programming language design is also obvious from Table~\ref{tiobe-table}; with the exception of Python, all of the top five languages use C-like syntax and procedural control structures.
[0cf9ffd]21\CC{} is even a largely backwards-compatible extension of C, with development dating back nearly as far as C itself.
[514247d]22Though its lasting popularity and wide impact on programming language design point to the continued relevance of C, they also highlight the widespread desire of programmers for languages with more expressive power and programmer-friendly features; accommodating both low-impact maintenance of legacy C code and low-effort development of the software of the future is a difficult task for a single programming language.
23
24\CFA{}\footnote{Pronounced ``C-for-all'', and written \CFA{} or \CFL{}.} is an evolutionary modernization of the C programming language which aims to fulfill both these ends well.
[62e782e]25\CFA{} both fixes existing design problems and adds multiple new features to C, including name overloading, user-defined operators, parametric-polymorphic routines, and type constructors and destructors, among others.
[514247d]26The new features make \CFA{} more powerful and expressive than C, while maintaining strong backward-compatibility with both C code and the procedural paradigm expected by C programmers.
27However, these new features do impose a compile-time cost, particularly in the expression resolver, which must evaluate the typing rules of a significantly more complex type-system.
[62e782e]28
29This thesis is focused on making \CFA{} a more powerful and expressive language, both by adding new features to the \CFA{} type system and ensuring that both added and existing features can be efficiently implemented in \CFACC{}, the \CFA{} reference compiler.
30Particular contributions of this work include design and implementation of
[0cf9ffd]31parametric-polymorphic (``generic'') types in a manner compatible with the existing polymorphism design of \CFA{} (Chapter~\ref{generic-chap}), a type environment data structure based on a novel variant of the union-find algorithm (Chapter~\ref{env-chap}), and a new expression resolution algorithm designed to quickly locate the optimal declarations for a \CFA{} expression (Chapter~\ref{resolution-chap}).
[62e782e]32This expression resolution algorithm was designed with the aid of a purpose-built prototype system which encapsulates the essential aspects of the \CFA{} type system without incurring the technical debt of the existing system or the friction-inducing necessity of maintaining a working compiler; the goal of this prototype system was to discover effective heuristics to avoid performing unnecessary work in the process of locating the optimal \CFA{} expression resolution.
33
34Though the direction and validation of this work was fairly narrowly focused on the \CFA{} programming language, the tools used and results obtained should be of interest to a wider compiler and programming language design community.
35In particular, with the addition of \emph{concepts} in \CCtwenty{}, conforming \CC{} compilers must support a model of type assertions very similar to that in \CFA{}, and the algorithmic techniques used in the expression resolution algorithm presented here may prove useful.
[0cf9ffd]36Type environments are also widely modelled in compiler implementations, particularly of functional languages, though also increasingly commonly in other languages (such as Rust) which perform type inference; the type environment presented here may be useful to those language implementers.
Note: See TracBrowser for help on using the repository browser.