Introduction to programming languages, Algorithms & flowcharts

Slides:



Advertisements
Similar presentations
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Advertisements

Copyright © 1998 by Addison Wesley Longman, Inc. 1 Chapter One Preliminaries, including –Why study PL concepts? –Programming domains –PL evaluation criteria.
CSI 3125, Preliminaries, page 1 Programming languages and the process of programming –Programming means more than coding. –Why study programming languages?
Programming Languages Language Design Issues Why study programming languages Language development Software architectures Design goals Attributes of a good.
Reasons to study concepts of PL
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.
Copyright © 1998 by Addison Wesley Longman, Inc. 1 Concepts of Programming Languages Chapter 1.
SOFTWARE SYSTEMS SOFTWARE APPLICATIONS SOFTWARE PROGRAMMING LANGUAGES.
CS 331, Principles of Programming Languages Introduction.
1 Programming Languages Marjan Sirjani 2 1- The Study of Programming Languages The purpose of language is simply that it must convey meaning. (Confucius)
CS 415: Programming Languages Chapter 1 Aaron Bloomfield Fall 2005.
Programming Languages Lecture 12. What is Programming?  The process of telling the computer what to do  Also known as coding.
314450: PROGRAMMING PARADIGMS Teaching scheme: Examination Scheme: Lectures: 3 Hours/Week Theory: 100 Marks OBJECTIVE: To understand the basic building.
Programming Languages CPS120: Introduction to Computer Science Lecture 5.
PZ01A Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ01A -- Introduction Programming Language Design and.
(1.1) COEN 171 Programming Languages Winter 2000 Ron Danielson.
COMPUTER PROGRAMS AND LANGUAGES Chapter 4. Developing a computer program Programs are a set (series) of instructions Programmers determine The instructions.
CS 330 Programming Languages 09 / 04 / 2008 Instructor: Michael Eckmann.
Object Oriented Programming (FIT-II) J. H. Wang Mar. 5, 2015.
Programming Languages Summer
Programming Languages –14 David Watt (Glasgow) Steven Wong (Singapore) Moodle : Computing Science → Level 3 → Programming Languages 3 © 2012 David.
COP 4020 Programming Langauges Dr. Roy Levow –Office hours: M 5-6:30 – –
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.
Object Oriented Programming (FIT-II) J. H. Wang Feb. 24, 2014.
Programming Domains 1.Scientific Applications Typically, scientific applications have simple data structures but require large numbers of floating-point.
Object Oriented Programming (FIT-II) J. H. Wang Feb. 21, 2012.
CS 331, Principles of Programming Languages Chapter 1.
Engr. Isabelo Jun D. Paat, ME-CoE Lecturer 1 Programming Languages.
Course No Programming Languages Theory & Practice First Semester ITTIHAD UNIVERSITY Computer Science Department Instructor: Dr. Rafiqul.
Computer Programming CONTENTS Introduction to Operating Systems Introduction to programming languages Introduction to perl programming language Programming.
Course 150 Basic Computing Environment. Objective of course Familiar with Linux environment Objective of lecture: To understand basic terms like software,
Chapter 1: Preliminaries Lecture # 2. Chapter 1: Preliminaries Reasons for Studying Concepts of Programming Languages Programming Domains Language Evaluation.
Software Engineering Algorithms, Compilers, & Lifecycle.
a medium allowing humans and computers to communicate an abstraction of the real world a notation for expressing algorithms the set of all syntactically.
CPS120 Introduction to Computer Science High Level Language: Paradigms.
Programming Languages and Data Organization
Chapter 1. Introduction.
CSC 533: Programming Languages Spring 2016
The language focusses on ease of use
CSC 533: Programming Languages Spring 2015
CMIT100 Chapter 14 - Programming.
Concepts of Programming Languages
Why study programming languages?
Introduction to programming languages, Algorithms & flowcharts
PROGRAMMING LANGUAGES
CSCI-235 Micro-Computer Applications
Programming Language Design Concepts
Chapter 1 Reasons to study concepts of PLs Programming Domains
Problem Solving Using C: Orientation & Lecture 1
Comp 205: Comparative Programming Languages
1.1 Reasons to study concepts of PLs
Chapter 1 Preliminaries.
Introduction to programming languages, Algorithms & flowcharts
CS 3304 Comparative Languages Fall 2011
Problem Solving.
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
High Level Programming Languages
Programming Language Design
Chapter 1 Preliminary. Chapter 1 Preliminary 1.1 Reasons for Studying Concepts of Programming Languages Increased capacity to express ideas Improved.
Programming Languages 2nd edition Tucker and Noonan
Introduction to Computer Programming
Principles of Programming Languages
강의 내용 및 방법 접근방법 리포트 시험 Lambda Calculus, Proof of Correctness
Programming Languages, Preliminaries, History & Evolution
Reasons To Study Programming Languages
Presentation transcript:

Introduction to programming languages, Algorithms & flowcharts Slides borrowed from Instructor: Wajih Alouini

What are Program and programming language? Program : Set of instructions which a computer can “interpret” to solve problems, make calculations, perform tasks, etc. Programming Language : A formal language that is intended for the expression of computer programs Syntax is away of writing program in any language (every language has its own syntax) Slides borrowed from Instructor: Wajih Alouini

Why study programming languages? Programming languages are important for students in all disciplines of engineering because they are the primary tools of the central activity of any science. Slides borrowed from Instructor: Wajih Alouini

Why study programming languages? (cont.) To improve your ability to develop effective algorithms and to improve your use of your existing programming language. To increase your vocabulary of useful programming constructs. To allow a better choice of programming languages. To make it easier to learn a new language. Slides borrowed from Instructor: Wajih Alouini

A short history of programming Languages 1950 : Numerically based languages. FORTRAN (55) Business languages. COBOL(60) Artificial intelligence languages. LISP, ALGOL(58) LISP, FORTRAN (55) ALGOL 1970 : PLs Ada, C, Pascal, Smalltalk 1980 : Development of functional programming: ML, Miranda Object-oriented programming: Smalltalk, C++ Slides borrowed from Instructor: Wajih Alouini

A short history of programming languages (cont.) Fourth-generation languages Productivity tools (such as spreadsheets) Visual languages : Delphi Scripting languages : Perl Expert systems shells Network computing : Java Slides borrowed from Instructor: Wajih Alouini

Low-level vs. High-level Programming Languages Machine code Assembly High-level: (abstraction from the computer details) Basic, C, Java, Pascal, C++, Perl, Python, … Slides borrowed from Instructor: Wajih Alouini

Styles of Computer Programming Procedural: procedures, routines, subroutines, methods, or functions e.g. C, Pascal, Basic, Fortran Functional Mathematical functions e.g. Lisp, Erlang, Haskell, ML, … Object-oriented e.g. C++, Java, Smalltalk Rule-based (or Logic) : facts, rules e.g. Prolog Slides borrowed from Instructor: Wajih Alouini

Slides borrowed from Instructor: Wajih Alouini Examples (1/5) Fibonacci numbers Fn = Fn-1 + Fn-2 , n>=2 F0 = 0, F1 = 1 How to program? 0,1,1,2,3,5,8,13 Slides borrowed from Instructor: Wajih Alouini

Slides borrowed from Instructor: Wajih Alouini Examples (2/5) Functional: (Haskell) fib 0 = 0 fib 1 = 1 fib n = fib (n-1) + fib (n-2) Slides borrowed from Instructor: Wajih Alouini

Slides borrowed from Instructor: Wajih Alouini Examples (3/5) Procedural: (C) int fib(int n) { int first = 0, second = 1; for (int i=0, i<n; i++) { int sum = first+second; first = second; second = sum; } return first; } Slides borrowed from Instructor: Wajih Alouini

Slides borrowed from Instructor: Wajih Alouini Examples (4/5) Assembly: (in x86 using MASM syntax) mov edx, [esp+8] cmp edx, 0 ja @f mov eax, 0 ret @@: cmp edx, 2 ja @f mov eax, 1 ret @@: push ebx mov ebx, 1 mov ecx, 1 @@: lea eax, [ebx+ecx] cmp edx, 3 jbe @f mov ebx, ecx mov ecx, eax dec edx jmp @b @@: pop ebx ret Slides borrowed from Instructor: Wajih Alouini

Slides borrowed from Instructor: Wajih Alouini Examples (5/5) Machine code 8B542408 83FA0077 06B80000 0000C383 FA027706 B8010000 00C353BB 01000000 B9010000 008D0419 83FA0376 078BD98B C84AEBF1 5BC3 Slides borrowed from Instructor: Wajih Alouini

Attributes of a good language Ease of program verification Proof of correctness, desk checking, test Simplicity of semantic and syntax Programming environment Portability of programs Cost of use Program execution Program translation Program creation, testing, and use Program maintenance Slides borrowed from Instructor: Wajih Alouini

Slides borrowed from Instructor: Wajih Alouini Attributes of a good language (another view: to make a software reliable, maintainable, efficient) Reliability Writability Readability Simplicity Safety (no goto, no pointers) Robustness (undesired events can be trapped, like arithmetic overflow, invalid inputs) Maintainability Factoring (modularity) Locality Efficiency Slides borrowed from Instructor: Wajih Alouini

Issues for all Languages Can it be understood by people and processed by machines? although translation may be required Sufficient expressive power? can we say what needs to be said, at an appropriate level of abstraction? Slides borrowed from Instructor: Wajih Alouini

Slides borrowed from Instructor: Wajih Alouini Translation Compilation Translate into instructions suitable for some other (lower level) machine During execution, that machine maintains program state information Interpretation May involve some translation Interpreter maintains program state Slides borrowed from Instructor: Wajih Alouini

Slides borrowed from Instructor: Wajih Alouini Trade-offs Compilation lower level machine may be faster, so programs run faster compilation can be expensive examples: C (and Java?) Interpretation more ability to perform diagnostics (or changes) at run-time examples: Basic, UNIX shells, Lisp Slides borrowed from Instructor: Wajih Alouini