Contents

1 Introduction
2 Compiling and Installing Knit
 2.1 Acquiring Knit
 2.2 Building the Knit Programs
  2.2.1 Compiling libelf
  2.2.2 Configuring Knit
  2.2.3 Compiling Knit
 2.3 Installing Knit
 2.4 Testing Knit
 2.5 Related Software
  2.5.1 The OSKit
  2.5.2 gcc for Knitted Code
3 Using Knit
 3.1 The knit Compiler
  3.1.1 Output Files
  3.1.2 Command Line Options
  3.1.3 The knit_generated.mk File
 3.2 The knitdoc Documentation Generator
 3.3 The mk_unit Template Generator
 3.4 The rename_dot_o_files Object Editor
4 Tutorial
 4.1 Unit Basics: The hello Example
  4.1.1 The Unit Model of Software Components
  4.1.2 A Unit File
  4.1.3 Imports and Exports
  4.1.4 Dependencies
  4.1.5 Files
  4.1.6 Compiling the hello Program
 4.2 Using Multiple Units: The msg Example
  4.2.1 Bundletypes
  4.2.2 Renaming
  4.2.3 Compound Units
  4.2.4 Compiling the msg Program
 4.3 Knitting Tricks: The calc Example
  4.3.1 Initializers and Finalizers
  4.3.2 More About Dependencies
  4.3.3 More About Renaming
  4.3.4 Wrappers and Transparent Interposition
  4.3.5 Multiple Instantiation
  4.3.6 Summary: The Calc and Calc_Counted Units
  4.3.7 Compiling the calc Program
  4.3.8 Optimizing the Code via “Flattening”
 4.4 Other Knit Features
5 Debugging Knitted Programs
6 Knitting the OSKit