Languages & Paradigms What s a Language? It s a form of - - PDF document

languages paradigms
SMART_READER_LITE
LIVE PREVIEW

Languages & Paradigms What s a Language? It s a form of - - PDF document

Languages & Paradigms What s a Language? It s a form of expression To communicate your intent To program a computer 2 What Makes a Program? Language Syntax + Semantics + Algorithms 3 What Makes a Program? Language Syntax +


slide-1
SLIDE 1

Languages & Paradigms

What’ s a Language?

It’ s a form of expression To communicate your intent To program a computer

2

slide-2
SLIDE 2

What Makes a Program?

3

Language Syntax Semantics Algorithms + +

What Makes a Program?

4

Language Syntax Semantics Algorithms + + Form Meaning How Language Design

slide-3
SLIDE 3

What’ s Makes It Special?

It’ s not the syntax of a language that is most interesting It is the paradigm and the idioms What you can do and how you often realize it Conventional wisdom from advanced programmers

5

Language Purpose/Target

General Purpose Languages Can be used for general programming Somewhat of a Swiss army knife Domain Specific Languages Targeted at a particular narrow domain Small, focused, not generally considered as full programming languages

6

slide-4
SLIDE 4

What Languages you’ve Used?

7

Language Paradigms

8

Imperative Object-Oriented Concurrent Functional Logic Scripting

slide-5
SLIDE 5

Language Paradigms

Languages do not fall exclusively into a particular type By design, generally, they opt in to more than one type

9

Imperative

To tell how to do things You typically use variables, commands, procedure Sequence of instructional commands Mutable state

10

slide-6
SLIDE 6

OO

Abstraction Encapsulation * Inheritance Polumorphism *

11

Concurrent

Concurrent Processes Higher level of abstraction to exploit concurrency

12

slide-7
SLIDE 7

Functional

Functions as Higher order, first class citizens Assignment-less programming

13

Logic

Infer relationships Predicate logic

14

slide-8
SLIDE 8

Scripting

Commands to execute system level operations, text manipulation, transformations, ...

15

Language Paradigms

16

slide-9
SLIDE 9

Control Structures

Statements Expressions Assignments Unconditional jumps Conditionals: if, if-else, switch Iterative: for, while, until,... Procedures/Subroutines

17

Most Powerful Language!

18

Created in 1950s by John McCarthy Modern Languages are still trying to catch up to it! Lisp

slide-10
SLIDE 10

What’ s Lisp?

19

It stands of “Lots of Insignificant Silly Parenthesis” At least that’ s what people who dislike it call Lisp syntax is quite intimidating Was not written with performance in mind Ignore that, there is a beautiful language in there Scheme is a derivative Clojure is Lisp on the JVM It’ s actually “List Processing”

What Made Lisp Special

Paul Graham’ s list

20

  • 1. Conditionals
  • 2. A function type
  • 3. Recursion
  • 4. Concept of variables
  • 5. Garbage-collection
  • 6. Composed of Expressions

7 . A symbol type

  • 8. Notation for tree of symbols
  • 9. Whole Program always available
slide-11
SLIDE 11

Exercise

In your favorite language, write a shortest program that prints “Hello World!”

21