Squeak, Newsqueak, Obliq PL Seminar 10/24/2007. Of mice and menus Cardelli and Pike ’85: Squeak: a language for communicating with mice Proof-of-concept.

Slides:



Advertisements
Similar presentations
Design and Implementation Issues for Atomicity Dan Grossman University of Washington Workshop on Declarative Programming Languages for Multicore Architectures.
Advertisements

MPI Message Passing Interface
Programming in Occam-pi: A Tutorial By: Zain-ul-Abdin
MINJAE HWANG THAWAN KOOBURAT CS758 CLASS PROJECT FALL 2009 Extending Task-based Programming Model beyond Shared-memory Systems.
CS 267: Automated Verification Lecture 8: Automata Theoretic Model Checking Instructor: Tevfik Bultan.
JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
Semantic Analysis Chapter 6. Two Flavors  Static (done during compile time) –C –Ada  Dynamic (done during run time) –LISP –Smalltalk  Optimization.
A Program Transformation For Faster Goal-Directed Search Akash Lal, Shaz Qadeer Microsoft Research.
Programming Languages and Paradigms
Control-Flow Graphs & Dataflow Analysis CS153: Compilers Greg Morrisett.
IBM’s X10 Presentation by Isaac Dooley CS498LVK Spring 2006.
Concurrency Important and difficult (Ada slides copied from Ed Schonberg)
1 textual notations grammars production rules CSP and event algebras.
Ch. 7 Process Synchronization (1/2) I Background F Producer - Consumer process :  Compiler, Assembler, Loader, · · · · · · F Bounded buffer.
Timed Automata.
Chapter 5 ( ) of Programming Languages by Ravi Sethi
CS 4800 By Brandon Andrews.  Specifications  Goals  Applications  Design Steps  Testing.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
Avishai Wool lecture Introduction to Systems Programming Lecture 4 Inter-Process / Inter-Thread Communication.
Concurrency CS 510: Programming Languages David Walker.
Guide To UNIX Using Linux Third Edition
User-Level Interprocess Communication for Shared Memory Multiprocessors Brian N. Bershad, Thomas E. Anderson, Edward D. Lazowska, and Henry M. Levy Presented.
Erich Laube Presentation based on A Language with Distributed Scope by Luca Cardelli.
Mobile Ambients Luca Cardelli Digital Equipment Corporation, Systems Research Center Andrew D. Gordon University of Cambridge, Computer Laboratory Presented.
Programming Languages for Mobile Code Anna Philippou University of Pennsylvania.
Fundamentals of Python: From First Programs Through Data Structures
PARALLEL PROGRAMMING ABSTRACTIONS 6/16/2010 Parallel Programming Abstractions 1.
JavaScript Demo Presented by … Jaisingh Sumit jain Sudhindra Taran Deep arora.
U NIVERSITY OF M ASSACHUSETTS, A MHERST Department of Computer Science Parallel & Concurrent Programming: Occam Vitaliy Lvin University of Massachusetts.
A Bridge to Your First Computer Science Course Prof. H.E. Dunsmore Concurrent Programming Threads Synchronization.
1 Forms A form is the usual way that information is gotten from a browser to a server –HTML has tags to create a collection of objects that implement this.
ICOM 5995: Performance Instrumentation and Visualization for High Performance Computer Systems Lecture 7 October 16, 2002 Nayda G. Santiago.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
June 6 th – 8 th 2005 Deployment Tool Set Synergy 2005.
Bindings and scope  Bindings and environments  Scope and block structure  Declarations Programming Languages 3 © 2012 David A Watt, University.
Using Client-Side Scripts to Enhance Web Applications 1.
CSC 580 – Theory of Programming Languages, Spring, 2009 Week 9: Functional Languages ML and Haskell, Dr. Dale E. Parson.
Slide: 1 Copyright © AdaCore Subprograms Presented by Quentin Ochem university.adacore.com.
Programming Paradigms for Concurrency Pavol Cerny Vasu Singh Thomas Wies Part III – Message Passing Concurrency.
8 1 Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Writing Systems Software in a Functional Language An Experience Report Iavor Diatchki, Thomas Hallgren, Mark Jones, Rebekah Leslie, Andrew Tolmach.
Internet Security CSCE 813 Communicating Sequential Processes.
Syntax and Semantics, and the Program Development Process ROBERT REAVES.
Lecture 8 Page 1 CS 111 Online Other Important Synchronization Primitives Semaphores Mutexes Monitors.
Runtime Organization (Chapter 6) 1 Course Overview PART I: overview material 1Introduction 2Language processors (tombstone diagrams, bootstrapping) 3Architecture.
Chapter 8 Advanced SQL Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Sep/05/2001PaCT Fusion of Concurrent Invocations of Exclusive Methods Yoshihiro Oyama (Japan Science and Technology Corporation, working in University.
Fortress Aaron Becker Abhinav Bhatele Hassan Jafri 2 May 2006.
Concurrency Properties. Correctness In sequential programs, rerunning a program with the same input will always give the same result, so it makes sense.
Fall 2008Programming Development Techniques 1 Topic 20 Concurrency Section 3.4.
Computer Science Lecture 3, page 1 CS677: Distributed OS Last Class: Communication in Distributed Systems Structured or unstructured? Addressing? Blocking/non-blocking?
Functional Programming IN NON-FUNCTIONAL LANGUAGES.
3/12/2013Computer Engg, IIT(BHU)1 OpenMP-1. OpenMP is a portable, multiprocessing API for shared memory computers OpenMP is not a “language” Instead,
CPE779: Shared Memory and OpenMP Based on slides by Laxmikant V. Kale and David Padua of the University of Illinois.
1 CSC 533: Programming Languages Spring 2014 Subprogram implementation  subprograms (procedures/functions/subroutines)  subprogram linkage  parameter.
Chapter 10 Chapter 10 Implementing Subprograms. Implementing Subprograms  The subprogram call and return operations are together called subprogram linkage.
Computer Programming – Grammar – data types – Variables – Keywords – Operators – decision making – Loops – Arrays – Functions – files Programming Environment.
JavaScript Tutorial First lecture 19/2/2016. Javascript is a dynamic computer programming language. It is lightweight and most commonly used as a part.
CSI 3125, Data Types, page 1 Data types Outline Primitive data types Structured data types Strings Enumerated types Arrays Records Pointers Reading assignment.
Auburn University COMP 3500 Introduction to Operating Systems Project 3 – Synchronization Cats and Mice: Implementation.
Concurrency 2 CS 2110 – Spring 2016.
“Language Mechanism for Synchronization”
Computer Engg, IIT(BHU)
CSC 533: Programming Languages Spring 2015
Continuations and Compilation
CSE 153 Design of Operating Systems Winter 19
Recursive Procedures and Scopes
CSC 533: Programming Languages Spring 2018
CSC 533: Programming Languages Spring 2019
Threads and concurrency / Safety
Presentation transcript:

Squeak, Newsqueak, Obliq PL Seminar 10/24/2007

Of mice and menus Cardelli and Pike ’85: Squeak: a language for communicating with mice Proof-of-concept embedded DSL for UI’s Compiles to C (single OS process) Semantics: pure, CSP, tail-recursive

Some combinators Send, receive: c!v, c?v Non-deterministic choice: p :: p Sequential composition: p. p Parallel composition: p & p Timeout: wait[e] p || p Escape to C: { C expression }

Pre-defined channels Mouse clicks: UP, DN Mouse cursor: M Enter/leave mouse region: E, L Keyboard input: K Absolute time: T

Example: display typing on clicks proc Mouse = DN?. M?p. moveTo!p. UP?. Mouse proc Kbd(s) = K?c. if c == NewLine then typed!s. Kbd(emptyString) else Kbd(append(s,c)) fi proc Text(p) = < moveTo?p. Text(p) :: typed?s. { drawString(s,p) }?. Text(p) > type = Mouse & Kbd(emptyString) & Text(nullPt)

Restrictions Fixed set of channels Fixed set of processes No real datatypes; all data manipulation in C

Check list Concurrency: yes Shared memory: no Parallelism: no Distributed computation: no

Journey to the C side Pike ’90: The implementation of Newsqueak Pike ’94: Newsqueak: a language for communicating with mice Intended for full GUI applications (in particular: window system) Semantics: CSP, higher-order(-ish), impure, no references!, tail-recursive

Semantics C-like types (safety? unclear) Dynamic creation of processes ( begin ), channels ( mk ) Ints, bools, chars, records, arrays First-class functions—no closures Mutable data but copying semantics!

Performance model Meticulously optimized driver loop Reference counting Copy-on-write Tail-recursive return ( become )

Closure conversion on spawn f := prog() { a:int; begin prog(){ a=1; }(); }

Closure conversion on spawn f := prog() { a:int; begin prog(a:int){ a=1; }(a); }

Check list Concurrency: yes Shared memory: no Parallelism: no Distributed computation: no

Obliq: distributed lexical scope Cardelli ’95: Obliq: a language with distributed scope Target applications: “Distributed scripting”— telecollaboration, telemarketing, navigation Semantics: local mutable objects but roaming closures, threads and locks

Distributed lexical scope Objects and variables are mutable Objects never migrate; passed by reference Migrated references become network references Cloning is possible; always explicit Closures can migrate, too Free variables become network references

Example: computation server (* Site A *) var q = proc() end; net_export("computeServer", Namer, { rexec => meth(self, p) q := p; p() end }); q; q(); (* Site B *) let cs = net_import("computeServer", Namer); var x = 3; cs.rexec(proc() x := x+1 end); x; is now 4 is now 5 is now proc() x := x+1 end

Agents Distributed programming idiom Migrate both state (“suitcase”) and computation (continuation) Receive local information (“briefing”) upon migrating to new site

Agents let rec agent = proc(suitcase, briefing) (* work at the current site *) (* decide where to go next *)... (* run agent at nextSite with suitcase *) hop(nextSite, agent, suitcase); end;

Agents let hop = proc(agentServer, agent, suitcase) agentServer( proc(briefing) fork(proc() agent(copy(suitcase), briefing); end); ok end); end;

Shared memory Mutable state is completely unprotected Keyword protected makes object externally uncloneable, immutable Keyword serialized makes object operations externally atomic Modula-3 mutexes, locks, conditions

Check list Concurrency: yes Shared memory: yes Parallelism: yes Distributed computation: yes

Summary Concurrent resources as channels Copying mutable data probably shouldn’t be implicit (that is so weird) By-reference semantics can extend to distributed setting as network references Not much insight here for dealing with shared memory