/99/$ IEEE

Size: px
Start display at page:

Download "/99/$ IEEE"

Transcription

1 A Multiparadigm Language Approach to Teaching Principles of Programming Languages D. Suzanne Westbrook Computer Science and Electrical Engineering Northern Arizona University Flagstaff, AZ Abstract - This paper describes our experiences in using the multiparadigm language GED to teach our principles of programming languages course. The benefits of using a multiparadigm language include less time spent on learning new environments for different languages, easier transition to different paradigms, and opportunities for multiparadigm programming. In this paper, we give a brief description of GED (which supports the imperative, functional, logic, and object-oriented paradigms), describe how it is used in our course, and discuss the advantages and disadvantages of this approach versus the traditional use of several languages. Introduction Most programming languages courses have students use several distinct languages to gain experience with different language paradigms and implementation issues. Although this approach gives students exposure to multiple real languages (they think it looks good on the resume!), the exposure is necessarily shallow due to the time involved in learning new environments. We believe that by using one multiparadigm language, instead of several single-paradigm languages, students can concentrate specifically on the aspects of a particular paradigm rather than having to learn a new environment and syntax for each language in addition to a paradigm. For the last five years we have used the multiparadigm language GED as the only language in our undergraduate principles of programming languages course. GED supports the imperative, functional, object-oriented, and logic paradigms and allows programs to be written using either single paradigms or combinations of paradigms. In this paper, we give a brief description of GED and show how it can be used to develop problem solutions in the imperative (or procedural), functional, logic, and object-oriented paradigms. We also describe how it is used in our course and discuss the advantages and disadvantages of this approach versus the traditional use of several languages. Course Background paradigms (currently imperative, functional, logic, and object-oriented). Programming assignments are oriented toward experimentation with different paradigms. Solutions are graded on correctness of results while staying within the appropriate paradigm. Approximately every two to three weeks, lectures are alternated between concepts and paradigms so students always have a programming assignment to work on. Additional assignments are made, as needed, for example a written homework covering BNF notation and grammars. Starting in 1997, students had a formal background in an object-oriented language (C++) and program design. In prior years, they had an imperative/procedural background using C. For most students in the class, this is their first formal exposure to a second language and to different paradigms. They have opportunities in other required and elective courses to learn additional languages (currently Visual C++, Java, Ada, Lisp, and Prolog). On the first day of class, the students answer a short survey about their familiarity with different programming paradigms. The results are shown below. Most students were familiar with the notion of the object-oriented paradigm. This is not surprising since that concept is at the heart of working with C++. It was surprising, however, that a majority of the students said they were not familiar with the notion of the imperative (procedural) paradigm even when that was their first paradigm exposure. As expected, most students are not familiar with the functional or logic paradigms. Table 1: Number of students familiar with different programming paradigms (total students in parentheses) Paradigm Familiarity (23) (21) (18) (16) Imperative Functional Logic Our principles of languages course is a junior-level required course offered each spring. The course covers both traditional programming language concepts (most usually associated with imperative languages) and programming Object- Oriented b3-14

2 Description of GED We use the multiparadigm language GED that was developed by John Placer and is an extension of his previous languages G and G-2 [2,3]. GED is an expression-based, interpreted language that has constructs to support programming in the imperative, functional, logic and objectoriented paradigms. The basic data type in GED is a list where list members may be heterogeneous. Eight types are supported: List, Func (for function definition), Symbol, Real, Type, String, and File. The type system is hierarchically organized with List as the base type for all others. GED statements may be entered at the interpreter prompt or may be saved in a file and included in a GED session. GED has built-in operators for arithmetic, comparison, logic, list-processing, and string-processing operations. Several types of control structures are supported, including blocks for sequencing and scoping, selection statements, and iteration (while, foreach, recursion). Formatted input and output are supported for both standard input/output and files. Process abstraction is provided in GED by support for defining named entities (usually called functions ) for use as procedures, true functions, named logical rules, and methods. Named entities are first-class values and can, therefore, be used as arguments to other entities, returned by other entities, assigned to variables, and used as list elements. GED supports relations and has mechanisms to perform simple and complex queries on the values of relation sets. Data abstraction is provided through support for user-defined types that allow for encapsulation and inheritance. GED Examples In order to give the flavor of GED, this section gives sample code for returning a list with an item deleted from an original list in each of the imperative, functional, logic, and object-oriented paradigms. In the functional and logic examples, the original list is not actually modified, however it is in the imperative and object-oriented examples. Comments begin with a double dash. Local variables are declared in a list beginning with the keyword local and are initialized when followed by a colon and some value ( [ ] is an empty list). Imperative/ Procedural Style in GED In this imperative example, a function is defined to perform the delete. This function uses a block structure with sequencing of statements, a foreach iterative control structure, and variable assignment all characteristics of the imperative paradigm. The main program code that invokes delete also uses sequencing and variable assignment to obtain the result. -- delete occurrences of value x from list func delete(x, list) { local [a:[ ]]; foreach i in list do if (i!= x) then a := a i end end; a; -- main program using delete { alist := [1, 2, 3]; alist := delete(2, alist); Functional Style in GED In this functional example, the function definition uses no local variables (and therefore no variable assignment). Instead of an explicit looping construct (such as the foreach in the imperative example), recursive calls are made to traverse the list. The built-in functions head and tail correspond to car and cdr in other functional languages and the append operator ( ) is used to combine lists. The function is invoked using explicit values for both the item to be deleted and the actual list of values. func delete (x, list) if list then if (x = head(list) then delete(x, tail(list)) else [head(list)] delete(x, tail(list)) end end. -- invocation of delete delete(2, [1, 2, 3]). Logic Style in GED In this logic paradigm example, first the list is defined to have some set of values. Then a named logical rule is defined such that each element in the list is examined (temp is instantiated with each value in turn), compared to the value of x and if it is not a match (the clause is true) then it is added to a new list. -- state assertion list := [1, 2, 3]. 11b3-15

3 -- named logical rule func delete(x) { local [temp]; list [temp], temp!= x -> temp using GED in a single paradigm style (imperative, functional, logic). In the fourth assignment, the objectoriented paradigm was to be used in at least some context, but they were free to also use other paradigms as desired thereby potentially creating a multiparadigm solution. -- execute rule to delete 2 from list delete(2). Object-Oriented Style in GED In the object-oriented example, a new class MyList is defined along with its methods (init, add, delete). MyList is based on the List type, contains one private instance variable (list), has no static variables (#), and no public variables (#). To use MyList, first an instance of it (alist) is created using the built-in operator make, then three elements are added to it, and then one of the elements is deleted. Of interest here is the implementation of the delete method which uses the logic, functional, and imperative paradigms to modify the original list. The logic paradigm is represented in list [<x] and list [>x] both of which are a type of query or filter which return all elements of list matching the constraint. The functional paradigm is represented by the append operator. The imperative paradigm is represented by the use of variable assignment. -- define user-defined type (class) MyList addtype (MyList, List, local[list], #, #). -- definition of methods for MyList ---- constructor for MyList func {MyList} init (me, x:[ ]) list := x add a value to a MyList instance func {MyList} add(me, x) list := list [x] delete all elements that match x from -- a MyList instance (using logic paradigm) func {MyList} delete (me, x) list := list [<x] list [>x]. -- main program using MyList and delete alist := make (MyList). add (alist, 1). add (alist, 2). add (alist, 3). delete(alist, 2). Assignments and Experiences During the course, four paradigm-related assignments were given. Each of the first three assignments was to be solved Imperative/Procedural Assignment The first assignment was to use GED to solve a single problem in an imperative (procedural) style. GED features supporting this paradigm are variable assignment, block structure, selection and looping constructs, and definition and use of functions and procedures. The problem required the ability to create, access, and modify a simple database. This problem was chosen for the imperative style (although it would also have been appropriate for an object-oriented solution) because there was a straightforward solution using problem decomposition and a hierarchy of procedures to perform the various tasks. Many students seemed to be at a loss on how to even think about writing a program without the ability to define objects and their behaviors. Given that their first language was C++, this was not completely unexpected but the extent of it was still surprising. Even after much discussion on problem decomposition based on procedural abstractions, many solutions were unnecessarily lengthy due to duplicated code resulting in monolithic solutions. These differences in solutions, however, provided interesting examples and discussions on what is a good imperative solution and what could be improved in those that were judged to be not as good solutions. Functional Assignment The second assignment was to solve a series of small problems using GED in a functional style. GED features supporting this paradigm include support for lists as a basic data structure, defining and using functions, selection statements, recursion, higher-order functions, polymorphism, and functions as first-class values. The problems used in this assignment included, among others, quicksort, a series of set manipulations (subset, intersection, difference, union), manipulations with lists of values (summing all values without regard to depth of list nesting), and converting a function with multiple arguments to a curried version. Each of these problems gave an opportunity to utilize recursion and to think about problem solving in a functional way. Although the students were well acquainted with recursion from previous classes, the emphasis on it with these problems seemed to strengthen their previous knowledge. Many of them expressed pleasure with their solutions and the functional paradigm succinctly stated by one student as this stuff is really cool!. Logic Assignment 11b3-16

4 The third assignment was to solve a series of related problems using GED in a logic paradigm style. GED features supporting this paradigm include the definition of relations (by associating a list of related values to a variable name), support for defining logical rules (named or unnamed) that allow for the return of a set of values based on satisfying a set of expressions, variable instantiation, an implied search mechanism, and backtracking. The problems used in this assignment concerned determining familial relationships given some initial relationships. Given the assertions of male and female and the relation parentof (where the first person is the parent of the second), the students were to determine which females are mothers, which males are fathers, and then determine all sister, brother, cousin, aunt, uncle, and grandparent relations. In essence, build a family tree (in the spirit of diversity, an acknowledgement was given that this exercise in no way was meant to exclude other forms of family composition and relationships). Working with this paradigm seems to prove the most difficult for many students. The logic paradigm is generally the most unlike any other paradigm they have seen and the notions of variable instantiation, backtracking, and an implicit search mechanism do not seem readily obvious. Object-Oriented/Multiparadigm Assignment The last assignment is a single problem that requires the use of at least some concepts of object-oriented programming and allows for the inclusion of other paradigms, thereby creating a multiparadigm solution. GED supports the objectoriented paradigm by the definition of classes and class methods through user-defined types and named functions associated with those types. This assignment is a simulation of a motor vehicle department that has various queues and transactions. It is stated to be an event-driven simulation, but the solutions often turn out to be time-driven. There are several ways to model the problem, but the students are not directed in any particular way other than to use at least one class. They are told that their solutions can be multiparadigm in the sense that the methods can be implemented using the logic or functional paradigms, for example. Over the years, a common solution theme involves using one class and several methods within an imperatively structured program. However, as the students have more recently come from an object-oriented background, the solutions have more of an overall object-oriented structure. One main problem students have is understanding the notion of an event-driven system and how to implement it. Since they are not given the structure of the program, it seems to be a problem to some on how to represent the various queues in the system and how to handle their interactions. Another problem encountered is that the assignment comes at the end of the semester (the last three weeks) and students tend to not start it early enough, resulting in numerous uncompleted assignments. Comparison of MPL to Traditional Approaches It is difficult in a one-semester course to integrate both the theory of programming languages and the notions of differing paradigms, particularly if the paradigms are demonstrated by requiring programming in multiple, distinct languages with different environments (such as lisp, Prolog, and Smalltalk to name a few). Although it is certainly desirable to have students exposed to as many real languages as possible in their undergraduate experiences, if they lack this exposure in the cases where it is shallow or limited then this lack is not necessarily detrimental. We feel that by using a single, multiparadigm language, such as GED, students gain exposure to multiple paradigms in a cohesive environment and can, therefore, focus more on the characteristics of a paradigm rather than learning a new environment. Another advantage of this approach is that they gain experience in learning a new language that does not have as much documentation as available for more established languages and therefore requires more experimentation to master. Former students have commented that their experience learning GED was helpful when they went to industry and were given a proprietary language to learn. Conclusion Overall, we have found using a multiparadigm language such as GED to be a good experience and plan to continue its use. Improvements to the GED environment are being explored to provide better error messages and to allow paradigm flags to be set to disallow certain language constructs outside of the chosen paradigm. Another multiparadigm language, Leda, has also been used at other schools and might be appropriate for a variety of courses [1]. Interestingly, the use of GED has increased the visibility of our principles of languages course since students have heard about both the fun and travails of working with it from previous students. It seems to provide a sense of accomplishment just in working with a language that none of their friends at other schools are using and in being able to say that they have used a multiparadigm language. In the past, there used to be some complaints about not using real languages that could be listed on a resume, but the new trend is to list GED and have the opportunity to explain their experience with it. Acknowledgements 11b3-17

5 Special thanks to John Placer for initiating the use of GED in this class and for the sample problems included in the draft GED manual. Many thanks also to the students in the course over the last five years for their numerous suggestions and comments. References 1) Budd, T., Pandey, R., Never Mind the Paradigm, What About Multiparadigm Languages?, SIGCSE Bulletin, 1995, Vol. 27, No. 2, pp ) Placer, J. The Multiparadigm Language G, Computer Languages, 1991, Vol. 16, No. 3 /4, pp ) Placer, J., The Promise of Multiparadigm Languages as Pedagogical Tools, Proceedings of the 21 st Annual ACM Computer Science Conference, February 15-18, 1993, pp , Indianapolis, IN. 11b3-18

Multi-Paradigm Approach for Teaching Programming

Multi-Paradigm Approach for Teaching Programming Multi-Paradigm Approach for Teaching Laxmi P Gewali* and John T Minor School of Computer Science University of Nevada, Las Vegas 4505 Maryland Parkway, Las Vegas Nevada 89154 Abstract: Selecting an appropriate

More information

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING Year & Semester : I Year / II Semester Section : CSE - I Subject Code : CS7203 Subject Name : PRINCIPLES OF PROGRAMMING LANGUAGES Degree & Branch : M.E C.S.E.

More information

Lecture Notes on Programming Languages

Lecture Notes on Programming Languages Lecture Notes on Programming Languages 85 Lecture 09: Support for Object-Oriented Programming This lecture discusses how programming languages support object-oriented programming. Topics to be covered

More information

Functional Programming. Big Picture. Design of Programming Languages

Functional Programming. Big Picture. Design of Programming Languages Functional Programming Big Picture What we ve learned so far: Imperative Programming Languages Variables, binding, scoping, reference environment, etc What s next: Functional Programming Languages Semantics

More information

Chapter 11 :: Functional Languages

Chapter 11 :: Functional Languages Chapter 11 :: Functional Languages Programming Language Pragmatics Michael L. Scott Copyright 2016 Elsevier 1 Chapter11_Functional_Languages_4e - Tue November 21, 2017 Historical Origins The imperative

More information

Programming Languages 2nd edition Tucker and Noonan"

Programming Languages 2nd edition Tucker and Noonan Programming Languages 2nd edition Tucker and Noonan" " Chapter 1" Overview" " A good programming language is a conceptual universe for thinking about programming. " " " " " " " " " " " " "A. Perlis" "

More information

Curriculum Map Grade(s): Subject: AP Computer Science

Curriculum Map Grade(s): Subject: AP Computer Science Curriculum Map Grade(s): 11-12 Subject: AP Computer Science (Semester 1 - Weeks 1-18) Unit / Weeks Content Skills Assessments Standards Lesson 1 - Background Chapter 1 of Textbook (Weeks 1-3) - 1.1 History

More information

REVIEW AND OUTLOOKS OF THE MEANS FOR VISUALIZATION OF SYNTAX SEMANTICS AND SOURCE CODE. PROCEDURAL AND OBJECT ORIENTED PARADIGM DIFFERENCES

REVIEW AND OUTLOOKS OF THE MEANS FOR VISUALIZATION OF SYNTAX SEMANTICS AND SOURCE CODE. PROCEDURAL AND OBJECT ORIENTED PARADIGM DIFFERENCES REVIEW AND OUTLOOKS OF THE MEANS FOR VISUALIZATION OF SYNTAX SEMANTICS AND SOURCE CODE. PROCEDURAL AND OBJECT ORIENTED PARADIGM DIFFERENCES Hristo Hristov Abstract. In the article, we have reviewed the

More information

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine.

1. true / false By a compiler we mean a program that translates to code that will run natively on some machine. 1. true / false By a compiler we mean a program that translates to code that will run natively on some machine. 2. true / false ML can be compiled. 3. true / false FORTRAN can reasonably be considered

More information

C++ Important Questions with Answers

C++ Important Questions with Answers 1. Name the operators that cannot be overloaded. sizeof,.,.*,.->, ::,? 2. What is inheritance? Inheritance is property such that a parent (or super) class passes the characteristics of itself to children

More information

Lists. Michael P. Fourman. February 2, 2010

Lists. Michael P. Fourman. February 2, 2010 Lists Michael P. Fourman February 2, 2010 1 Introduction The list is a fundamental datatype in most functional languages. ML is no exception; list is a built-in ML type constructor. However, to introduce

More information

What Is Computer Science? The Scientific Study of Computation. Expressing or Describing

What Is Computer Science? The Scientific Study of Computation. Expressing or Describing What Is Computer Science? The Scientific Study of Computation CMPSCI 630: Programming Languages Introduction Spring 2009 (with thanks to Robert Harper) Expressing or Describing Automating Understanding

More information

Modern Programming Languages. Lecture LISP Programming Language An Introduction

Modern Programming Languages. Lecture LISP Programming Language An Introduction Modern Programming Languages Lecture 18-21 LISP Programming Language An Introduction 72 Functional Programming Paradigm and LISP Functional programming is a style of programming that emphasizes the evaluation

More information

Coursework Master s Thesis Proposal

Coursework Master s Thesis Proposal Coursework Master s Thesis Proposal December 1999 University of South Australia School of Computer and Information Science Student: David Benn (9809422R) Supervisor: Dan Corbett Introduction Sowa s [1984]

More information

CS 242. Fundamentals. Reading: See last slide

CS 242. Fundamentals. Reading: See last slide CS 242 Fundamentals Reading: See last slide Syntax and Semantics of Programs Syntax The symbols used to write a program Semantics The actions that occur when a program is executed Programming language

More information

Course Syllabus. Programming Language Paradigms. Spring - DIS Copenhagen. Semester & Location: Elective Course - 3 credits.

Course Syllabus. Programming Language Paradigms. Spring - DIS Copenhagen. Semester & Location: Elective Course - 3 credits. Course Syllabus Programming Language Paradigms Semester & Location: Type & Credits: Spring - DIS Copenhagen Elective Course - 3 credits Major Disciplines: Faculty Members: Computer Science, Mathematics

More information

CIS 1.5 Course Objectives. a. Understand the concept of a program (i.e., a computer following a series of instructions)

CIS 1.5 Course Objectives. a. Understand the concept of a program (i.e., a computer following a series of instructions) By the end of this course, students should CIS 1.5 Course Objectives a. Understand the concept of a program (i.e., a computer following a series of instructions) b. Understand the concept of a variable

More information

4/19/2018. Chapter 11 :: Functional Languages

4/19/2018. Chapter 11 :: Functional Languages Chapter 11 :: Functional Languages Programming Language Pragmatics Michael L. Scott Historical Origins The imperative and functional models grew out of work undertaken by Alan Turing, Alonzo Church, Stephen

More information

Concepts of Programming Languages

Concepts of Programming Languages Concepts of Programming Languages Lecture 10 - Object-Oriented Programming Patrick Donnelly Montana State University Spring 2014 Patrick Donnelly (Montana State University) Concepts of Programming Languages

More information

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language

Chapter 11. Categories of languages that support OOP: 1. OOP support is added to an existing language Categories of languages that support OOP: 1. OOP support is added to an existing language - C++ (also supports procedural and dataoriented programming) - Ada 95 (also supports procedural and dataoriented

More information

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub

Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub Lebanese University Faculty of Science Computer Science BS Degree Graphical Interface and Application (I3305) Semester: 1 Academic Year: 2017/2018 Dr Antoun Yaacoub 2 Crash Course in JAVA Classes A Java

More information

6.001 Notes: Section 15.1

6.001 Notes: Section 15.1 6.001 Notes: Section 15.1 Slide 15.1.1 Our goal over the next few lectures is to build an interpreter, which in a very basic sense is the ultimate in programming, since doing so will allow us to define

More information

Programming Language Pragmatics

Programming Language Pragmatics Chapter 10 :: Functional Languages Programming Language Pragmatics Michael L. Scott Historical Origins The imperative and functional models grew out of work undertaken Alan Turing, Alonzo Church, Stephen

More information

CSE 12 Abstract Syntax Trees

CSE 12 Abstract Syntax Trees CSE 12 Abstract Syntax Trees Compilers and Interpreters Parse Trees and Abstract Syntax Trees (AST's) Creating and Evaluating AST's The Table ADT and Symbol Tables 16 Using Algorithms and Data Structures

More information

Informatica 3 Syntax and Semantics

Informatica 3 Syntax and Semantics Informatica 3 Syntax and Semantics Marcello Restelli 9/15/07 Laurea in Ingegneria Informatica Politecnico di Milano Introduction Introduction to the concepts of syntax and semantics Binding Variables Routines

More information

INCORPORATING ADVANCED PROGRAMMING TECHNIQUES IN THE COMPUTER INFORMATION SYSTEMS CURRICULUM

INCORPORATING ADVANCED PROGRAMMING TECHNIQUES IN THE COMPUTER INFORMATION SYSTEMS CURRICULUM INCORPORATING ADVANCED PROGRAMMING TECHNIQUES IN THE COMPUTER INFORMATION SYSTEMS CURRICULUM Charles S. Saxon, Eastern Michigan University, charles.saxon@emich.edu ABSTRACT Incorporating advanced programming

More information

COP4020 Programming Assignment 1 - Spring 2011

COP4020 Programming Assignment 1 - Spring 2011 COP4020 Programming Assignment 1 - Spring 2011 In this programming assignment we design and implement a small imperative programming language Micro-PL. To execute Mirco-PL code we translate the code to

More information

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction Lecture 13: Object orientation Object oriented programming Introduction, types of OO languages Key concepts: Encapsulation, Inheritance, Dynamic binding & polymorphism Other design issues Smalltalk OO

More information

Data Types The ML Type System

Data Types The ML Type System 7 Data Types 7.2.4 The ML Type System The following is an ML version of the tail-recursive Fibonacci function introduced Fibonacci function in ML in Section 6.6.1: EXAMPLE 7.96 1. fun fib (n) = 2. let

More information

LECTURE 16. Functional Programming

LECTURE 16. Functional Programming LECTURE 16 Functional Programming WHAT IS FUNCTIONAL PROGRAMMING? Functional programming defines the outputs of a program as a mathematical function of the inputs. Functional programming is a declarative

More information

CMSC 331 Final Exam Section 0201 December 18, 2000

CMSC 331 Final Exam Section 0201 December 18, 2000 CMSC 331 Final Exam Section 0201 December 18, 2000 Name: Student ID#: You will have two hours to complete this closed book exam. We reserve the right to assign partial credit, and to deduct points for

More information

Outline. Programming Languages 1/16/18 PROGRAMMING LANGUAGE FOUNDATIONS AND HISTORY. Current

Outline. Programming Languages 1/16/18 PROGRAMMING LANGUAGE FOUNDATIONS AND HISTORY. Current PROGRAMMING LANGUAGE FOUNDATIONS AND HISTORY Dr. John Georgas, Northern Arizona University Copyright John Georgas All Rights Reserved Outline Current Programming languages Compiled and interpreted implementations

More information

NOTE: Answer ANY FOUR of the following 6 sections:

NOTE: Answer ANY FOUR of the following 6 sections: A-PDF MERGER DEMO Philadelphia University Lecturer: Dr. Nadia Y. Yousif Coordinator: Dr. Nadia Y. Yousif Internal Examiner: Dr. Raad Fadhel Examination Paper... Programming Languages Paradigms (750321)

More information

Introduction. chapter Functions

Introduction. chapter Functions chapter 1 Introduction In this chapter we set the stage for the rest of the book. We start by reviewing the notion of a function, then introduce the concept of functional programming, summarise the main

More information

COP4020 Programming Languages. Functional Programming Prof. Robert van Engelen

COP4020 Programming Languages. Functional Programming Prof. Robert van Engelen COP4020 Programming Languages Functional Programming Prof. Robert van Engelen Overview What is functional programming? Historical origins of functional programming Functional programming today Concepts

More information

About Codefrux While the current trends around the world are based on the internet, mobile and its applications, we try to make the most out of it. As for us, we are a well established IT professionals

More information

Structured Knowledge Representation

Structured Knowledge Representation Intelligent Systems: Reasoning and Recognition James L. Crowley ENSIMAG 2 / MoSIG M1 Second Semester 2015/2016 Lesson 17 15 April 2016 Structured Knowledge Representation Object Oriented Programming...2

More information

Functional Programming Languages (FPL)

Functional Programming Languages (FPL) Functional Programming Languages (FPL) 1. Definitions... 2 2. Applications... 2 3. Examples... 3 4. FPL Characteristics:... 3 5. Lambda calculus (LC)... 4 6. Functions in FPLs... 7 7. Modern functional

More information

Support for Object-Oriented Testing

Support for Object-Oriented Testing Support for Object-Oriented Testing Michael Kolling School of Computer Science & Software Engineering Monash University Australia michael. kolling @ csse.monash. edu.au John Rosenberg Faculty of Information

More information

PROCESS DEVELOPMENT METHODOLOGY The development process of an API fits the most fundamental iterative code development

PROCESS DEVELOPMENT METHODOLOGY The development process of an API fits the most fundamental iterative code development INTRODUCING API DESIGN PRINCIPLES IN CS2 Jaime Niño Computer Science, University of New Orleans New Orleans, LA 70148 504-280-7362 jaime@cs.uno.edu ABSTRACT CS2 provides a great opportunity to teach an

More information

Organization of Programming Languages (CSE452) Why are there so many programming languages? What makes a language successful?

Organization of Programming Languages (CSE452) Why are there so many programming languages? What makes a language successful? Organization of Programming Languages (CSE452) Instructor: Dr. B. Cheng Fall 2004 1 Why are there so many programming languages? Evolution -- we've learned better ways of doing things over time Socio-economic

More information

Concepts of Programming Languages

Concepts of Programming Languages Concepts of Programming Languages Lecture 1 - Introduction Patrick Donnelly Montana State University Spring 2014 Patrick Donnelly (Montana State University) Concepts of Programming Languages Spring 2014

More information

CSC 326H1F, Fall Programming Languages. What languages do you know? Instructor: Ali Juma. A survey of counted loops: FORTRAN

CSC 326H1F, Fall Programming Languages. What languages do you know? Instructor: Ali Juma. A survey of counted loops: FORTRAN What languages do you know? CSC 326H1F, Programming Languages The usual suspects: C, C++, Java fine languages nearly the same Perhaps you've also learned some others? assembler Basic, Visual Basic, Turing,

More information

Absolute C++ Walter Savitch

Absolute C++ Walter Savitch Absolute C++ sixth edition Walter Savitch Global edition This page intentionally left blank Absolute C++, Global Edition Cover Title Page Copyright Page Preface Acknowledgments Brief Contents Contents

More information

CS61A Notes Week 1A: Basics, order of evaluation, special forms, recursion

CS61A Notes Week 1A: Basics, order of evaluation, special forms, recursion CS61A Notes Week 1A: Basics, order of evaluation, special forms, recursion Assorted Scheme Basics 1. The ( is the most important character in Scheme. If you have coded in other languages such as C or Java,

More information

Visual Prolog Tutorial

Visual Prolog Tutorial Visual Prolog Tutorial Jim Mims April 2008 (with modification by Danjie Zhu) Preface What is Prolog? Programming in Logic. Edinburgh syntax is the basis of ISO standard. High-level interactive language.

More information

Functional Languages. Hwansoo Han

Functional Languages. Hwansoo Han Functional Languages Hwansoo Han Historical Origins Imperative and functional models Alan Turing, Alonzo Church, Stephen Kleene, Emil Post, etc. ~1930s Different formalizations of the notion of an algorithm

More information

Programming Languages

Programming Languages Programming Languages As difficult to discuss rationally as religion or politics. Prone to extreme statements devoid of data. Examples: "It is practically impossible to teach good programming to students

More information

Al al-bayt University Prince Hussein Bin Abdullah College for Information Technology Computer Science Department

Al al-bayt University Prince Hussein Bin Abdullah College for Information Technology Computer Science Department Al al-bayt University Prince Hussein Bin Abdullah College for Information Technology Computer Science Department 0901212 Python Programming 1 st Semester 2014/2015 Course Catalog This course introduces

More information

Chapter 6 Introduction to Defining Classes

Chapter 6 Introduction to Defining Classes Introduction to Defining Classes Fundamentals of Java: AP Computer Science Essentials, 4th Edition 1 Objectives Design and implement a simple class from user requirements. Organize a program in terms of

More information

Programming Paradigms

Programming Paradigms Programming Paradigms Programming languages A Programming language is a notational system for describing tasks/computations in a machine and human readable form. Most computer languages are designed to

More information

Preface A Brief History Pilot Test Results

Preface A Brief History Pilot Test Results Preface A Brief History In Fall, 2005, Wanda Dann and Steve Cooper, originators of the Alice approach for introductory programming (in collaboration with Randy Pausch), met with Barb Ericson and Mark Guzdial,

More information

Reasoning About Programs Panagiotis Manolios

Reasoning About Programs Panagiotis Manolios Reasoning About Programs Panagiotis Manolios Northeastern University February 26, 2017 Version: 100 Copyright c 2017 by Panagiotis Manolios All rights reserved. We hereby grant permission for this publication

More information

Reading 1 : Introduction

Reading 1 : Introduction CS/Math 240: Introduction to Discrete Mathematics Fall 2015 Instructors: Beck Hasti and Gautam Prakriya Reading 1 : Introduction Welcome to CS 240, an introduction to discrete mathematics. This reading

More information

This course supports the assessment for Scripting and Programming Applications. The course covers 4 competencies and represents 4 competency units.

This course supports the assessment for Scripting and Programming Applications. The course covers 4 competencies and represents 4 competency units. This course supports the assessment for Scripting and Programming Applications. The course covers 4 competencies and represents 4 competency units. Introduction Overview Advancements in technology are

More information

6.001 Notes: Section 31.1

6.001 Notes: Section 31.1 6.001 Notes: Section 31.1 Slide 31.1.1 In previous lectures we have seen a number of important themes, which relate to designing code for complex systems. One was the idea of proof by induction, meaning

More information

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe

Copyright 2016 Ramez Elmasri and Shamkant B. Navathe Chapter 12 Outline Overview of Object Database Concepts Object-Relational Features Object Database Extensions to SQL ODMG Object Model and the Object Definition Language ODL Object Database Conceptual

More information

G Programming Languages - Fall 2012

G Programming Languages - Fall 2012 G22.2110-003 Programming Languages - Fall 2012 Lecture 2 Thomas Wies New York University Review Last week Programming Languages Overview Syntax and Semantics Grammars and Regular Expressions High-level

More information

M301: Software Systems & their Development. Unit 4: Inheritance, Composition and Polymorphism

M301: Software Systems & their Development. Unit 4: Inheritance, Composition and Polymorphism Block 1: Introduction to Java Unit 4: Inheritance, Composition and Polymorphism Aims of the unit: Study and use the Java mechanisms that support reuse, in particular, inheritance and composition; Analyze

More information

CPS 506 Comparative Programming Languages. Programming Language

CPS 506 Comparative Programming Languages. Programming Language CPS 506 Comparative Programming Languages Object-Oriented Oriented Programming Language Paradigm Introduction Topics Object-Oriented Programming Design Issues for Object-Oriented Oriented Languages Support

More information

Part I Basic Concepts 1

Part I Basic Concepts 1 Introduction xiii Part I Basic Concepts 1 Chapter 1 Integer Arithmetic 3 1.1 Example Program 3 1.2 Computer Program 4 1.3 Documentation 5 1.4 Input 6 1.5 Assignment Statement 7 1.5.1 Basics of assignment

More information

Week. Lecture Topic day (including assignment/test) 1 st 1 st Introduction to Module 1 st. Practical

Week. Lecture Topic day (including assignment/test) 1 st 1 st Introduction to Module 1 st. Practical Name of faculty: Gaurav Gambhir Discipline: Computer Science Semester: 6 th Subject: CSE 304 N - Essentials of Information Technology Lesson Plan Duration: 15 Weeks (from January, 2018 to April, 2018)

More information

CS422 - Programming Language Design

CS422 - Programming Language Design 1 CS422 - Programming Language Design Continuation-Passing Style (CPS) Transformation Grigore Roşu Department of Computer Science University of Illinois at Urbana-Champaign 2 On Data Versus Control Context

More information

Functional Languages. CSE 307 Principles of Programming Languages Stony Brook University

Functional Languages. CSE 307 Principles of Programming Languages Stony Brook University Functional Languages CSE 307 Principles of Programming Languages Stony Brook University http://www.cs.stonybrook.edu/~cse307 1 Historical Origins 2 The imperative and functional models grew out of work

More information

D Programming Language

D Programming Language Group 14 Muazam Ali Anil Ozdemir D Programming Language Introduction and Why D? It doesn t come with a religion this is written somewhere along the overview of D programming language. If you actually take

More information

OBJECT ORIENTED PROGRAMMING

OBJECT ORIENTED PROGRAMMING 1. Programming Paradigms OBJECT ORIENTED PROGRAMMING A programming methodology defines the methodology of designing and implementing programs using the key features and other building blocks (such as key

More information

Unit E Step-by-Step: Programming with Python

Unit E Step-by-Step: Programming with Python Unit E Step-by-Step: Programming with Python Computer Concepts 2016 ENHANCED EDITION 1 Unit Contents Section A: Hello World! Python Style Section B: The Wacky Word Game Section C: Build Your Own Calculator

More information

CSE : Python Programming

CSE : Python Programming CSE 399-004: Python Programming Lecture 2: Data, Classes, and Modules January 22, 2007 http://www.seas.upenn.edu/~cse39904/ Administrative things Teaching assistant Brian Summa (bsumma @ seas.upenn.edu)

More information

Mathematics/Science Department Kirkwood Community College. Course Syllabus. Computer Science CSC142 1/10

Mathematics/Science Department Kirkwood Community College. Course Syllabus. Computer Science CSC142 1/10 Mathematics/Science Department Kirkwood Community College Course Syllabus Computer Science CSC142 Bob Driggs Dean Cate Sheller Instructor 1/10 Computer Science (CSC142) Course Description Introduces computer

More information

Intro to OOP Visibility/protection levels and constructors Friend, convert constructor, destructor Operator overloading a<=b a.

Intro to OOP Visibility/protection levels and constructors Friend, convert constructor, destructor Operator overloading a<=b a. Intro to OOP - Object and class - The sequence to define and use a class in a program - How/when to use scope resolution operator - How/when to the dot operator - Should be able to write the prototype

More information

Chapter 3. Describing Syntax and Semantics

Chapter 3. Describing Syntax and Semantics Chapter 3 Describing Syntax and Semantics Chapter 3 Topics Introduction The General Problem of Describing Syntax Formal Methods of Describing Syntax Attribute Grammars Describing the Meanings of Programs:

More information

Curriculum Mapping for National Curriculum Statement Grades R-12 and Oracle Academy.

Curriculum Mapping for National Curriculum Statement Grades R-12 and Oracle Academy. Curriculum Mapping for National Curriculum Statement Grades R-12 and Oracle Academy. Contents Executive Summary... 3 IT Curriculum Overview... 3 Aims... 3 Oracle Academy Introduction to Computer Science...

More information

6.001 Notes: Section 8.1

6.001 Notes: Section 8.1 6.001 Notes: Section 8.1 Slide 8.1.1 In this lecture we are going to introduce a new data type, specifically to deal with symbols. This may sound a bit odd, but if you step back, you may realize that everything

More information

Software Design and Analysis for Engineers

Software Design and Analysis for Engineers Software Design and Analysis for Engineers by Dr. Lesley Shannon Email: lshannon@ensc.sfu.ca Course Website: http://www.ensc.sfu.ca/~lshannon/courses/ensc251 Simon Fraser University Slide Set: 1 Date:

More information

CPS122 Lecture: From Python to Java last revised January 4, Objectives:

CPS122 Lecture: From Python to Java last revised January 4, Objectives: Objectives: CPS122 Lecture: From Python to Java last revised January 4, 2017 1. To introduce the notion of a compiled language 2. To introduce the notions of data type and a statically typed language 3.

More information

CSCC24 Functional Programming Scheme Part 2

CSCC24 Functional Programming Scheme Part 2 CSCC24 Functional Programming Scheme Part 2 Carolyn MacLeod 1 winter 2012 1 Based on slides from Anya Tafliovich, and with many thanks to Gerald Penn and Prabhakar Ragde. 1 The Spirit of Lisp-like Languages

More information

CS 565: Programming Languages. Spring 2008 Tu, Th: 16:30-17:45 Room LWSN 1106

CS 565: Programming Languages. Spring 2008 Tu, Th: 16:30-17:45 Room LWSN 1106 CS 565: Programming Languages Spring 2008 Tu, Th: 16:30-17:45 Room LWSN 1106 Administrivia Who am I? Course web page http://www.cs.purdue.edu/homes/peugster/cs565spring08/ Office hours By appointment Main

More information

3D Graphics Programming Mira Costa High School - Class Syllabus,

3D Graphics Programming Mira Costa High School - Class Syllabus, 3D Graphics Programming Mira Costa High School - Class Syllabus, 2009-2010 INSTRUCTOR: Mr. M. Williams COURSE GOALS and OBJECTIVES: 1 Learn the fundamentals of the Java language including data types and

More information

Introducing Wybe a language for everyone

Introducing Wybe a language for everyone Introducing Wybe a language for everyone Peter Schachte joint work with Matthew Giuca The University of Melbourne Department of Computing and Information Systems 4 December 2013 Peter Schachte (Melbourne)

More information

JAVA CONCEPTS Early Objects

JAVA CONCEPTS Early Objects INTERNATIONAL STUDENT VERSION JAVA CONCEPTS Early Objects Seventh Edition CAY HORSTMANN San Jose State University Wiley CONTENTS PREFACE v chapter i INTRODUCTION 1 1.1 Computer Programs 2 1.2 The Anatomy

More information

8/27/17. CS-3304 Introduction. What will you learn? Semester Outline. Websites INTRODUCTION TO PROGRAMMING LANGUAGES

8/27/17. CS-3304 Introduction. What will you learn? Semester Outline. Websites INTRODUCTION TO PROGRAMMING LANGUAGES CS-3304 Introduction In Text: Chapter 1 & 2 COURSE DESCRIPTION 2 What will you learn? Survey of programming paradigms, including representative languages Language definition and description methods Overview

More information

It can be confusing when you type something like the expressions below and get an error message. a range variable definition a vector of sine values

It can be confusing when you type something like the expressions below and get an error message. a range variable definition a vector of sine values 7_april_ranges_.mcd Understanding Ranges, Sequences, and Vectors Introduction New Mathcad users are sometimes confused by the difference between range variables and vectors. This is particularly true considering

More information

Credit where Credit is Due. Lecture 4: Fundamentals of Object Technology. Goals for this Lecture. Real-World Objects

Credit where Credit is Due. Lecture 4: Fundamentals of Object Technology. Goals for this Lecture. Real-World Objects Lecture 4: Fundamentals of Object Technology Kenneth M. Anderson Object-Oriented Analysis and Design CSCI 6448 - Spring Semester, 2003 Credit where Credit is Due Some material presented in this lecture

More information

Chapter 9 :: Data Abstraction and Object Orientation

Chapter 9 :: Data Abstraction and Object Orientation Chapter 9 :: Data Abstraction and Object Orientation Programming Language Pragmatics Michael L. Scott Control or PROCESS abstraction is a very old idea (subroutines!), though few languages provide it in

More information

AADL Graphical Editor Design

AADL Graphical Editor Design AADL Graphical Editor Design Peter Feiler Software Engineering Institute phf@sei.cmu.edu Introduction An AADL specification is a set of component type and implementation declarations. They are organized

More information

An aside. Lecture 14: Last time

An aside. Lecture 14: Last time An aside Lecture 14: Recall from last time that aggregate() allowed us to combine data that referred to the same building; it is possible to implement this with lower-level tools in R Similarly, our dance

More information

Introduction to Programming Using Java (98-388)

Introduction to Programming Using Java (98-388) Introduction to Programming Using Java (98-388) Understand Java fundamentals Describe the use of main in a Java application Signature of main, why it is static; how to consume an instance of your own class;

More information

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011 CS152: Programming Languages Lecture 11 STLC Extensions and Related Topics Dan Grossman Spring 2011 Review e ::= λx. e x e e c v ::= λx. e c τ ::= int τ τ Γ ::= Γ, x : τ (λx. e) v e[v/x] e 1 e 1 e 1 e

More information

Weiss Chapter 1 terminology (parenthesized numbers are page numbers)

Weiss Chapter 1 terminology (parenthesized numbers are page numbers) Weiss Chapter 1 terminology (parenthesized numbers are page numbers) assignment operators In Java, used to alter the value of a variable. These operators include =, +=, -=, *=, and /=. (9) autoincrement

More information

Chapter 11 Object and Object- Relational Databases

Chapter 11 Object and Object- Relational Databases Chapter 11 Object and Object- Relational Databases Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 11 Outline Overview of Object Database Concepts Object-Relational

More information

Problem Solving with C++

Problem Solving with C++ GLOBAL EDITION Problem Solving with C++ NINTH EDITION Walter Savitch Kendrick Mock Ninth Edition PROBLEM SOLVING with C++ Problem Solving with C++, Global Edition Cover Title Copyright Contents Chapter

More information

B.C.A 2017 OBJECT ORIENTED PROGRAMMING USING C++ BCA303T MODULE SPECIFICATION SHEET

B.C.A 2017 OBJECT ORIENTED PROGRAMMING USING C++ BCA303T MODULE SPECIFICATION SHEET B.C.A 2017 OBJECT ORIENTED PROGRAMMING USING C++ BCA303T MODULE SPECIFICATION SHEET Course Outline The main objective of this course is to introduce students to the basic concepts of a selected language

More information

CS412/CS413. Introduction to Compilers Tim Teitelbaum. Lecture 17: Types and Type-Checking 25 Feb 08

CS412/CS413. Introduction to Compilers Tim Teitelbaum. Lecture 17: Types and Type-Checking 25 Feb 08 CS412/CS413 Introduction to Compilers Tim Teitelbaum Lecture 17: Types and Type-Checking 25 Feb 08 CS 412/413 Spring 2008 Introduction to Compilers 1 What Are Types? Types describe the values possibly

More information

Contents. Chapter 1 SPECIFYING SYNTAX 1

Contents. Chapter 1 SPECIFYING SYNTAX 1 Contents Chapter 1 SPECIFYING SYNTAX 1 1.1 GRAMMARS AND BNF 2 Context-Free Grammars 4 Context-Sensitive Grammars 8 Exercises 8 1.2 THE PROGRAMMING LANGUAGE WREN 10 Ambiguity 12 Context Constraints in Wren

More information

Functional Programming and Haskell

Functional Programming and Haskell Functional Programming and Haskell Tim Dawborn University of Sydney, Australia School of Information Technologies Tim Dawborn Functional Programming and Haskell 1/22 What are Programming Paradigms? A programming

More information

Semantics via Syntax. f (4) = if define f (x) =2 x + 55.

Semantics via Syntax. f (4) = if define f (x) =2 x + 55. 1 Semantics via Syntax The specification of a programming language starts with its syntax. As every programmer knows, the syntax of a language comes in the shape of a variant of a BNF (Backus-Naur Form)

More information

Object-Oriented Programming

Object-Oriented Programming 13 Object-Oriented Programming Exercises 13.1 Using Java as an example: 13.2 Code reuse: inhertiance, interfaces. In the case of an interface, any class implementing the Comparable interface can be sorted

More information

The Essence of Object Oriented Programming with Java and UML. Chapter 2. The Essence of Objects. What Is an Object-Oriented System?

The Essence of Object Oriented Programming with Java and UML. Chapter 2. The Essence of Objects. What Is an Object-Oriented System? Page 1 of 21 Page 2 of 21 and identity. Objects are members of a class, and the attributes and behavior of an object are defined by the class definition. The Essence of Object Oriented Programming with

More information

CSE413: Programming Languages and Implementation Racket structs Implementing languages with interpreters Implementing closures

CSE413: Programming Languages and Implementation Racket structs Implementing languages with interpreters Implementing closures CSE413: Programming Languages and Implementation Racket structs Implementing languages with interpreters Implementing closures Dan Grossman Fall 2014 Hi! I m not Hal J I love this stuff and have taught

More information

Part (04) Introduction to Programming

Part (04) Introduction to Programming Part (04) Introduction to Programming Dr. Ahmed M. ElShafee 1 Dr. Ahmed ElShafee, ACU : Summer 2014, Introduction to CS 1 EVOLUTION To write a program for a computer, we must use a computer language. A

More information