CSE341: Programming Languages Lecture 7.5 Course Motivation. Dan Grossman Fall 2011



Similar documents
CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages. Nicki Dell Spring 2014

Programming Languages

CSE 307: Principles of Programming Languages

Lecture 1: Introduction

opalang - Rapid & Secure Web Development

CSE 130 Programming Language Principles & Paradigms

TOWARDS A GREEN PROGRAMMING PARADIGM FOR MOBILE SOFTWARE DEVELOPMENT

What is a programming language?

Programming Language Concepts for Software Developers

Functional Programming. Functional Programming Languages. Chapter 14. Introduction

Programming Language Pragmatics

Chapter 15 Functional Programming Languages

Busy Java Developer's Guide to Functional Programming. Ted Neward Neward & Associates

Functional Programming

The Decaffeinated Robot

1/20/2016 INTRODUCTION

CS 40 Computing for the Web

Chapter 12 Programming Concepts and Languages

Chapter 13 Computer Programs and Programming Languages. Discovering Computers Your Interactive Guide to the Digital World

CSCE 314 Programming Languages

On the (un)suitability of Java to be the first programming language

Rakudo Perl 6 on the JVM. Jonathan Worthington

Java (12 Weeks) Introduction to Java Programming Language

Lecture 10 - Functional programming: Hadoop and MapReduce

Comparing Dynamic and Static Language Approaches to Web Frameworks

MEAP Edition Manning Early Access Program Nim in Action Version 1

CS 51 Intro to CS. Art Lee. September 2, 2014

Realization of Inventory Databases and Object-Relational Mapping for the Common Information Model

Experience Report: Haskell in the Real World WritingaCommercialApplication in alazy Functional Language

Course MS10975A Introduction to Programming. Length: 5 Days

Chapter 13: Program Development and Programming Languages

A Performance Evaluation of Open Source Graph Databases. Robert McColl David Ediger Jason Poovey Dan Campbell David A. Bader

Chapter 1. Dr. Chris Irwin Davis Phone: (972) Office: ECSS CS-4337 Organization of Programming Languages

Language Evaluation Criteria. Evaluation Criteria: Readability. Evaluation Criteria: Writability. ICOM 4036 Programming Languages

MEng, BSc Applied Computer Science

The C Programming Language course syllabus associate level

Programming and Software Development CTAG Alignments

MEng, BSc Computer Science with Artificial Intelligence

Course Goal CMSC 330: Organization of Programming Languages. Studying Programming Languages. All Languages Are (Kind of) Equivalent.

Overview. Elements of Programming Languages. Advanced constructs. Motivating inner class example

The programming language C. sws1 1

Android Application Development Course Program

Division of Mathematical Sciences

Introduction to Software Paradigms & Procedural Programming Paradigm

How To Get A Computer Science Degree

Datavetenskapligt Program (kandidat) Computer Science Programme (master)

Advanced compiler construction. General course information. Teacher & assistant. Course goals. Evaluation. Grading scheme. Michel Schinz

Java 6 'th. Concepts INTERNATIONAL STUDENT VERSION. edition

by Pearson Education, Inc. All Rights Reserved.

White Paper. Java versus Ruby Frameworks in Practice STATE OF THE ART SOFTWARE DEVELOPMENT 1

Habanero Extreme Scale Software Research Project

Masters in Human Computer Interaction

ML for the Working Programmer

C# and Other Languages

1 Introduction. 2 An Interpreter. 2.1 Handling Source Code

On Language Support for Application Scalability

Masters in Computing and Information Technology

Masters in Networks and Distributed Systems

HIGH PERFORMANCE BIG DATA ANALYTICS

Chapter 7: Functional Programming Languages

Semester Review. CSC 301, Fall 2015

Announcements FORTRAN ALGOL COBOL. Simula & Smalltalk. Programming Languages

Programming Languages CIS 443

Based on: Google searches for language tutorials

Levels of Programming Languages. Gerald Penn CSC 324

Functional Programming in C++11

Stop being Rails developer

Web 2.0 Technology Overview. Lecture 8 GSL Peru 2014

Profitable vs. Profit-Draining Local Business Websites

Unit 8: Immutability & Actors

GUI and Web Programming

Concepts of Programming Languages: A Unified Approach. Karl Abrahamson

The Clean programming language. Group 25, Jingui Li, Daren Tuzi

CSCI 3136 Principles of Programming Languages

Invitation to Ezhil : A Tamil Programming Language for Early Computer-Science Education 07/10/13

6.088 Intro to C/C++ Day 4: Object-oriented programming in C++ Eunsuk Kang and Jean Yang

THE ROLE OF PROGRAMMING PARADIGMS IN THE FIRST PROGRAMMING COURSES. 1. Introduction

How To Develop Software

PHP Debugging. Draft: March 19, Christopher Vickery

Dart a modern web language

Java EE Web Development Course Program

Big Data Storage, Management and challenges. Ahmed Ali-Eldin

Interactive Proof Documents

The Rules 1. One level of indentation per method 2. Don t use the ELSE keyword 3. Wrap all primitives and Strings

1.1 WHAT IS A PROGRAMMING LANGUAGE?

Monitis Project Proposals for AUA. September 2014, Yerevan, Armenia

Availability of the Program A free version is available of each (see individual programs for links).

Fundamentals of Programming Languages

Java SE 7 Programming

Chapter 13: Program Development and Programming Languages

COMPARISON OF OBJECT-ORIENTED AND PROCEDURE-BASED COMPUTER LANGUAGES: CASE STUDY OF C++ PROGRAMMING

Object-Oriented Software Specification in Programming Language Design and Implementation

Masters in Human Computer Interaction

Igniting young minds through computer programming

The Needle Programming Language

Whitepapers at Amikelive.com

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

Java SE 8 Programming

Project Group Applied Functional Programming

Transcription:

CSE341: Programming Languages Lecture 7.5 Course Motivation Dan Grossman Fall 2011

Course Motivation (Did you think I forgot? ) Why learn languages that are quite different from Java, C, C++? Why learn the fundamental concepts that appear in all (most?) languages? Why focus on functional programming? 2

What is the best kind of car? What is the best kind of shoes? 3

Cars / Shoes Cars are used for rather different things: Winning the INDY 500 Taking kids to soccer practice Off-roading Hauling a mattress Getting the wind in your hair Staying dry in the rain Shoes: Playing basketball Going to a formal Going to the beach 4

More on cars A good mechanic might have a specialty, but also understands how cars (not 2004 Honda Civics) work And that the syntax, I mean upholstery color, isn t essential A good mechanical engineer really knows how cars work, how to get the most out of them, and how to design better ones To learn how cars work, it may make sense to start with a classic design rather than the latest model A popular car may not be a good car for learning how cars work 5

All cars are the same To make it easier to rent cars, it s great that they all have steering wheels, brakes, windows, headlights, etc. Yet it s still uncomfortable to learn a new one And maybe PLs are more like cars, trucks, boats, and bikes So are all PLs really the same 6

Are all languages the same? Yes: Yes: No: Any input-output behavior implementable in language X is implementable in language Y [Church-Turing thesis, CSE431] Java, ML, and a language with one loop and three infinitelylarge integers are the same Beware the Turing tarpit Same fundamentals reappear: variables, abstraction, one-of types, recursive definitions, The human condition vs. different cultures (travel to learn more about home) The primitive/default in one language is awkward in another 7

A note on reality Reasonable questions when deciding to use/learn a language: What libraries are available for reuse? What can get me a summer internship? What does my boss tell me to do? What is the de facto industry standard? What do I already know? CSE341 by design does not deal with these questions You have the rest of your life for that And technology leaders affect the answers 8

Why semantics and idioms This course focuses as much as it can on semantics and idioms Correct reasoning about programs, interfaces, and compilers requires a precise knowledge of semantics Not I feel that conditional expressions might work like this Not I like curly braces more than parentheses Much of software development is designing precise interfaces; what a PL means is a really good example Idioms make you a better programmer Best to see in multiple settings, including where they shine See Java in a clearer light even if I never show you Java 9

Hamlet The play Hamlet: Is a beautiful work of art Teaches deep, eternal truths Is the source of some well-known sayings Makes you a better person Continues to be studied (even in college) centuries later even though: The syntax is really annoying to many (yet rhythmic) There are more popular movies with some of the same lessons (just not done as well) Reading Hamlet will not get you a summer internship 10

Functional Programming Okay, so why 70-80% of course with functional languages, i.e., languages where: Mutation is discouraged One-of types via constructs like datatypes Higher-order functions are very convenient Because: 1. These features are invaluable for correct, elegant, efficient software (great way to think about computation) 2. Functional languages have always been ahead of their time 3. Functional languages well-suited to where computing is going Most of course is on (1), so a few minutes on (2) and (3) 11

Ahead of their time All of these were dismissed as beautiful, worthless, slow things PL professors make you learn in school Garbage collection (Java didn t exist in 1995, CSE341 did) Generics (List<T> in Java, C#), much more like SML than C++ XML for universal data representation (like Racket/Scheme/LISP) Higher-order functions (Ruby, Javascript, C#, ) Type inference (C#) Recursion (a big fight in 1960 about this I m told ) Somehow nobody notices we are right (20 years later) Maybe pattern-matching, currying, hygienic macros, etc. will be next To conquer vs. to assimilate 12

Recent Surge Microsoft: F#, C# 3.0, LINQ Scala (Twitter, LinkedIn, FourSquare) Java 8 (?), C++ (?) MapReduce / Hadoop (everybody) Avoiding side-effects essential for fault-tolerance here Haskell (dozens of small companies/teams) Erlang (distributed systems, Facebook chat) Ocaml (JaneStreet) Honestly, SML and its implementations are showing their age, but Ocaml and F# are very similar and other functional languages also much easier to learn 13

Why a surge? My best guesses: Concise, elegant, productive programming Javascript, Python, Ruby helped break the Java/C/C++ hegemony And these functional languages do some things better Avoiding mutation is the easiest way to make concurrent and parallel programming easier Sure, functional programming is still a small niche, but there is so much software in the world today even niches have room See separate list of links to where is functional used on the course web page 14

Is this real programming? The way we use ML/Racket/Ruby in 341 can make them seem almost silly precisely because lecture and homework focus on interesting language constructs Real programming needs file I/O, string operations, floatingpoint, graphics, project managers, testing frameworks, threads, build systems, Functional languages have all that and more If we used Java the same way in CSE341, Java would seem silly too 15

The languages together Why SML, Racket, and Ruby are a useful combination for us dynamically typed statically typed functional Racket SML object-oriented Ruby Java ML: polymorphic types, pattern-matching, abstract types & modules Racket: dynamic typing, good macros, minimalist syntax, eval Ruby: classes but not types, very OOP, mixins [and much more] Really wish we had more time: Haskell: laziness, purity, type classes, monads Prolog: unification and backtracking [and much more] 16

Summary No such thing as a best PL There are good general design principles for PLs A good language is a relevant, crisp interface for writing software Software leaders should know PL semantics and idioms Learning PLs is not about syntactic tricks for small programs Functional languages have been on the leading edge for decades Ideas get absorbed by the mainstream, but very slowly Meanwhile, use the ideas to be a better C/Java/PHP hacker 17