11/30

Comparative Programming Languages

Haskell

Prolog

Language structures, characteristics

 

Paradigms:

  • functional
  • object-oriented
  • logic
  • imperative
  • declarative

Compiled vs. Interpreted:

  • Compiler
  • Interpreter

Typing

  • Static
  • Dynamic
  • duck typing
  • strict typing
  • type inference (haskell)
  • type checking

Binding

  • Static
  • Dynamic

Memory Management

  • garbage collection
  • manual memory management

Concurrency:

  • Parallelism
  • threads
  • sharing memory
  • processes

Portability

Efficiency (Programmer, Computation)

Closures

  • First-class functions
  • First class citizen

Mutability (haskell is immutable)

Domain Specific Languages

Mixed Language Programming

 

Haskell

  • Archetypal Functional Programming Language
  • Recursion => tail recursion
  • Pattern matching
  • lists, list comprehension
  • let and where
  • Types, user defined types
  • partial functions
  • Currying
    • works on one argument at a time
    • every function takes one argument (return other functions to deal with other arguments)
  • curry, uncurry
  • lazy evaluation
  • monads
    • IO
    • Random #
    • functional purity

 

f x = 2 * (x + x)

(*) 2 $ x + x

 

foldl, foldl1 => returns a value

lambda notation

map => returns list

zipWidth

 

 

 

Advertisements