1 / 6

Compiler Writing

Compiler Writing. Source Language Issues Size of the source language (bigger = harder) Extent of change during compiler construction (more changes = harder) Performance Criteria Compiler Speed Code Quality Error Diagnostics Portability Maintainability. Performance Criteria. Portability

Download Presentation

Compiler Writing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Compiler Writing • Source Language Issues • Size of the source language (bigger = harder) • Extent of change during compiler construction (more changes = harder) • Performance Criteria • Compiler Speed • Code Quality • Error Diagnostics • Portability • Maintainability

  2. Performance Criteria • Portability • Retargetability • Rehostability • A Retargetable compiler is one that can be modified easily to generate code for a new target language • A rehostable compiler is one that can be moved easily to run on a new machine • A portable compiler may not be as efficient as a compiler designed for a specific machine, because we cannot make any specific assumption about the target machine

  3. How was the first compiler compiled? S T I • Bootstrapping: using the facilities offered by a language to compile itself is essence of bootstrapping • There are three languages involved in writing a compiler • Source Language (S) • Target Language (T) • Implementation Language (I) • T-Diagram

  4. How was the first compiler compiled? L N S M L N S M M • Cross Compiler: If S, T, and I are all different Languages, the compiler is a cross-Compiler • LSN + SMM = LMN

  5. Using BootStrapping to Port a Compiler L N L M L N L N L N L M M L N • LLN + LMM = LMN • LLN + LMN = LNN

  6. Using Bootstrapping to Optimize a Compiler S M S M* S M S M S M S M* M* S M • Using bootstrapping, an optimizing compiler can optimize itself (e.g., M is an optimizing Compiler) • SSM + LM*M* = SM*M • SSM + SM*M = SMM

More Related