Presentation is loading. Please wait.

Presentation is loading. Please wait.

Survey of Typed Assembly Language (TAL) Introduction and Motivation –Conventional untyped compiler < Typed intermediate languages –Typed intermediate language.

Similar presentations


Presentation on theme: "Survey of Typed Assembly Language (TAL) Introduction and Motivation –Conventional untyped compiler < Typed intermediate languages –Typed intermediate language."— Presentation transcript:

1 Survey of Typed Assembly Language (TAL) Introduction and Motivation –Conventional untyped compiler < Typed intermediate languages –Typed intermediate language < Typed target language ( TAL) Resources –From System F to Typed Assembly Language Greg Morrisett, David Walker, Karl Crary, and Neal Glew –From System F to Typed Assembly Language (Extended version). Technical Report TR97-1651 Greg Morrisett, David Walker, Karl Crary, and Neal Glew –Intensional Polymorphism in Type-Erasure Semantics. Stephanie Weirich, Karl Crary and Greg Morrisett –TALx86: A Realistic Typed Assembly Language Greg Morrisett, Karl Crary, Neal Glew, Dan Grossman, Richard Samuels, Frederick Smith, David Walker, Stephanie Weirich, and Steve Zdancewic Structure –From system F to TAL: 4 translations and 5 typed calculi –Extension and practice: TAL86x, a realistic typed assembly language

2 Step 1 : system F and Continuation Passing style (CPS) conversion –Objective: conversion to CPS –Syntax for λ F (call-by-value variant of system F augmented with products and recursion ) –Syntax forλ K (target calculus, typed intermediate language) –What’re completed and changed? Names all intermediate computations and eliminates the need for a control stack All unconditional control transfers are achieved via function call λ K is almost linear, except for if0 Functions in λ K invoke continuations using “ void” Halt[τ]υ terminates the computation Compilation of System F to Typed Assembly Language * Cited from “From system F to TAL” * * * Product type Recursion

3 Step 2 : Simplified Polymorphic Closure Conversion –Objective: separate program code from data –Two steps: Closure conversion proper –Approaches: Minamide et al / The Definition of Standard ML @ »Type-passing / Type-erasure interpretation of polymorphism (types are constructed and passed to polymorphic functions at run-time) (run-time type information is represented by ordinary terms) »Polymorphic instantiation cannot / can easily be handled via substitution »Requires / Don’t require both abstract kinds of translucent types –Cost of Polymorphic closure conversion Hoisting – lift the closed function code to the top of program –Key point of implementation of the Type-erasure interpretation Partial applications of functions to type arguments to be values Eg. : υ has type is treated as a value and has type Compilation of System F to Typed Assembly Language * * Cited from “From system F to TAL”, Greg Morrisett, David Walker, Karl Crary, and Neal Glew @ Cited from “ Intensional Polymorphism in Type-Erasure Semantics ”, Karl Crary, Stephanie Weirich, and Greg Morrisett *

4 Step 3 : Explicit Allocation –Objective: allocate spaces for tuples and fill them out field by field –Syntax forλ A (similar to λ C ): –Features: Tuples no long have value form Creation of an n-element tuple: an allocation step + n initialization steps Eg. Creation of the pair Compilation of System F to Typed Assembly Language * Cited from “From system F to TAL” * * *

5 Step 4: Code generation –Objective: convertλ A to TAL, mostly syntactic –TAL syntax Compilation of System F to Typed Assembly Language * Cited from “From system F to TAL” * * Key technical Difference TAL program *


Download ppt "Survey of Typed Assembly Language (TAL) Introduction and Motivation –Conventional untyped compiler < Typed intermediate languages –Typed intermediate language."

Similar presentations


Ads by Google