Evis Trandafili Polytechnic University of Tirana Albania Functional Programming Languages 1.

Slides:



Advertisements
Similar presentations
Developed by Reneta Barneva, SUNY Fredonia
Advertisements

Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
Visual Scripting of XML
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Lecture 1: Overview of Computers & Programming
CSI 3125, Preliminaries, page 1 Programming languages and the process of programming –Programming means more than coding. –Why study programming languages?
CHAPTER 1: AN OVERVIEW OF COMPUTERS AND LOGIC. Objectives 2  Understand computer components and operations  Describe the steps involved in the programming.
Introductory Comments Regarding Hardware Description Languages.
Programming Language Paradigms: summary. Object-oriented programming Objects are the fundamental building blocks of a program. Interaction is structured.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. slide 1 CS 125 Introduction to Computers and Object- Oriented Programming.
Chapter 2: Impact of Machine Architectures What is the Relationship Between Programs, Programming Languages, and Computers.
Chapter 1 Principles of Programming and Software Engineering.
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
© 2006 Pearson Addison-Wesley. All rights reserved2-1 Chapter 2 Principles of Programming & Software Engineering.
© 2004 Soar Technology, Inc.  July 14, 2015  Slide 1 Thinking… …inside the box Randolph M. Jones Commercializing Soar: Software Engineering Perspective.
“GENERIC SCRIPT” Everything can be automated, even automation process itself. “GENERIC SCRIPT” Everything can be automated, even automation process itself.
Abstraction: Polymorphism, pt. 1 Abstracting Objects.
CS190/295 Programming in Python for Life Sciences: Lecture 1 Instructor: Xiaohui Xie University of California, Irvine.
CASE Tools And Their Effect On Software Quality Peter Geddis – pxg07u.
Parallel Architectures
Microsoft Visual Basic 2012 CHAPTER ONE Introduction to Visual Basic 2012 Programming.
Calculus With Tech I Instructor: Dr. Chekad Sarami.
PROGRAMMING LANGUAGES The Study of Programming Languages.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Dr. Ken Hoganson, © August 2014 Programming in R STAT8030 Programming in R COURSE NOTES 1: Hoganson Programming Languages.
Invitation to Computer Science 5th Edition
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Carolyn Seaman University of Maryland, Baltimore County.
1 Chapter 5: Names, Bindings and Scopes Lionel Williams Jr. and Victoria Yan CSci 210, Advanced Software Paradigms September 26, 2010.
Chapter 8 High-Level Programming Languages (modified by Erin Chambers)
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
Introduction By: Dr. Javad Razjouyan. Programming Languages.
Chapter 1 Introduction Dr. Frank Lee. 1.1 Why Study Compiler? To write more efficient code in a high-level language To provide solid foundation in parsing.
CSCI-383 Object-Oriented Programming & Design Lecture 1.
1 CSC 221: Introduction to Programming Fall 2012 Functions & Modules  standard modules: math, random  Python documentation, help  user-defined functions,
Introduction To System Analysis and Design
Chapter 06 (Part I) Functions and an Introduction to Recursion.
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 17, 2013 Marie desJardins University of Maryland, Baltimore County.
Robert Vitolo CS474.  Branched off of ML (metalanguage)  Developed at Microsoft, available as part of the Visual Studio 2010 software package, integrated.
National Diploma Unit 4 Introduction to Software Development Introduction to Programming Languages.
Fall 2004EE 3563 Digital Systems Design EE 3563 VHSIC Hardware Description Language  Required Reading: –These Slides –VHDL Tutorial  Very High Speed.
1. 2 Preface In the time since the 1986 edition of this book, the world of compiler design has changed significantly 3.
Ted Pedersen – CS 3011 – Chapter 10 1 A brief history of computer architectures CISC – complex instruction set computing –Intel x86, VAX –Evolved from.
CS 127 Introduction to Computer Science. What is a computer?  “A machine that stores and manipulates information under the control of a changeable program”
FOUNDATION IN INFORMATION TECHNOLOGY (CS-T-101) TOPIC : INFORMATION SYSTEM – SOFTWARE.
1 Objectives ❏ To design and implement programs with more than one function ❏ To be able to design multi-function programs ❏ To understand the purpose.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
CS-303 Introduction to Programming
The Instruction Set Architecture. Hardware – Software boundary Java Program C Program Ada Program Compiler Instruction Set Architecture Microcode Hardware.
Understanding the difference between an engineer and a scientist There are many similarities and differences.
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
Chapter 1: Introduction to Visual Basic.NET: Background and Perspective Visual Basic.NET Programming: From Problem Analysis to Program Design.
Programming Language Concepts (CIS 635) Elsa L Gunter 4303 GITC NJIT,
Software. Introduction n A computer can’t do anything without a program of instructions. n A program is a set of instructions a computer carries out.
Microsoft Visual Basic 2015 CHAPTER ONE Introduction to Visual Basic 2015 Programming.
Sub-fields of computer science. Sub-fields of computer science.
Advanced Computer Systems
Learning to Program D is for Digital.
Introduction to Visual Basic 2008 Programming
GC101 Introduction to computers and programs
System Design.
ICS103 Programming in C Lecture 1: Overview of Computers & Programming
Unit# 8: Introduction to Computer Programming
CIS16 Application Development – Programming with Visual Basic
1.1 The Characteristics of Contemporary Processors, Input, Output and Storage Devices Types of Processors.
The Challenge of Cross - Language Interoperability
Vocabulary Algorithm - A precise sequence of instructions for processes that can be executed by a computer Low level programming language: A programming.
Rapid software development
Programming Languages, Preliminaries, History & Evolution
1.3.7 High- and low-level languages and their translators
Presentation transcript:

Evis Trandafili Polytechnic University of Tirana Albania Functional Programming Languages 1

Contents 2  Functional programming language in the hierarchy of programming languages.  There is a language for every task  What is a functional language?  Advantages and disadvantages.  How to implement in the Real World. Why F#?  Implementing F# in an application.

Functional Programming languages  DirectX,  Financial Engineering,  AI, Math’s,  Cryptology  Biological Sciences,  Engineering Operations  Management Inside the programming languages hierarchy 3 Fields of applications of functional programming

There’s a language for every task 4  It's possible to program in an object-oriented style in C, or a functional style in a scripting language. In truth, most modern languages incorporate features and ideas from multiple domains, which only serves to increase the richness and usefulness of these languages. Nevertheless, most languages do not excel at all styles of programming.

There’s a language for every task  Functional languages  Excel at mathematically-oriented programming, and, given the right libraries and visualization tools, a range of scientific and engineering tasks as well.  Extremely powerful when used to implement sophisticated symbolic analyses such as  Hardware verification,  Software verification,  Optimization,  Machine learning  Compilation. 5

What is a Functional Language?  One that relies on equations.  Ex. When you use a functional language, X = Y means that X and Y are equal. You aren’t assigning the value of Y to X.  There isn’t any state to consider or mutable data to manage.  Functional programs typically make little use of stored state, often abstaining loops in favor of recursive functions. The primary focus of functional programming is on the return values of functions, and side effects and other means storing state are strongly discouraged. 6

Advantages  In a pure functional language, if a function is called, it is expected that the function not modify any global variables or perform any output. It may, however, make recursive calls and change the parameters of those calls.  Functional languages are often simpler syntactically and make it easier to work on abstract problems, but they can also be "further from the machine" in that their programming model makes it hard to understand exactly how the code is translated into machine language (which can be problematic for system programming).  Functional code, particularly used in the areas where you have to eliminate concurrency.  Type inferencing, type information can stay out of the programmer’s way, less explicit code needed to make the compiler happy, which in turn means that you can express the same concepts in less code. 7

Disadvantages  The major disadvantage of functional programming is the difficulty of doing input- output since this is inherently non functional. There are also other aspects of problem solving that cannot easily or sensibly be performed in a functional manner.  Nevertheless large programs can be developed with about 80% of the code being designed purely functionally. 8

Functional programming in the Real World  F# is an effort to make functional languages useful in the real world (not only academic use). Not only can you mix and match F# with C# or VB.NET (part of Visual Studio 2010), but you can use it to create scripts and perform other complex tasks on its own. 9

What sort of language is F#?  F# is not simply a functional language: it is a multi- paradigm language that attempts to capture the best of both functional and object-oriented programming.  Even when used as a purely functional language F# is remarkable for the sheer power of the libraries and tools available.  You create the application using equations and then supply data to those equations. An equation can be a constant, a function, an object, or anything else that F# supports.  Strengths of F#:  List processing  Pattern matching (regular expressions)  Concurrent programming strategies 10

Important Considerations  The final use. Perhaps the most important.  Within a few years, almost every computer will have about 16 cores, so there is a huge need for programming paradigms or idioms that help developers write concurrent software easily  Today applications can’t make use of the additional processors because they aren’t written to exploit them.  Many applications use just a single core and the remaining cores tend to remain idle or at least underused.  F# tends to enforce the requirements for concurrency and make writing these applications considerably easier.  You get these benefits without extra work on your part because they are part of the F# language. 11

Functional programming applications  The image shows F# running a program using DirectX from.NET 12

F# is very well suited to simulation and scientific computing  Uses F# to represent - extremely succinctly code - a simulated, animated surface.  The application creates a surface representing a function over X & Y coordinates as well as being a function of time. 13

Biological statistics  Studying the population genes is expensive and impossible if we want information about past genetic population map.  Surnames carry inheritance in male line.  Using surnames in spite of AND information.  What to measure? Indices… izonimy (how homogene is the population in some specific area), Lasker indice (probability that 2 random genes from 2 populations are the same), etc… 14

How to implement this using F#?  Analyze the demographic migration in Albanian territory during the last century.  The population integrity of a given area during a given period.  Based on the existing digital system for population registration.  I ii = Σ k (p ik ) 2 – 1/N i  Mean population indicator of izonomy. 15

16