Matthew Fluet Cornell University

Slides:



Advertisements
Similar presentations
Operating Systems Components of OS
Advertisements

Introduction to Compilation of Functional Languages Wanhe Zhang Computing and Software Department McMaster University 16 th, March, 2004.
Programming Languages and Paradigms
Introduction to SPIM Simulator
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Implementation and Evaluation of a Safe Runtime in Cyclone Matthew Fluet Cornell University Daniel Wang Princeton University.
Survey of Typed Assembly Language (TAL) Introduction and Motivation –Conventional untyped compiler < Typed intermediate languages –Typed intermediate language.
Typed Memory Management in a Calculus of Capabilities David Walker (with Karl Crary and Greg Morrisett)
Programming Language Semantics Java Threads and Locks Informal Introduction The Java Specification Language Chapter 17.
Chapter 9: Subprogram Control
Introduction and Syntax. Course objectives Discuss features of programming languages. Discuss how the features are implemented in a simple computer architecture.
Chapter 1 Overview of Computers and Programming. Copyright ©2004 Pearson Addison-Wesley. All rights reserved.1-2 Figure 1.3 Components of a Computer.
CCSA 221 Programming in C CHAPTER 2 SOME FUNDAMENTALS 1 ALHANOUF ALAMR.
13/02/2009CA&O Lecture 04 by Engr. Umbreen Sabir Computer Architecture & Organization Instructions: Language of Computer Engr. Umbreen Sabir Computer Engineering.
computer
Introduction A variable can be characterized by a collection of properties, or attributes, the most important of which is type, a fundamental concept in.
Basic Semantics Associating meaning with language entities.
CS112: Structure of Programming Languages A smorgasbord of topics in programming languages including programming paradigms and syntax, semantics, implementation.
Real Time Programming Language. Intro A programming language represents the nexus of design and structure. But misuse of the programming language can.
(1) ICS 313: Programming Language Theory Chapter 12: Object Oriented Programming.
Georgia Institute of Technology Speed part 1 Barb Ericson Georgia Institute of Technology May 2006.
FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES Dr. John Peterson Western State Colorado University.
Recap Introduction to Inheritance Inheritance in C++ IS-A Relationship Polymorphism in Inheritance Classes in Inheritance Visibility Rules Constructor.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 330 Programming Language Structures Operational Semantics (Slides mainly.
Code Generation Instruction Selection Higher level instruction -> Low level instruction Register Allocation Which register to assign to hold which items?
Automatic Memory Management Without Run-time Overhead Brian Brooks.
A Single Intermediate Language That Supports Multiple Implemtntation of Exceptions Delvin Defoe Washington University in Saint Louis Department of Computer.
Writing and Remembering
What is a Functional Language?
Prof. Hsien-Hsin Sean Lee
Basic 1964 PC general purpose Imperative Small Easy to use.
PROGRAMMING LANGUAGES
Programming Languages Translator
Subprograms The basic abstraction mechanism.
What Are Preservatives And Additives.
Stateful Manifest Contracts
CSC 253 Lecture 8.
Matthew Fluet Cornell University
CSC 253 Lecture 8.
مدیریت استراتژيک منابع انسانی
Type Systems for Region-based Memory Management
Matthew Fluet Cornell University
Transactional Events Kevin Donnelly, Boston University
Matthew Fluet Cornell University
Linear Regions Are All You Need
Binding Times Binding is an association between two things Examples:
A Model of Substructural State
مديريت موثر جلسات Running a Meeting that Works
Matthew Fluet Cornell University Greg Morrisett Harvard University
UNIT V Run Time Environments.
Programming Languages
INTRODUCTION TO COMPILERS (Pavan)
5 Themes of Geography Project
Ռազմավարական կառավարում
Linear Programming Problem
Implementation and Evaluation of a Safe Runtime in Cyclone
Students will be able to: Convert data sets into graphs.
OBJ first-order functional language based on equational logic
Implementation and Evaluation of a Safe Runtime in Cyclone
LANGUAGE EDUCATION.
[Most of the details about queues are left for to read about and work out in Lab 6.] Def. As a data structure, a queue is an ordered collection of data.
Calculus W 18 January 2012.
Calculus F 24 February 2012.
Student : Yan Wang student ID:
Calculus W 29 February 2012.
Calculus M 30 January 2012.
Calculus W 11 April 2012.
Calculus M 31 October 2011.
Calculus W 18 April 2012.
Calculus F 27 January 2012.
Presentation transcript:

Matthew Fluet Cornell University Monadic Regions Matthew Fluet Cornell University

Introduction Draw together two lines of research Region-based memory management Regions delimit lifetimes of objects new .e Monadic encapsulation of effects Embed imperative features in pure languages runST :: .(s. RGN s )  

FRGN = System F + RGN monad Monadic (sub)-language Monadic types and operations RGN r  – monadic region computations RGNVar r  – region allocated values RGNHandle r – region handles

FRGN = System F + RGN monad Create and read region allocated values allocRGNVar :: ,r.   RGNHandle r  RGN r (RGNVar r ) readRGNVar :: ,r. RGNVar r   RGN r 

FRGN = System F + RGN monad Encapsulate and run a monadic computation runRGN :: .(r. RGNHandle r  RGN r )  

FRGN = System F + RGN monad Encapsulate a region newRGN :: ,r.(s. RGNHandle s  RGN s )  RGN r α

FRGN = System F + RGN monad Encapsulate a region newRGN :: ,r.(s. r  s  RGNHandle s  RGN s )  RGN r α  ≡ ,r,s. RGN r   RGN s 

Single Effect Calculus LIFO stack of regions imposes a partial order on live (allocated) regions Regions lower on the stack outlive regions higher on the stack A single region can serve as a witness for a set of effects Region appears as a single effect in place of the set

new .e  newRGN (.w.h. e) Translation Type-preserving translation from Single Effect Calculus to FRGN new .e  newRGN (.w.h. e)

Conclusion Monadic encoding of effects applicable to region calculi Trivial (syntactic) equality on types Encapsulation within monad

FRGN = System F + RGN monad Monadic unit and bind returnRGN :: ,r.   RGN r  thenRGN :: ,,r. RGN r   (  RGN r )  RGN r 