Matthew Fluet Cornell University

Slides:



Advertisements
Similar presentations
Understand and appreciate Object Oriented Programming (OOP) Objects are self-contained modules or subroutines that contain data as well as the functions.
Advertisements

Introduction to Compilation of Functional Languages Wanhe Zhang Computing and Software Department McMaster University 16 th, March, 2004.
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Lecture 10: Part 1: OO Issues CS 540 George Mason University.
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.
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.
C++ Programming. Table of Contents History What is C++? Development of C++ Standardized C++ What are the features of C++? What is Object Orientation?
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.
Prepared by: Elsy Torres Shajida Berry Siobhan Westby.
COP4020 Programming Languages Names, Scopes, and Bindings Prof. Xin Yuan.
Implementation and Evaluation of a Safe Runtime in Cyclone Matthew Fluet Cornell University Greg Morrisett Harvard University Daniel Wang Princeton University.
Runtime Organization (Chapter 6) 1 Course Overview PART I: overview material 1Introduction 2Language processors (tombstone diagrams, bootstrapping) 3Architecture.
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.
FUNCTIONAL PROGRAMING AT WORK - HASKELL AND DOMAIN SPECIFIC LANGUAGES Dr. John Peterson Western State Colorado University.
CSCI-383 Object-Oriented Programming & Design Lecture 25.
Recap Introduction to Inheritance Inheritance in C++ IS-A Relationship Polymorphism in Inheritance Classes in Inheritance Visibility Rules Constructor.
PREWRITE: STEP 1: Graphic Organizer Describes who the person is Personality Characteristics.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering CSCE 330 Programming Language Structures Operational Semantics (Slides mainly.
Ex St 801 Statistical Methods Part 2 Inference about a Single Population Mean (HYP)
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
Programming Languages winter term 2010/11
What is a Functional Language?
PROGRAMMING LANGUAGES
Programming Languages Translator
C++ Interlude 2 Pointers, Polymorphism, and Memory Allocation
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
Object Oriented Programming
Linear Regions Are All You Need
Binding Times Binding is an association between two things Examples:
A Model of Substructural State
Matthew Fluet Cornell University Greg Morrisett Harvard University
Programming Languages
INTRODUCTION TO COMPILERS (Pavan)
Finding Limits A Graphical & Numerical Approach
5 Themes of Geography Project
Ռազմավարական կառավարում
Linear Programming Problem
Implementation and Evaluation of a Safe Runtime in Cyclone
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.
Ninth step for Learning C++ Programming
Calculus W 18 January 2012.
Calculus F 24 February 2012.
Student : Yan Wang student ID:
Calculus M 30 January 2012.
Calculus W 11 April 2012.
Calculus M 31 October 2011.
Matthew Fluet Cornell University
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. ST s )  

Introduction Encode Tofte-Talpin region calculus in System F with monadic sub-language Features runST serves as inspiration runRGN – encapsulate region computation newRGN – encapsulate a single region Sufficient polymorphism to encode region polymorphism

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 