Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 330 Programming Languages 09 / 04 / 2008 Instructor: Michael Eckmann.

Similar presentations


Presentation on theme: "CS 330 Programming Languages 09 / 04 / 2008 Instructor: Michael Eckmann."— Presentation transcript:

1 CS 330 Programming Languages 09 / 04 / 2008 Instructor: Michael Eckmann

2 Michael Eckmann - Skidmore College - CS 330 - Fall 2008 Today’s Topics Introduction Review the syllabus Preliminary material Fill out a questionnaire on programming experience

3 Homework Read chapter 1 in Sebesta. Written assignment due 11:59 pm. September 11 via email to meckmann@skidmore.edu meckmann@skidmore.edu Michael Eckmann - Skidmore College - CS 330 - Fall 2008

4 Syllabus Office hours Text book Class room Assignments –programs –homeworks Collaboration policy Grading schema Attendance Workload Readings Note: The most up-to-date syllabus will be found on the course web page.

5 Michael Eckmann - Skidmore College - CS 330 - Fall 2008 Reason to study Prog. Langs. Increased ability to express ideas –Hard to conceptualize what you can't describe –Limited grasp of lang. -> limited complexity of thought –(read paragraph from text) page 2. –May be able to apply what is learned in one language to another. How? For choosing appropriate languages –The more you know, the better you can fit the job to the language –What language will you choose if you only know one language? –What advantages are there to choosing the one you know?

6 Michael Eckmann - Skidmore College - CS 330 - Fall 2008 Reason to study Prog. Langs. Understand significance of implementation –Use language more intelligently, e.g. Faster execution, find bugs easier Ability to design new languages Overall advancement of computing

7 Application Areas of Prog. Langs. Question: What are some differences between the needs of a scientific application and a business application? What about vs. systems applications (e.g. OS's and their support programs.)‏ Scientific applications –Fortran, Algol 60, et al. Business applications –Cobol Artificial intelligence –Lisp, Prolog, Scheme Systems programming –C Scripting languages –Perl, JavaScript, PHP, et al. Special-purpose languages Michael Eckmann - Skidmore College - CS 330 - Fall 2008

8 Language Evaluation When we talk about Language evaluation we're talking about evaluating how effective the features of a language are at allowing programmers to create programs that are readable, writeable, reliable, costly etc. In that way we can then compare languages to each other in terms of how readable, writeable, reliable, costly, etc. the programs in each of those languages tend to be. This is different from comparing, for instance, how readable 2 programs written in the same language are. Michael Eckmann - Skidmore College - CS 330 - Fall 2008

9 Language Evaluation Readability –Why is it important? –Software lifecycle (time/$ spent on maintenance vs. on initial coding)‏ –Simplicity (1 way vs. mult., operator overloading)‏ –Orthogonality (set of primatives combined in few ways in all combinations to build data structures)‏ –Control (e.g. gotos vs. loops)‏ –Types (e.g. Using an int where a boolean is best)‏ –Structures (e.g. Records vs. arrays of individuals)‏ –Syntax (identifier rules (size, valid chars), special words can be variable names --- any advantage to this?)‏ Michael Eckmann - Skidmore College - CS 330 - Fall 2008

10 Language Evaluation Writability –Orthogonality if small set and all combinations make sense + if large set and all combinations exist but some don't make sense to ever use or would be rarely used – (could cause undeteced errors)‏ –Abstraction (functional (methods/functions) & data (classes))‏ don't need to know/be reminded of/replicate the implementation details, just need to use what you wrote –Expressivity (e.g. count++, for vs. while...)‏ Reliability –(+)Type checking (at run-time vs. compile-time vs. neither)‏ when is better? –(+)Exception Handling –(-)Aliasing (why?)‏ Michael Eckmann - Skidmore College - CS 330 - Fall 2008

11 Language Evaluation Cost (time == $)‏ –training programmers in the language –writing --- IDEs –compiling, executing --- compiler optimization tradeoff –Implementation system (e.g. The compiler and/or interpreter available for free?)‏ –Poor reliability –Maintenance (up to 4 times cost of developing)‏ Can you think of others? Michael Eckmann - Skidmore College - CS 330 - Fall 2008

12 A few Imperitive Languages C, Pascal and many others C++ has imperitive features although it is OO Java is imperitive-based although it is OO

13 von Neumann Architecture Michael Eckmann - Skidmore College - CS 330 - Fall 2008

14 von Neumann bottleneck transmission/piping between memory and CPU takes longer than executing instructions within the CPU. Michael Eckmann - Skidmore College - CS 330 - Fall 2008

15 Imperitive Language Features Imperitive languages are built FOR the von Neumann architecture –Data and programs stored in same memory –Memory is separate from CPU –Instructions and data are transmitted from memory to CPU Variables model memory cells Assignment statements model transmission Iteration is efficient (b/c instructions are in adjacent memory cells, simple branch)‏ Recursion is inefficient (why?)‏ Michael Eckmann - Skidmore College - CS 330 - Fall 2008

16 Functional vs. Imperitive Languages Functional (e.g. Lisp, Scheme, et al.)‏ –Apply functions to parameters –different use of variables –No assignment statements –No iteration, only recursion –Many programmers feel that there are extreme benefits to computing using functional languages. So, why aren't they used more? Michael Eckmann - Skidmore College - CS 330 - Fall 2008

17 Functional vs. Imperitive Languages Because of von Neumann, that's why! What might be a drawback to using a functional language on a von Neumann machine? Michael Eckmann - Skidmore College - CS 330 - Fall 2008

18 Imperitive Languages Von Neumann => imperitive languages But many programmers do not realize this and think that imperitive languages are the natural way to program. Michael Eckmann - Skidmore College - CS 330 - Fall 2008

19 The major Language Groups Imperitive –And visual langs (drag/drop code)‏ Functional Logic –Rule based, no order of execution Object-Oriented Michael Eckmann - Skidmore College - CS 330 - Fall 2008

20 Some Language Design Trade-offs Reliability vs. cost of execution –e.g. Run-time array range checking --- Java vs. C Readability vs. writability (expressivity)‏ –Compactness Flexibility vs. safety –e.g. Multiple types allowed in same memory location Michael Eckmann - Skidmore College - CS 330 - Fall 2008

21 Compilation, Interpretation, Hybrids What is a compiler? What is an interpreter? What is a hybrid of these? –Java, Perl –Compiler generates intermediate code that is then interpreted –Any advantages/disadvantages? Michael Eckmann - Skidmore College - CS 330 - Fall 2008

22 Let's think about some stuff Any other language evaluation criteria you can think of? What are the pros and cons of case sensitivity in user defined names? Michael Eckmann - Skidmore College - CS 330 - Fall 2008


Download ppt "CS 330 Programming Languages 09 / 04 / 2008 Instructor: Michael Eckmann."

Similar presentations


Ads by Google