DOC PREVIEW
UMD CMSC 330 - Introduction

This preview shows page 1-2 out of 7 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 7 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

11CMSC 330: Organization of Programming Languageshttp://www.cs.umd.edu/~atif/Teaching/Fall2007IntroductionInstructor: Atif M MemonTAs: Guilherme Fonseca, Michael Lam, Xun Yuan CMSC 330 2Calendar / Course Overview• Final Exam (25%)• 2 midterms (30%)• One project every few weeks (5 total) (40%)– Project 1 - Write a web server log analysis tool.• Will be posted next week.– Project 2 - Write a unit testing framework in Ruby. – Project 3 - Write some OCaml code. – Project 4 - NFAs and reg exps in OCaml. – Project 5 - Write a threaded bank simulation. • Two homework assignments (one before each exam) (5%)•Ruby•OCaml•JavaCMSC 330 3Academic Integrity• All written work (including projects) must be done on your own• Work together on practice questions for the exams• Work together on high-level project questions– Never see another student’s code– If unsure, ask instructor!What if…?CMSC 330 4Rules and Reminders• Quiet cell phones• Be on time• Come to class and discussion section• Laptops in class only if really needed• Use lecture notes as the book• Stay organized and ahead of your work• Get help as soon as you need it (but not when you don’t)– Office hours• http://www.cs.umd.edu/~atif/Teaching/Fall2007/office-hours.shtml• Use internet resourcesCMSC 330 5Syllabus• Scripting Languages (Ruby)• Regular expressions and finite automata• Context-free grammars• Functional programming (OCaml)• Concurrency• Object-oriented programming (Java)• Environments, scoping, and binding• Advanced TopicsCMSC 330 6Course GoalLearn how programming languages “work”• Broaden your language horizons– Different programming languages– Different language features and tradeoffs• Study how languages are implemented– What really happens when I write x.foo(…)?• Study how languages are described– Mathematical formalisms2CMSC 330 7All Languages Are Equivalent• A language is Turing complete if it can compute any function computable by a Turing Machine• Essentially all general-purpose programming languages are Turing complete• Therefore this course is useless!CMSC 330 8Why Study Programming Languages?Introduce yourself to your neighbor(s) and together write down three of your own reasons…CMSC 330 9Why Study Programming Languages?• Using the right language for a problem may be easier, faster, and less error-prone– Programming is a human activity– Features of a language make it easier or harder to program for a specific application• To make you better at learning new languages– You may need to add code to a legacy system• E.g., FORTRAN (1954), COBOL (1959), …– You may need to write code in a new language• Your boss says, “From now on, all software will be written in {Ada/C++/Java/…}”• You may think Java is the ultimate language, but if you are still programming or managing programmers in 20 years, they probably won’t be programming in Java!CMSC 330 10Why Study Programming Languages?• To make you better at using languages you think you already know– Many “design patterns” in Java are functional programming techniques– Understanding what a language is good for will help you know when it is appropriate to useCMSC 330 11Changing Language Goals• 1950s-60s: Compile programs to execute efficiently– Language features based on hardware concepts• Integers, reals, goto statements– Programmers cheap; machines expensive• Keep the machine busy• Today:– Language features based on design concepts• Encapsulation, records, inheritance, functionality, assertions– Processing power and memory very cheap; programmers expensive• Ease the programming processCMSC 330 12Language Attributes to Consider• Syntax -- What a program looks like• Semantics -- What a program means• Implementation -- How a program executes3CMSC 330 13Imperative Languages• Also called procedural or von Neumann• Building blocks are functions and statements– Programs that write to memory are the normint x = 0;while (x < y) x := x + 1;– FORTRAN (1954)– Pascal (1970)– C (1971)CMSC 330 14Functional Languages• Also called applicative languages• No or few writes to memory– Functions are higher-orderlet rec map f = function [] -> []|x::l->(fx)::(mapfl)– LISP (1958)– ML (1973)– Scheme (1975)– Haskell (1987)– OCaml (1987)CMSC 330 15Logical Languages• Also called rule-based or constraint-based• Program consists of a set of rules–“A :- B”–If B holds, then A holds • append([], L2, L2).• append([X|Xs],Ys,[X|Zs]) :- append(Xs,Ys,Zs).– PROLOG (1970)– Various expert systemsCMSC 330 16Object-Oriented Languages• Programs are built from objects– Objects combine functions and data– Often have classes and inheritance– “Base” may be either imperative or functionalclass C { int x; int getX() {return x;} … }class D extends C { … }– Smalltalk (1969)– C++ (1986)– OCaml (1987)– Java (1995)CMSC 330 17Scripting Languages• Rapid prototyping languages for “little” tasks– Typically with rich text processing abilities– Generally very easy to use– “Base” may be imperative or functional; may be OO#!/usr/bin/perlfor ($j = 0; $j < 2*$lc; $j++) {$a = int(rand($lc));…• sh (1971)• perl (1987)• Python (1991)• Ruby (1993)CMSC 330 18“Other” Languages• There are lots of other languages around with various features– COBOL (1959) – Business applications• Imperative, rich file structure– BASIC (1964) – MS Visual Basic widely used• Originally an extremely simple language• Now a single word oxymoron– Logo (1968) – Introduction to programming– Forth (1969) – Mac Open Firmware• Extremely simple stack-based language for PDP-8– Ada (1979) – The DoD language• Realtime– Postscript (1982) – Printers- Based on Forth–…4CMSC 330 19Attributes of a Good Language1. Clarity, simplicity, and unity• Provides both a framework for thinking about algorithms and a means of expressing those algorithms 2. Orthogonality• Every combination of features is meaningful• Features work independentlyWhat if, instead of working independently, adjusting the volume on your radio also changed the station? You would have to carefully change both simultaneously and it would become difficult to find the right station and keep it at the right volume. Your radio and tuning work orthogonally. And aren’t you glad they do!CMSC 330 20Attributes of a Good


View Full Document

UMD CMSC 330 - Introduction

Documents in this Course
Exam #1

Exam #1

6 pages

Quiz #1

Quiz #1

2 pages

Midterm 2

Midterm 2

12 pages

Exam #2

Exam #2

7 pages

Ocaml

Ocaml

7 pages

Parsing

Parsing

38 pages

Threads

Threads

12 pages

Ruby

Ruby

7 pages

Quiz #3

Quiz #3

2 pages

Threads

Threads

7 pages

Quiz #4

Quiz #4

2 pages

Exam #2

Exam #2

6 pages

Exam #1

Exam #1

6 pages

Threads

Threads

34 pages

Quiz #4

Quiz #4

2 pages

Threads

Threads

26 pages

Exam #2

Exam #2

9 pages

Exam #2

Exam #2

6 pages

Load more
Download Introduction
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Introduction and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Introduction 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?