| Introduction | p. 1 |
| The Problem | p. 1 |
| Our Solution | p. 2 |
| Overview of this Thesis | p. 2 |
| Relation to our Previous Work | p. 3 |
| Preliminaries | p. 5 |
| Use of Formal Specifications | p. 5 |
| Why Generate Compilers? | p. 6 |
| Ways to Specify Semantics | p. 6 |
| Interpreters | p. 6 |
| Abstract Machines | p. 7 |
| Attribute Grammars | p. 7 |
| Donotational Semantics | p. 8 |
| Action Semantics | p. 9 |
| Evolving Algebras | p. 10 |
| Structural Operational Semantics | p. 10 |
| Natural Semantics | p. 11 |
| Natural Deduction | p. 11 |
| Relation to Programming Languages | p. 12 |
| Example | p. 12 |
| Meaning | p. 13 |
| Pragmatics | p. 14 |
| Recent Extensions | p. 15 |
| The Design of RML | p. 17 |
| Syntax | p. 18 |
| Static Semantics | p. 20 |
| Bindings and Unknowns | p. 21 |
| Technicalities | p. 21 |
| Modelling Backtracking | p. 22 |
| Intuition | p. 22 |
| Origins | p. 24 |
| Denotational Semantics of Backtracking | p. 25 |
| Deter minacy | p. 30 |
| History | p. 31 |
| Static Semantics | p. 31 |
| Dynamic Semantics | p. 32 |
| Differences from SML | p. 32 |
| Examples | p. 35 |
| A Small Example | p. 35 |
| Abstract Syntax | p. 35 |
| Inference Rules | p. 36 |
| Operational Interpretation | p. 36 |
| Mini-Freja | p. 37 |
| Abstract Syntax | p. 37 |
| Values | p. 38 |
| Environments | p. 38 |
| Evaluation | p. 39 |
| Modularity | p. 41 |
| Adding Recursion | p. 42 |
| Summary | p. 44 |
| Diesel | p. 44 |
| Static Elaboration | p. 44 |
| Flattening | p. 45 |
| Emitting Code | p. 46 |
| C Glue | p. 46 |
| Summary | p. 46 |
| Petrol | p. 47 |
| Summary | p. 47 |
| Mini-ML | p. 47 |
| Rémy-Style let-Polymorphism | p. 48 |
| Equality Types | p. 50 |
| Wright's Simple Imperative Polymorphism | p. 50 |
| Overloading | p. 51 |
| Specification Fragments | p. 53 |
| Summary | p. 55 |
| Problematic Issues | p. 55 |
| Environments | p. 55 |
| Default Rules | p. 55 |
| Summary | p. 56 |
| Implementation Overview | p. 57 |
| Compilation Strategy | p. 57 |
| Development | p. 58 |
| Alternatives | p. 59 |
| Prolog | p. 59 |
| Warren's Abstract Machine | p. 59 |
| Attribute Grammars | p. 60 |
| SML | p. 60 |
| Implementation Status | p. 60 |
| Reducing Nondeterminism | p. 63 |
| Background | p. 64 |
| Grammars | p. 64 |
| FOL Representation | p. 65 |
| The Front-End | p. 66 |
| The FOL-TRS Rewriting System | p. 67 |
| Properties | p. 70 |
| Termination | p. 70 |
| Confluence | p. 73 |
| Alternatives for Rewriting Negations | p. 74 |
| Examples | p. 75 |
| append | p. 75 |
| lookup | p. 76 |
| Missed Conditionals | p. 78 |
| Implementation Notes | p. 81 |
| Implementation Complexity | p. 82 |
| Limitations | p. 83 |
| Related Work | p. 84 |
| Compiling Pattern Matching | p. 85 |
| Introduction | p. 85 |
| What is Matching? | p. 85 |
| Compiling Term Matching | p. 86 |
| Troublesome Examples | p. 87 |
| Copied Expressions | p. 88 |
| Repeated and Sub-Optimal Tests | p. 89 |
| Intuitive Operation | p. 89 |
| Preliminaries | p. 91 |
| Objects | p. 92 |
| Operations | p. 93 |
| The Algorithm | p. 95 |
| Step 1: Preprocessing | p. 95 |
| Step 2: Generating the DFA | p. 96 |
| Step 3: Merging of Equivalent States | p. 97 |
| Step 4: Generating Intermediate Code | p. 97 |
| The Examples Revisited | p. 98 |
| The demo Function | p. 98 |
| The unwieldy Function | p. 100 |
| State Merging | p. 102 |
| Implementation Notes | p. 105 |
| Data Representation | p. 105 |
| Compile-Time Warnings | p. 105 |
| Matching Exceptions | p. 106 |
| Guarded Patterns | p. 106 |
| Related Work | p. 107 |
| Modifications for RML | p. 108 |
| Experiences and Conclusions | p. 109 |
| Compiling Continuations | p. 111 |
| Properties of CPS | p. 111 |
| Translating RML to CPS | p. 113 |
| Data Representation | p. 113 |
| Local Optimizations on CPS | p. 116 |
| Translating CPS to Code | p. 116 |
| Control | p. 116 |
| Copy Propagation | p. 120 |
| Memory Allocation | p. 120 |
| Data | p. 121 |
| Translating Code to C | p. 121 |
| Data Representation | p. 122 |
| Memory Management | p. 122 |
| A Code Generation Example | p. 123 |
| Simulating Tailcalls in C | p. 127 |
| The Problem | p. 127 |
| Overview | p. 128 |
| Why is C not Tail-Recursive? | p. 129 |
| Why do not Prototypes Help? | p. 130 |
| ANDF | p. 130 |
| Preliminaries | p. 130 |
| Tailcall Classification | p. 133 |
| Plain Dispatching Labels | p. 133 |
| Alternative Access Methods for Globals | p. 135 |
| The Monster Switch | p. 136 |
| Dispatching Switches | p. 138 |
| Step 1: Fast Known Intramodule Calls | p. 138 |
| Step 2: Recognizing Unknown Intramodule Calls | p. 139 |
| Step 3: Fast Unknown Intramodule Calls | p. 140 |
| Additional Benefits | p. 144 |
| Pushy Labels | p. 144 |
| Pushy Labels and Register Windows | p. 147 |
| The `Warped Gotos' Technique | p. 148 |
| The wamcc Approach | p. 150 |
| Non-Solutions | p. 151 |
| Experimental Results | p. 152 |
| Conclusions | p. 152 |
| Performance Evaluation | p. 153 |
| Target Systems | p. 153 |
| Overview | p. 154 |
| Allocation Arena Size | p. 155 |
| State Access Methods | p. 163 |
| Compiler Optimizations | p. 163 |
| Facing the Opposition | p. 166 |
| Mini-Freja | p. 166 |
| Petrol | p. 167 |
| Conclusions | p. 168 |
| Concluding Remarks | p. 169 |
| Summary | p. 169 |
| Future Work | p. 170 |
| Default Rules | p. 170 |
| Programming Sub-Language | p. 171 |
| Taming Side-Effects | p. 171 |
| Moded Types | p. 171 |
| Linear Types | p. 171 |
| Compile to SML | p. 172 |
| Tuning the Runtime Systems | p. 172 |
| User-Friendliness | p. 172 |
| The Definition of RML | p. 173 |
| Introduction | p. 173 |
| Differences to SML | p. 173 |
| Notation for Natural Semantics | p. 175 |
| Lexical Definitions | p. 175 |
| Syntax Definitions | p. 175 |
| Sets | p. 176 |
| Tuples | p. 176 |
| Finite Sequences | p. 176 |
| Finite Maps | p. 176 |
| Substitutions | p. 177 |
| Disjoint Unions | p. 177 |
| Relations | p. 177 |
| Example | p. 178 |
| Lexical Structure | p. 180 |
| Reserved Words | p. 180 |
| Integer Constants | p. 180 |
| Real Constants | p. 180 |
| Character Constants | p. 180 |
| String Constants | p. 180 |
| Identifiers | p. 181 |
| Type Variables | p. 181 |
| Whitespace and Comments | p. 181 |
| Lexical Analysis | p. 181 |
| Syntactic Structure | p. 183 |
| Derived Forms, Full and Core Grammar | p. 183 |
| Ambiguity | p. 183 |
| Static Semantics | p. 190 |
| Simple Objects | p. 190 |
| Compound Objects | p. 190 |
| Initial Static Environments | p. 191 |
| Inference Rules | p. 191 |
| Dynamic Semantics | p. 201 |
| Simple Objects | p. 201 |
| Compound Objects | p. 201 |
| Initial Dynamic Objects | p. 202 |
| Inference Rides | p. 202 |
| Initial Objects | p. 211 |
| Initial Static Objects | p. 211 |
| Initial Dynamic Objects | p. 211 |
| Bibliography | p. 223 |
| Index | p. 239 |
| Table of Contents provided by Publisher. All Rights Reserved. |