CS162 Week 3 Kyle Dewey. Overview Grades posted for assignment 1 Secure information flow key implementation issues Reactive imperative programming.

Slides:



Advertisements
Similar presentations
A Toolbox for Blackboard Tim Roberts
Advertisements

School of EECS, Peking University “Advanced Compiler Techniques” (Fall 2011) SSA Guo, Yao.
1 Compiler Construction Intermediate Code Generation.
CS162 Week 9 Kyle Dewey. Overview What needs to be done Quirks with GC on miniJS Implementing GC on miniJS.
Components of representation Control dependencies: sequencing of operations –evaluation of if & then –side-effects of statements occur in right order Data.
Program Representations. Representing programs Goals.
CS16 Week 2 Part 2 Kyle Dewey. Overview Type coercion and casting More on assignment Pre/post increment/decrement scanf Constants Math library Errors.
CIS101 Introduction to Computing Week 12. Agenda Your questions Solutions to practice text Final HTML/JavaScript Project Copy and paste assignment JavaScript:
Common Sub-expression Elim Want to compute when an expression is available in a var Domain:
Representing programs Goals. Representing programs Primary goals –analysis is easy and effective just a few cases to handle directly link related things.
LCD790 – 02/09/09 Developing research topics Classroom research Case studies.
Recap from last time: live variables x := 5 y := x + 2 x := x + 1 y := x y...
Introduction to a Programming Environment
Direction of analysis Although constraints are not directional, flow functions are All flow functions we have seen so far are in the forward direction.
MBAC 611.  We have been using MS Access to query and modify our databases.  MS Access provides a GUI (Graphical User Interface) that hides much of the.
Week 9 Part 2 Kyle Dewey. Overview Announcement More with structs and memory Assertions Exam #2 Course review.
The Paperless Classroom with Google Docs Eric Curts - North Canton City Schools ericcurts.com - - gplus.to/ericcurts.
Precision Going back to constant prop, in what cases would we lose precision?
IT Website Development Welcome!. Welcome to Unit 7! Optimizing Images and creating photo albums in Dreamweaver There are no textbook readings for.
Prepare Your Academy for 2013
In.  This presentation will only make sense if you view it in presentation mode (hit F5). If you don’t do that there will be multiple slides that are.
Created by, Author Name, School Name—State FLUENCY WITH INFORMATION TECNOLOGY Skills, Concepts, and Capabilities.
Moodle (Course Management Systems). Assignments 1 Assignments are a refreshingly simple method for collecting student work. They are a simple and flexible.
1 A Simple but Realistic Assembly Language for a Course in Computer Organization Eric Larson Moon Ok Kim Seattle University October 25, 2008.
CS162 Week 8 Kyle Dewey. Overview Example online going over fail03.not (from the test suite) in depth A type system for secure information flow Implementing.
Introduction to Canvas K-5
1 Names, Scopes and Bindings Aaron Bloomfield CS 415 Fall
English Language Arts 9 Welcome! 5391.
Go to your school’s web locker site school name.schoolweblockers.com) Your user name is the first letter of your first name, the first 4.
CS 320 Assignment 1 Rewriting the MISC Osystem class to support loading machine language programs at addresses other than 0 1.
Code Optimization 1 Course Overview PART I: overview material 1Introduction 2Language processors (tombstone diagrams, bootstrapping) 3Architecture of a.
XP New Perspectives on Integrating Microsoft Office XP Tutorial 3 1 Integrating Microsoft Office XP Tutorial 3 – Integrating Word, Excel, Access, and PowerPoint.
Advanced Functional Programming Tim Sheard 1 Lecture 6 Functional Programming Tim Sheard & Mark Jones Monads & Interpreters.
Recap form last time How to do for loops map, filter, reduce Next up: dictionaries.
GISMO/GEBndPlan Overview Geographic Information System Mapping Object.
Adobe Photoshop 2 Assignments due by Thursday midnight EXERCISES BEFORE NEXT WEEK: 1. Complete Tutorial Chapter 1 in eBook: “Adobe Photoshop CS4 Classroom.
CMP 131 Introduction to Computer Programming Violetta Cavalli-Sforza Week 3, Lecture 1.
CS162 Week 5 Kyle Dewey. Overview Announcements Reactive Imperative Programming Parallelism Software transactional memory.
Chapter 8: Aspect Oriented Programming Omar Meqdadi SE 3860 Lecture 8 Department of Computer Science and Software Engineering University of Wisconsin-Platteville.
CSE 374 Programming Concepts & Tools Hal Perkins Fall 2015 Lecture 6 – sed, command-line tools wrapup.
CRE Programming Club - Class 2 Robert Eckstein and Robert Heard.
CS162 Week 4 Kyle Dewey. Overview Reactive imperative programming in a nutshell Reactive imperative programming implementation details.
CS2102: Lecture on Abstract Classes and Inheritance Kathi Fisler.
Being Ready at Yearend and Yearstart  Things to do – smschecklist.doc It is the base of your bible! Student Top Tips.
Chapter 11: Sequential File Merging, Matching, and Updating Programming Logic and Design, Third Edition Comprehensive.
CS162 Week 8 Kyle Dewey. Overview Example online going over fail03.not (from the test suite) in depth A type system for secure information flow Implementing.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
Introduction to Arrays. Learning Objectives By the end of this lecture, you should be able to: – Understand what an array is – Know how to create an array.
Netbeans QuickStart. Creating a project File->New Project –For now you want General->Java Application –Then fill in the project details.
PowerTeacher Pro for Teachers Part One
Advanced Programming in C
CSE 374 Programming Concepts & Tools
Winter 2009 Tutorial #6 Arrays Part 2, Structures, Debugger
CS 5010 Program Design Paradigms “Bootcamp” Lesson 5.4
Chapter 5 Conclusion CIS 61.
Microsoft Office 2013 Coming to a PC near you!.
Week 1 Gates Introduction to Information Technology cosc 010 Week 1 Gates
week 1 - Introduction Goals
Order Management For Shippers.
Introduction to JavaScript
A second look at JavaScript
WHAT’S UP?! A GUIDE TO CITING YOUR SOURCES, YO!
Learning to Program in Python
PowerTeacher Pro for Teachers Part One
Programming in JavaScript
Programming in JavaScript
See requirements for practice program on next slide.
Introduction to JavaScript
Running & Testing Programs :: Translators
Presentation transcript:

CS162 Week 3 Kyle Dewey

Overview Grades posted for assignment 1 Secure information flow key implementation issues Reactive imperative programming

Assignment I Lingering Questions

Secure Information Flow Assignment

Missing File As written, there is a missing file: util.scala Option 1: Download zip file from the course website (under “Interpreter Code”), copy util.scala, and add it to the makefile Option 2: Remove all mentions of the pretty printer (from util.scala )

Adding a Field for the Label

pc Stack Define an object named pc It internally has a mutable stack There are many ways to do this, but scala.collection.mutable.Stack is probably the easiest

test27.not

Any questions on secure information flow?

Reactive Imperative Programming

Motivation An interesting language feature Another possible feature to add if designing a language, along with objects and higher-order functions

Citation Camil Demetrescu et al.: Reactive imperative programming with dataflow constraints - OOPSLA'11 Not an easy read, and it shouldn’t be necessary A few key details are ambiguous or missing

Reactive More familiar technology: spreadsheets The value of a cell can depend on the value in other cells If the value of a cell changes, all dependent cells are updated As in, all cells that somehow use the changed cell’s value

Imperative Can work with the imperative paradigm Roughly, with variable/field assignment When a variable/field changes, everything marked as dependent is updated Spreadsheets are a case of reactive functional programming

Marking as Dependent “When variable x changes, execute this given code” Explicitly associate x with code Why isn’t this a great idea?

Marking as Dependent Better alternative: “Here is some code that is reactive” Let the language figure out which variables/fields are involved Let the language worry about updating the right things The code is called a constraint

What would this look like?

newCons Operator Defines both code and what reacts to said code var a in a := 0; newCons { output a // `a` is reactive }; while (a < 10) { a := a + 1 // trigger `output` } Output:

More Interesting Example sanitize.not

Implementation From a high level, how might we implement this in the interpreter? var a in a := 0; newCons { output a // `a` is reactive }; while (a < 10) { a := a + 1 // trigger `output` } Output:

Basic Semantics Execute code in what newCons delimits Mark addresses used inside what newCons delimits as reactive When these are changed outside of the same newCons, trigger the delimited code (a.k.a, the constraint)

Questions Is this enough detail to implement newCons ? Is this enough detail to use newCons ?

Cyclical Constraints var a in a := 0; newCons { a := a + 1; output a }; a := 3 Output: 1 4

Multiple Constraints var a in a := 3; newCons { output a }; newCons { a := a + 1 }; a := 5 Output: 3 4 6

Nested Constraints var a, b in a := 4; b := ""; newCons { output a; newCons { output b }; b := b + "b" }; a := 5; b := "t" Output: 4 > b 5 b bb 5 t tb

newCons with Objects var obj in obj := {“foo”: 1, “bar”: 2}; newCons { output obj.foo }; obj.foo := 10; obj.bar := 20 What does this output? Output: 1 10

These Slides Don’t Cover... The atomic block Different execution modes Specifically how to implement in miniJS