\section{Introduction}

The {\em Tycoon} project aims at substantially improving the productivity
of database programmers by providing an integrated linguistic and
architectural framework for the flexible integration of external
services into an open database programming environment
\cite{MaSc93b}. Tycoon applications are written in a strongly typed,
higher-order polymorphic programming language (TL, {\em Tycoon
Language}) that offers a minimal and orthogonal set of naming, binding
and typing concepts to the application and system programmer
\cite{MaSc92a}.

\begin{figure}[btp]
\epsfbild{TycoonLayers.epsf}{\epsfxsize=0.58\columnwidth}
\caption{Tycoon System Layers}
\label{Fig:TycoonLayers}
\end{figure}

The Tycoon system is organized as a layered architecture as outlined in
figure \ref{Fig:TycoonLayers}. Tycoon programs are parsed by the
compiler front end and an abstract syntax tree representation with
annotated type information is built. Subsequently, the program is passed
to the compiler back end in the form of a tree-structured, untyped
intermediate program representation (TML, {\em Tycoon Machine
Language}). This intermediate representation is used to perform various
source language- and target machine-independent optimizations by
extensive tree rewriting. The TML tree is further translated into a
byte-coded sequence of abstract machine instructions (TVM, {\em Tycoon
Virtual Machine}) that permits efficient code execution at runtime. The
Tycoon virtual machine and the runtime system communicate with the
underlying object store via a data-model independent software protocol
(TSP, {\em Tycoon Store Protocol}) that encapsulates different object
store implementations and their components for access optimization,
storage reclamation, persistence, concurrency control and distribution.

%The intermediate program representation TML is based on {\em Continuation
%Passing Style (CPS)} which is a powerful yet simple program representation
%technique.

This document is intended to provide an overview over the intermediate
program representation TML and the translation process from typed TL
source code into untyped TML trees.  The abstract syntax of TML and the
set of available primitive operations are presented in sections
\ref{Section:TML Abstract Syntax} 
and \ref{Section:Primitive Procedures}. Two alternatives in handling
runtime exceptions in the intermediate program representation are
discussed in section \ref{Section:Exceptions}.  Section
\ref{Section:Compilation Phases} gives an overview of the different
passes of the Tycoon compiler back end which works on the TML
intermediate representation. The rest of the paper describes the various
passes of the compiler back end in more detail. The TL data structures
used to represent TML trees within the Tycoon system are given in the
appendix.



