Lecture 17 Programming Languages (S&G, ch. 8)

Slides:



Advertisements
Similar presentations
The TeachScheme! Project Adelphi University Brown University Northeastern University University of Chicago University of Utah Worcester Polytechnic Institute.
Advertisements

Expressions and Statements. 2 Contents Side effects: expressions and statements Expression notations Expression evaluation orders Conditional statements.
1 Programming Languages (CS 550) Lecture Summary Functional Programming and Operational Semantics for Scheme Jeremy R. Johnson.
Programming Languages WHY MORE? Wasn’t ONE ENOUGH? Introduction to CS260.
Learning computer networks in an international, distributed course Anders Berglund Information Technology Uppsala University Uppsala Sweden.
C Lecture Notes 1 Program Control (Cont...). C Lecture Notes 2 4.8The do / while Repetition Structure The do / while repetition structure –Similar to.
Chapter 6: User-Defined Functions I
COMP205 Comparative Programming Languages Part 1: Introduction to programming languages Lecture 3: Managing and reducing complexity, program processing.
Abstract data types What does ‘ abstract ’ mean? From Latin: to ‘ pull out ’— the essentials –To defer or hide the details –Abstraction emphasizes essentials.
1 CS101 Introduction to Computing Lecture 19 Programming Languages.
C++ Basics CSci 107. A C++ program //include headers; these are modules that include functions that you may use in your //program; we will almost always.
A First Program Using C#
1 Software Development Topic 2 Software Development Languages and Environments.
CS101 Introduction to Computing Lecture Programming Languages.
Lecture 2 Object Oriented Programming Basics of Java Language MBY.
Stephen P. Carl - CS 2421 Recursion Reading : Chapter 4.
Chapter 13 Programming in the Large Dr. Jiung-yao Huang Dept. Comm. Eng. Nat. Chung Cheng Univ. TA: 鄭筱親 陳昱豪.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
C++ Lecture 1 Friday, 4 July History of C++ l Built on top of C l C was developed in early 70s from B and BCPL l Object oriented programming paradigm.
Languages and Compilers
Functions Math library functions Function definition Function invocation Argument passing Scope of an variable Programming 1 DCT 1033.
1 CSC103: Introduction to Computer and Programming Lecture No 16.
CSE202: Lecture 5The Ohio State University1 Selection Structures.
Introduction to Computer Programming using Fortran 77.
CS Class 04 Topics  Selection statement – IF  Expressions  More practice writing simple C++ programs Announcements  Read pages for next.
Announcements Assignment 2 Out Today Quiz today - so I need to shut up at 4:25 1.
CSE 501N Fall ‘09 03: Class Members 03 September 2009 Nick Leidenfrost.
Expressions and Assignment Statements
Functional Programming
Expressions and Assignment Statements
Basic concepts of C++ Presented by Prof. Satyajit De
Programming what is C++
Chapter 6: User-Defined Functions I
tautology checking continued
Expressions and Assignment Statements
Key Ideas from day 1 slides
Chapter 8 – Software Testing
Representation, Syntax, Paradigms, Types
CS 326 Programming Languages, Concepts and Implementation
CS101 Introduction to Computing Lecture 19 Programming Languages
Lecture 3 of Computer Science II
Array.
User-Defined Functions
CS 240 – Lecture 11 Pseudocode.
Design by Contract Fall 2016 Version.
Phil Tayco Slide version 1.0 Created Oct 2, 2017
Expressions and Assignment Statements
Mini Language Interpreter Programming Languages (CS 550)
Chapter 4: Types.
Control Flow Chapter 6.
Objective of This Course
Chapter 6 Intermediate-Code Generation
The Metacircular Evaluator
Introduction to Computer Programming
Representation, Syntax, Paradigms, Types
Dr. Bhargavi Dept of CS CHRIST
Representation, Syntax, Paradigms, Types
Expression and Asignment Statements
Streams, Delayed Evaluation and a Normal Order Interpreter
Chapter 6: User-Defined Functions I
Lecture 28 Social & Legal Issues (S&G, ch. 14)
6.001 SICP Variations on a Scheme
Experimental Design: The Basic Building Blocks
RESEARCH BASICS What is research?.
Understand the interaction between computer hardware and software
Representation, Syntax, Paradigms, Types
Chapter 7: Expressions and Assignment Statements Sangho Ha
C++ Basics CSci 107. A C++ program //include headers; these are modules that include functions that you may use in your //program; we will almost always.
Expressions and Assignment Statements
Chapter Ten: Designing, Conducting, Analyzing, and Interpreting Experiments with Two Groups The Psychologist as Detective, 4e by Smith/Davis.
Presentation transcript:

Lecture 17 Programming Languages (S&G, ch. 8) 5/27/2019 CS 100 - Lecture 17 CS 100

Read S&G ch. 9 (Compilers and Language Translation) 5/27/2019 CS 100 - Lecture 17

The Phenomenology of Tools 5/27/2019 CS 100 - Lecture 17

Phenomenology A philosophical method A phenomenon is some aspect of concrete human experience of the world Phenomenology investigates the invariant structure of some phenomenon by systematic variation of that experience Has its own technical terminology 5/27/2019 CS 100 - Lecture 17

Phenomenology of Tools The phenomena of concern are tools in the broadest sense Developed by Don Ihde Here we are concerned with tools related to computers: computers themselves programming languages word processors email etc. 5/27/2019 CS 100 - Lecture 17

Tools are Ampliative & Reductive Example: using stick to knock down fruit Ampliative aspects Greater power or performance Extended experience Reductive aspects Experience is less immediate Action is channeled by the tool 5/27/2019 CS 100 - Lecture 17

Examples Consider ampliative & reductive aspects of: eye glasses automobiles telephones email recorded music internet word processor 5/27/2019 CS 100 - Lecture 17

Utopians vs. Dystopians Technological utopians: focus on ampliative aspects emphasize practical advantages Technological dystopians: focus on reductive aspects discount practical advantages Both attitudes are reduced focuses Better: acknowledge essential ambivalence of our experience of the tool “all technology is non-neutral” — Ihde 5/27/2019 CS 100 - Lecture 17

Phenomenology of Programming Languages Ampliative aspect: automation of tedious, error-prone activities error checking Reductive aspect: loss of direct control of machine resources possible inefficiency 5/27/2019 CS 100 - Lecture 17

“Fascination” & “Fear” Lecture 17 5/27/2019 9:03 AM “Fascination” & “Fear” Typical responses to a new technology Utopians are fascinated by ampliative aspects embrace & promote the new technology tend to over-apply the new technology inclined to further amplification Dystopians fear reductive aspects may view ampliative aspects as dangerous ambivalent feelings of power or helplessness Greater familiarity  balanced understanding of benefits & limitations The root meaning of “fascinate” is “to enchant or bewitch” 5/27/2019 CS 100 - Lecture 17 CS 100

Mastery & Embodiment Tool replaces immediate (direct) with mediated (indirect) experience When tool is mastered, its mediation becomes transparent (not invisible) Contrast: bad tool or unskillful use  experienced as object, relate to it good tool & mastery  partially embodied, relate through it With mastery, objectification becomes embodiment 5/27/2019 CS 100 - Lecture 17

Focus & Action Example: three writing technologies dip pen electric typewriter word processor Tools influence focus: makes some aspects of situation salient, hides others Tools influence action: makes some actions easy, others awkward Tools subtly influence what we notice and do 5/27/2019 CS 100 - Lecture 17

Cultural Embedding All technologies are culturally embedded Our reactions to them are influenced by: personal backgrounds collective background Stylistic inclinations may vary from user to user 5/27/2019 CS 100 - Lecture 17

Conclusions The phenomenology of tools helps us to: understand people’s experience to tools move beyond our own limited perspectives understand social consequences of tools exercise informed choice about adopting new technologies design better tools understand tool’s effect on focus & action “All technology in non-neutral” 5/27/2019 CS 100 - Lecture 17

Functional Programming 5/27/2019 CS 100 - Lecture 17

Definition In functional programming, all programs are mathematical functions: The arguments of the function are the inputs to the program The computed value of the function is the only output from the program There are no side-effects The assignment statement is not used! 5/27/2019 CS 100 - Lecture 17

Functions vs. Procedures with Side-Effects result arguments functional program: procedure output inputs procedural program: X Side-effects are hidden interfaces to a program side-effects 5/27/2019 CS 100 - Lecture 17

Scheme & LISP Syntax ( <function> <argument 1> <argument 2> … ) like a verb like the objects of the verb 5/27/2019 CS 100 - Lecture 17

Examples (log 2) — compute the logarithm of 2 and return it (* 2 x) — compute the product of 2 and x (list 3 4 5) — make a list out of the numbers 3, 4, and 5 (define (double x) (* 2 x)) — define a function with the header “(double x)” and the body “(* 2 x)” (double 4) — apply the user-defined function double to 4 5/27/2019 CS 100 - Lecture 17

Conditional Functions (if <condition> <value if true> <value if false> ) (cond ( <condition 1> <value if cond 1 true> ) ( <condition 2> <value if cond 2 true> ) … ( else <value if all conds false> ) ) 5/27/2019 CS 100 - Lecture 17

Run DrScheme 5/27/2019 CS 100 - Lecture 17