- second oldest high level
language (fortran)
- John McCarthy (MIT)
- list processing

- garbage collector
(defun factorial (n)
  (if (<= n 1)
      1
      (* n (factorial (- n 1)))))
- meta language
- type inference
- static typing

- garbage collector
fun fac 0 = 1
  | fac n = n * fac (n - 1)
- SML
-- research, compiler
development

- Caml
-- Categorical Abstract
Machine Language
-- lisp / C
-- OCaml
- .NET
- OCaml compatible
- both object oriented
and functional
components
let rec factorial n =
    match n with
    | 0 -> 1
    | _ -> n * factorial (n - 1)
fac(0) -> 1;
fac(N) -> N * fac(N-1).
- pure
- lazy evaluation
- type system
-- type
factorial :: Integer -> Integer

-- using recursion
factorial 0 = 1
factorial n = n * factorial (n - 1)

-- using lists
factorial n = product [1..n]
- JVM
- java compatible
- java -> FP
class Factorial {
  def factorial(n: Int): Int = {
    def factorialAcc(acc: Int, n: Int): Int = {
      if (n <= 1) acc
      else factorialAcc(n * acc, n - 1)
    }
    factorialAcc(1, n)
  }
}
- JVM
- LISP
- java integration via
macros
(def factorial
  (fn [n]
    (loop [cnt n acc 1]
       (if (zero? cnt)
            acc
          (recur (dec cnt) (* acc cnt))))))
- memory save
- no global GC
- no shared mutable
state
fn f(int x) -> int {
  if (x == 1) {
    ret 1;
  } else {
    ret x * f(x-1);
  }
}

fn main () {
  check (f(5) == 120);
}
- next gen language
- open call 2002
- grants for development
- IBM, SUN, Cray

- easy for researchers
- JVM or C++
- partitioned global
address space

- parent child locking
- fortran concept
- scala, haskell syntax
- syntax mathematical
notation
- if possible library
implementation
- for loop lib function
- smalltalk VM
- compatible to squeak
- IBM research
| count factorial |
count := 0.
factorial := 1.
[ count > 0 ] whileTrue:
    [ factorial := factorial *
        (count := count - 1) ]
Transcript show: factorial
- logic programming
language
- natural language
processing
-
fact(0, 1).
fact(X, Y):-
    X > 0 ,X1 is X-1, fact(X1, Z), Y is X*Z.
thanks

Linuxconf 2011 parallel languages talk

  • 10.
    - second oldesthigh level language (fortran) - John McCarthy (MIT) - list processing - garbage collector
  • 11.
    (defun factorial (n) (if (<= n 1) 1 (* n (factorial (- n 1)))))
  • 12.
    - meta language -type inference - static typing - garbage collector
  • 13.
    fun fac 0= 1 | fac n = n * fac (n - 1)
  • 14.
    - SML -- research,compiler development - Caml -- Categorical Abstract Machine Language -- lisp / C -- OCaml
  • 15.
    - .NET - OCamlcompatible - both object oriented and functional components
  • 16.
    let rec factorialn = match n with | 0 -> 1 | _ -> n * factorial (n - 1)
  • 18.
    fac(0) -> 1; fac(N)-> N * fac(N-1).
  • 19.
    - pure - lazyevaluation - type system
  • 20.
    -- type factorial ::Integer -> Integer -- using recursion factorial 0 = 1 factorial n = n * factorial (n - 1) -- using lists factorial n = product [1..n]
  • 21.
    - JVM - javacompatible - java -> FP
  • 22.
    class Factorial {  def factorial(n: Int): Int = {     def factorialAcc(acc: Int, n: Int): Int = {       if (n <= 1) acc       else factorialAcc(n * acc, n - 1)     }     factorialAcc(1, n)   } }
  • 23.
    - JVM - LISP -java integration via macros
  • 24.
    (def factorial (fn [n] (loop [cnt n acc 1] (if (zero? cnt) acc (recur (dec cnt) (* acc cnt))))))
  • 25.
    - memory save -no global GC - no shared mutable state
  • 26.
    fn f(int x)-> int { if (x == 1) { ret 1; } else { ret x * f(x-1); } } fn main () { check (f(5) == 120); }
  • 28.
    - next genlanguage - open call 2002 - grants for development - IBM, SUN, Cray - easy for researchers
  • 29.
    - JVM orC++ - partitioned global address space - parent child locking
  • 30.
    - fortran concept -scala, haskell syntax - syntax mathematical notation - if possible library implementation - for loop lib function
  • 32.
    - smalltalk VM -compatible to squeak - IBM research
  • 33.
    | count factorial| count := 0. factorial := 1. [ count > 0 ] whileTrue: [ factorial := factorial * (count := count - 1) ] Transcript show: factorial
  • 35.
    - logic programming language -natural language processing -
  • 36.
    fact(0, 1). fact(X, Y):-    X > 0 ,X1 is X-1, fact(X1, Z), Y is X*Z.
  • 39.