Programming Languages WHY MORE? Wasn’t ONE ENOUGH? Introduction to CS260.

Slides:



Advertisements
Similar presentations
Copyright © 1998 by Addison Wesley Longman, Inc. 1 Chapter One Preliminaries, including –Why study PL concepts? –Programming domains –PL evaluation criteria.
Advertisements

Chapter 1: Preliminaries
PLLab, NTHU Cs2403 Programming Languages Implementation Issues Cs2403 Programming Language Spring 2005 Kun-Yuan Hsieh.
CS 354 Overview. Addison-Wesley –2 Course Topics What is a programming language? What features do programming languages have? How are these features.
Reasons to study concepts of PL
ISBN Chapter 1 Preliminaries. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.1-2 Chapter 1 Topics Motivation Programming Domains.
CS 354 Overview. Copyright © 2007 Addison-Wesley. All rights reserved. 1–2 Course Topics What is a programming language? What features do programming.
1 Programming Languages b Each type of CPU has its own specific machine language b But, writing programs in machine languages is cumbersome (too detailed)
Programming Languages Structure
ISBN Lecture 01 Preliminaries. Copyright © 2004 Pearson Addison-Wesley. All rights reserved.1-2 Lecture 01 Topics Motivation Programming.
Summer 02-03Programming Language Concepts1 Programming Language Concepts (CS 360) Lecture 1: Overview, Grammars, and Little Languages Jeremy R. Johnson.
ISBN Chapter 1 Topics Motivation Programming Domains Language Evaluation Criteria Influences on Language Design Language Categories Language.
CS 104 Introduction to Computer Science and Graphics Problems Software and Programming Language (2) Programming Languages 09/26/2008 Yang Song (Prepared.
Copyright © 1998 by Addison Wesley Longman, Inc. 1 Concepts of Programming Languages Chapter 1.
ISBN Chapter 1 Preliminaries. Copyright © 2007 Addison-Wesley. All rights reserved.1-2 Chapter 1 Topics Reasons for Studying Concepts of.
Programming Language Concepts
1 Programming Languages Marjan Sirjani 2 1- The Study of Programming Languages The purpose of language is simply that it must convey meaning. (Confucius)
PROGRAMMING LANGUAGES The Study of Programming Languages.
Overview. Copyright © 2006 The McGraw-Hill Companies, Inc. Chapter 1 Overview A good programming language is a conceptual universe for thinking about.
CS 355 – Programming Languages
(1.1) COEN 171 Programming Languages Winter 2000 Ron Danielson.
CS 363 Comparative Programming Languages
CS 330 Programming Languages 09 / 04 / 2008 Instructor: Michael Eckmann.
Chapter 1 Preliminaries CS Concepts of Programming Languages.
Programming Languages Summer
1 Programming Languages Marjan Sirjani Course web site:
1 Introduction Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Sections
Copyright © 2006 Addison-Wesley. All rights reserved.1-1 ICS 410: Programming Languages.
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
ICS 313 Fundamentals of Programming Languages Instructor: Abdul Wahid Wali Lecturer, CSSE, UoH
Programming Languages Design Considerations (Qualities) Readability –Simplicity and Clarity –Orthogonality –Control Statements –Data Types and Structures.
ISBN CS 354 Preliminaries. Copyright © 2006 Addison-Wesley. All rights reserved.1-2 Course Topics What is a programming language? What features.
ISBN Chapter 1 Preliminaries. Copyright © 2009 Addison-Wesley. All rights reserved.1-2 Chapter 1 Topics Reasons for Studying Concepts of.
Programming Domains 1.Scientific Applications Typically, scientific applications have simple data structures but require large numbers of floating-point.
Engr. Isabelo Jun D. Paat, ME-CoE Lecturer 1 Programming Languages.
Chapter 1: Preliminaries Lecture # 2. Chapter 1: Preliminaries Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation.
Concepts of Programming Languages
Why study programming languages?
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
PROGRAMMING LANGUAGES
Chapter 1 Reasons to study concepts of PLs Programming Domains
1.1 Reasons to study concepts of PLs
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
CS 3304 Comparative Languages Fall 2011
Chapter 1 Introduction.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminary. Chapter 1 Preliminary 1.1 Reasons for Studying Concepts of Programming Languages Increased capacity to express ideas Improved.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Programming Language Basics
Chapter 1 Preliminaries.
강의 내용 및 방법 접근방법 리포트 시험 Lambda Calculus, Proof of Correctness
Chapter 1 Topics Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation Criteria Influences on Language Design.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Programming Languages, Preliminaries, History & Evolution
Reasons To Study Programming Languages
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Chapter 1 Preliminaries.
Presentation transcript:

Programming Languages WHY MORE? Wasn’t ONE ENOUGH? Introduction to CS260

Cart before the horse Before contrasting(text), get a feel for how languages are similar But as author does -> You need to think of programming on a different level You know how to implement algorithms Now learn to do it better In order to assess whether you have the best approach, you need to understand consequences of your choices

Does your approach take too long or too much memory? Is your approach easy to understand? Readable? Is it prone to errors Is your program reasonably extendable or have you programmed yourself into a corner? How can you possibly judge?

It’s a little early Your understanding of these concepts will become clearer with time and experience Understanding examples from other languages to illustrate a point is basically premature Start slowly First look for similarities in languages and then differences Develop a vocabulary for language issues

Similarities Learning new languages is not as difficult as it appears Many of the languages are similar to c/c++ This leverages you into a position of immediate knowledge of other languages Knowing how to categorize differences leads you to know lots of other information E.g. knowing the sex of a person leads you to be able to reach a number of other conclusions -> physical, emotional, etc

Major categories Representation of data Flow of control –expression –statement –procedure Interpreted vs compiled Scope of access to data and procedures Information hiding

Influence of language Try to think of any concept or idea without the use of words / language LANGUAGE shapes the way you think Greek language has a number of different words for different types of love. English tries to use the same word in different contexts. We struggle to differentiate the types of love. Programming language dictates our solution

Language influence Language User Interfaces OS Applications Architectural Features Methodologies design tcl create use create design utilize Provide access to

Applications are Interaction of Data Operations Language understanding begins by examining these areas!

Data Simple data types Aggregate data types User/Programmer extendable types System supplied and hardware supplied

Operations Expression level Statement level Procedural level Process level

Binding times Many of the features are characterized by when the feature can change E.g. consider allocation and initialization of a simple data type –compilation –beginning of execution –entry into procedure –entry into a code block

Scope How do you determine access to data –minimization is good Access to procedures –should you have access to all functions and all versions

Languages specialize Business -> COBOl Scientific -> FORTRAN Systems (OS) -> C General Purpose -> C/C++/Ada/java Internet -> java Scripting -> shell Artificial Intelligence -> Lisp/Prolog

Languages have tradeoffs Readability ( Simplicity ) vs Power ( Functionality ) Too little orthogonality (features dependent on other features - too many exceptions) vs too much orthogonality (independence creates too many possibilities and increased complexity) –c allows functions to return structs but not arrays (little) –allowing complicated expressions which evaluate to allocation on LHS of assignment is unreasonable e.g. (&c)+23=y+z

Syntax rules promoting readability may create programs more cumbersome to write –generally we accept the short-term inconvenience –Aside (syntax/form vs semantics/meaning) for statement Size of language vs cost of support tools Reliability vs cost/speed of execution Flexibility vs complexity/cost/safety Our most important concern is COST Many poor decisions are a result of not considering real costs!

Compiled vs interpreted Compiled –translate entire program into machine language –execute Interpret –translate piece –execute –repeat –more flexibility (e.g. changing data type)

Environments Development/testing environments influence our choices visual vs command line debugging aids compiler error assistance

Most important factors Machine architecture –von Neumann –in the end you have to implement what you design Methodology –modular –structured (top-down design) –object oriented

Time makes languages a melting pot of all good in other languages Java like c like pascal like algol like fortran … All embrace procedures/parameters/objects/etc Fundamentally different approaches become fewer