CSE S. Tanimoto Comparing Languages

Slides:



Advertisements
Similar presentations
C-LISP. LISP 2 Lisp was invented by John McCarthy in 1958 while he was at the Massachusetts Institute of Technology (MIT).John McCarthyMassachusetts Institute.
Advertisements

Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 1.
AP Computer Science. Google Interview Question You are given 8 identical looking balls. One of them is heavier than the rest of the 7 (all the others.
Programming Languages Language Design Issues Why study programming languages Language development Software architectures Design goals Attributes of a good.
Programming Languages Structure
CSE S. Tanimoto Syntax and Types 1 Representation, Syntax, Paradigms, Types Representation Formal Syntax Paradigms Data Types Type Inference.
Dr. Muhammed Al-Mulhem 1ICS ICS 535 Design and Implementation of Programming Languages Part 1 Introduction (Chapter 1)
CSE 1301 J Lecture 2 Intro to Java Programming Richard Gesick.
CSE S. Tanimoto Introduction 1 CSE 341 Programming Languages Autumn 2001 Instructor: Steve Tanimoto Teaching assistants:
CS 331, Principles of Programming Languages Introduction.
CSE 341, S. Tanimoto Concepts 1- 1 Programming Language Concepts Formal Syntax Paradigms Data Types Polymorphism.
PYTHON. Python is a high-level, interpreted, interactive and object- oriented scripting language. Python was designed to be highly readable which uses.
Chapter 1 - Introduction
By Nicholas Policelli An Introduction to Java. Basic Program Structure public class ClassName { public static void main(String[] args) { program statements.
1 Introduction Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Sections
Chapter 8 High-Level Programming Languages. 8-2 Chapter Goals Describe the translation process and distinguish between assembly, compilation, interpretation,
Software for Translators Barcelona, January 2002.
Lecture 1 Introduction Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
Introduction to Perl Yupu Liang cbio at MSKCC
Group 4 Java Compiler Group Members: Atul Singh(Y6127) Manish Agrawal(Y6241) Mayank Sachan(Y6253) Sudeept Sinha(Y6483)
An Introduction to Java – Part 1 Dylan Boltz. What is Java?  An object-oriented programming language  Developed and released by Sun in 1995  Designed.
CSE S. Tanimoto Java Introduction 1 Java A Programming Language for Web-based Computing with Graphics.
Review, Pseudocode, Flow Charting, and Storyboarding.
1 Building Java Programs Chapter 3: Introduction to Parameters and Objects These lecture notes are copyright (C) Marty Stepp and Stuart Reges, They.
A Look at Java. Categorize Java Which paradigm? Which paradigm? Scripting? Scripting? Declarative or procedural? Declarative or procedural? Which generation?
CS 331, Principles of Programming Languages Chapter 1.
CSE 341, S. Tanimoto Wrapup - 1 Wrapup Programming Languages as systems for specifying computation Comparing Lisp, Java and Perl The future.
CSE S. Tanimoto More-Concepts - 1 More Programming Language Concepts Currying Lazy Evaluation Polymorphism.
Programming Languages
Lisp "List Processing". Lisp history John McCarthy developed the basics behind Lisp during the 1956 Dartmouth Summer Research Project on Artificial Intelligence.
int k = Integer.MAX_VALUE; k++; int k = Integer.MAX_VALUE; k++; What happens when the following code executes? byte b = someFile.readByte(); b = (byte)(b.
Lecture1 Instructor: Amal Hussain ALshardy. Introduce students to the basics of writing software programs including variables, types, arrays, control.
Java Programming Daily review / 1 PT. each. September 28/29: Lesson 1 - a 1. Create the “skeleton” of a program Public class Tester { Public static void.
Chapter 3 Introducing Java. Objectives and Goals 1. Define terminology associated with object- oriented programming. 2. Explain why Java is a widely used.
a medium allowing humans and computers to communicate an abstraction of the real world a notation for expressing algorithms the set of all syntactically.
The language focusses on ease of use
Modern Programming Tools And Techniques-I
A Programming Language for Web-based Computing with Graphics
Lecture 1 Introduction Richard Gesick.
PROGRAMMING LANGUAGES
GC101 Introduction to computer and program
CSCI-235 Micro-Computer Applications
Representation, Syntax, Paradigms, Types
Chapter 8: Control Structures
Introduction to Computers and Python
An Introduction to Java – Part I, language basics
Fundamentals of Programming
صياغة البرامج ولغات البرمجة Programming & programming languages
Representation, Syntax, Paradigms, Types
CSE 341 Programming Languages Autumn 2001
CSE 341 Programming Languages Autumn 2003
CSE 341 Programming Languages Autumn 2002
CSE S. Tanimoto Introduction
High Level Programming Languages
Representation, Syntax, Paradigms, Types
Chapter 6: Programming Languages
CSE S. Tanimoto Introduction
Functional Programming Concepts
CSE 341 Programming Languages Spring 2003
CSE S. Tanimoto Introduction
Functional Programming Concepts
Lecture 8 Programming Paradigm & Languages. Programming Languages The process of telling the computer what to do Also known as coding.
CSE 341 Programming Languages Autumn 2003
Representation, Syntax, Paradigms, Types
강의 내용 및 방법 접근방법 리포트 시험 Lambda Calculus, Proof of Correctness
February , 2009 CSE 113 B.
Defining Functions with DEFUN
Abstraction and Repetition
CSE 341 Lecture 11 b closures; scoping rules
Functional Programming Concepts
Presentation transcript:

CSE 341 -- S. Tanimoto Comparing Languages Wrapup Programming Languages as systems for specifying computation Comparing Languages CSE 341 -- S. Tanimoto Comparing Languages

CSE 341 -- S. Tanimoto Perl Introduction Programming 1. Specify computation 2. Using a finite-length expression, specify arbitrarily long computations using looping or recursion. 3. Key criterion is that the program description be effective, so that a computer really can interpret/compile and execute it. CSE 341 -- S. Tanimoto Perl Introduction

CSE 341 -- S. Tanimoto Perl Introduction Language Comparison Lisp: uniform syntax, interpreted, mostly functional. ML: functional, with strong, static typing and type inference. Java: typical syntax, compiled, mostly object-oriented. Prolog: logic programming paradigm, unification and resolution, weakly typed. Perl: permissive syntax, compiled, multi-paradigm, scripting. CSE 341 -- S. Tanimoto Perl Introduction

CSE 341 -- S. Tanimoto Perl Introduction 99 Bottles of Beer The next step up from “Hello World” Print the words to the song, “99 Bottles of Beer on the Wall.” For solutions in over 200 languages, see http://www.ionet.net/~timtroyr/funhouse/beer.html CSE 341 -- S. Tanimoto Perl Introduction

CSE 341 -- S. Tanimoto Perl Introduction BASIC Beginners’ All purpose Symbolic Instruction Code 10 REM Basic version of 99 bottles of beer 20 FOR X=99 TO 1 STEP -1 30 PRINT X;"Bottle(s) of beer on the wall,";X;"bottle(s) of beer" 40 PRINT "Take one down and pass it around," 50 PRINT X-1;"bottle(s) of beer on the wall" 60 NEXT CSE 341 -- S. Tanimoto Perl Introduction

CSE 341 -- S. Tanimoto Perl Introduction Lisp ;;; Print the words to 99 Bottles of beer. (defun b (n) (format nil "~A bottle~A of beer" n (if (= n 1) "" "s")) ) (defun bb (n) (format t "~A on the wall, ~A.~%~A ~A.~%" (b n)(b n) "Take one down and pass it around, " (b (1- n)) ) (if (> n 1) (bb (1- n))) ) (bb 99) CSE 341 -- S. Tanimoto Perl Introduction

CSE 341 -- S. Tanimoto Perl Introduction Java public class Bottle { public static void main(String Argv[]) { for(int i=99; i>0; i--) { String b = b(i); System.out.println(b + " on the wall, " + b + ".\n" + "Take one down and pass it around, " + b(i-1) + " on the wall."); } static String b(int n) { String s = "s"; if (n == 1) s = ""; return n + " bottle" + s + " of beer"; CSE 341 -- S. Tanimoto Perl Introduction

CSE 341 -- S. Tanimoto Perl Introduction # Print words to '99 Bottles of Beer' -- S. Tanimoto $w = " on the wall"; $t = "\nTake one down and pass it around, "; for (reverse(1 .. 99)) { print b($_),"$w, ",b($_),". ",$t,b($_-1),"$w.\n"; } sub b() { ($n) = @_; $p = ($n != 1) ? "s" : ""; "$n bottle$p of beer"; } CSE 341 -- S. Tanimoto Perl Introduction

CSE 341 -- S. Tanimoto Perl Introduction Prolog bbw(1) :- write(' One bottle of beer on the wall'). bbw(N) :- write(N), bob, write(' on the wall'). bb(1) :- bbw(1), write(', one bottle of beer'), tod, write(' No'), bob, write('.'). bb(N) :- bbw(N), write(', '), write(N), bob, tod, M is N - 1, bbw(M), write('.\n'), bb(M). bob :- write(' bottles of beer'). tod :- write('. Take one down; pass it around - '). CSE 341 -- S. Tanimoto Perl Introduction

CSE 341 -- S. Tanimoto Perl Introduction The Future Ubiquitous computing, wireless Internet, embedded systems Computers will be everywhere! Your toaster MAY be programmable. What kind of programming system will it offer? What will be the consequences of inability to program? End-user programming languages and systems will play a key role in letting ordinary people be in control of the devices in their own homes. CSE 341 -- S. Tanimoto Perl Introduction

CSE 341 -- S. Tanimoto Perl Introduction Final Exam 40 questions from quizzes 1 and 2, slightly changed. 10 questions on Perl and regular expressions. All multiple choice. CSE 341 -- S. Tanimoto Perl Introduction