Unformatted text preview:

Where s My Compiler Developer tools past present and future Jim Miller Software Architect Developer Frameworks Microsoft Corporation with help from Carol Eidt Phoenix Project Microsoft Corporation Outline What Is A Compiler A Brief History of Developer Tools My First Compiler Compilers compilers everywhere Jan 14 2019 Where s My Compiler 2 What Is A Compiler A converter from one representation source code to another executable code Preserves most of the meaning of the source One part of a modern tool chain used to produce executable artifacts applications Jan 14 2019 Where s My Compiler 3 A Compiler Source Code Describes desired behavior Compiler Executable Code Has desired behavior but May have different internal structure May execute in different unobservable order Jan 14 2019 Where s My Compiler 4 Figures of Merit Code Quality how efficient is the generated code Speed and Space these aren t independent but they aren t the same either Throughput how fast is the code generated Footprint how large is the compiler Jan 14 2019 Where s My Compiler 5 Outline What Is A Compiler A Brief History of Developer Tools My First Compiler Compilers compilers everywhere Jan 14 2019 Where s My Compiler 6 1950s Just a Compiler Please The compiler references a runtime but the runtime is supplied by the OS at a fixed location in memory FORTRAN runtime input output formatting COBOL runtime also search and sort OS loader loads the compiler output into memory transfers control Address space is small 8K word CPU is slow 1 000 instructions sec Figure of merit Code Quality Compiler must optimize code for space Compiler must optimize code for speed Jan 14 2019 Where s My Compiler 7 Inside the Compiler in concept Source Code Front End Compiler Back End Executable Code Jan 14 2019 Where s My Compiler 8 Inside the Compiler in concept Source Code Parse source code Produce abstract syntax tree AST Front End Produce symbol table Generate errors Syntax errors Compiler Type errors Back End Unbound references Executable Code Jan 14 2019 Where s My Compiler 9 Inside the Compiler in concept Source Code Front End Code Analysis Compiler Basic block analysis Control and data flow graph analysis Back End Executable Code Jan 14 2019 Linearize parse tree Optimize machineindependent Redundant and dead code elimination Code restructuring Convert to executable code Register allocation Peephole optimization Where s My Compiler 10 Branch prediction and tensioning 1960s Linkers Programs are growing in size Programs are built with libraries Virtual memory systems are invented Tool chain is in two stages Libraries provide reusable code fragments Compile independent modules Combine the modules using a linker Figure of merit Code quality speed Jan 14 2019 Where s My Compiler 11 Tools Compiler Linker Compile r Source Code Source Code Source Code Front End Front End Front End Back End Back End Back End Object Code Object Code Object Code Includes external references Linker Executable Code Jan 14 2019 Where s My Compiler 12 1970s Symbolic Debugger OS written in high level language High level languages provide large runtime libraries in multiple units Compilers provide sufficient code performance and low level access Static linker pulls only required units into a given program image Compiler exports symbol table for use by debugger not just internal to front back end Figure of merit Code quality speed Jan 14 2019 Where s My Compiler 13 Compiler Linker Debugger Compile r Source Code Source Code Source Code Front End Front End Front End Back End Back End Back End Object Code Object Code Object Code Linker Symbol table s Debugger Running Program Jan 14 2019 Where s My Compiler 14 1980s Dynamic Loading Threading To improve OS performance by reducing physical memory pressure read only parts of libraries are shared between applications OS loader fixes up references to shared libraries just like the static linkers Locks monitors events polling Order of operations visible across thread boundaries Memory model semantics become an issue Ada introduces rendez vous other languages have other constructs Tool chain Not all libraries are loaded into the same virtual address Concurrency issues addressed in programming languages Loaded on first reference Compiler s Linker Loader Symbolic debugger Figure of merit Code quality speed but this is related to space Jan 14 2019 Where s My Compiler 15 OS Dynamic Loader Compile r Source Code Source Code Source Code Front End Front End Front End Back End Back End Back End Object Code Object Code Object Code Includes fixups for shared code Symbol table s Static Linker Image File Image File Image File OS Loader Debugger Running Program Jan 14 2019 Where s My Compiler 16 1990s JITs and Managed Runtimes Garbage Collection goes mainstream Verification requires runtime to analyze code Typically by a factor of 5 to 15 Tool chain split the compiler in two Verification is similar to front end compiler work Can be done to native code but much simpler with an intermediate language Just in time JIT compilation increases performance over pure interpretation Previously LISP APL SmallTalk 1990s Java Jscript C VB Linearize the AST to create Intermediate Language IL Save symbol table as metadata Reorder the chain Figures of merit Throughput first code quality second Jan 14 2019 Where s My Compiler 17 OS Dynamic Loader repeat Compile r Source Code Source Code Source Code Front End Front End Front End Back End Back End Back End Object Code Object Code Object Code Includes fixups for shared code Symbol table s Static Linker Image File Image File Image File OS Loader Debugger Running Program Jan 14 2019 Where s My Compiler 18 OS Dynamic Loader repeat Source Code Front End Back End Compile r Object Code Static Linker Image File OS Loader Debugger Running Program Jan 14 2019 Where s My Compiler 19 Managed Runtime Source Code Compile r Runtime Front End Image File Back End OS Loader Object Code Dynamic Linker Compile r Static Linker Image File Back End OS Loader Debugger Running Program Jan 14 2019 Where s My Compiler 20 Managed Runtime Metadata Intermediate Language Compile r Runtime Source Code Front End Image File Back End OS Loader Object Code Dynamic Linker Compile r Static Linker Image File Back End OS Loader Debugger Running Program Jan 14 2019 Where s My Compiler 21 2000s Reflection based Computation Reflection ability of a program to observe and possibly modify its structure and behavior Interactive Development Environments


View Full Document

Columbia COMS W4115 - Where’s My Compiler

Documents in this Course
YOLT

YOLT

13 pages

Lattakia

Lattakia

15 pages

EasyQL

EasyQL

14 pages

Photogram

Photogram

163 pages

Espresso

Espresso

27 pages

NumLang

NumLang

6 pages

EMPATH

EMPATH

14 pages

La Mesa

La Mesa

9 pages

JTemplate

JTemplate

238 pages

MATVEC

MATVEC

4 pages

TONEDEF

TONEDEF

14 pages

SASSi

SASSi

16 pages

JTemplate

JTemplate

39 pages

BATS

BATS

10 pages

Synapse

Synapse

11 pages

c.def

c.def

116 pages

TweaXML

TweaXML

108 pages

Load more
Loading Unlocking...
Login

Join to view Where’s My Compiler and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Where’s My Compiler and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?