• Express the intent of programs through logical steps • Specify what is computed, not how • Functional programming (based on mathematical functions) • Higher-order functions for composition and reduction • Abstract data types, inheritance, polymorphism • Improve the clarity of programs through block structures and subroutines. • Model the "real-world" • Object-oriented programming • Class-based vs. prototype based • Programs written for parallel computation • Distributed computing across processors (CPU and GPU) • Message passing, actor model • States, sequences and assignments • Define sequences of commands to accomplish tasks • Procedural programming
case class Value class Counter extends Actor { var counter: Int = 0; def act() = { while (true) { receive { case Inc(amount) => counter += amount case Value => println("Value is "+counter) exit() } } } } object ActorTest extends Application { val counter = new Counter counter.start() for (i <- 0 until 100000) { counter ! Inc(1) } counter ! Value // Output: Value is 100000 } PARALLEL PROGRAMMING