Component Abstractions in Scala The Basics

Size: px
Start display at page:

Download "Component Abstractions in Scala The Basics"

Transcription

1 Component Abstractions in Scala The Basics LASER Summer School, 2012 Martin Odersky Typesafe and EPFL

2 A Paradigm Shift The world of software is changing because of hardware trends. Moore s law now achieved by increasing # of cores not clock cycles Huge volume workloads that require horizontal scaling Data from Kunle Olukotun, Lance Hammond, Herb Sutter, Burton Smith, Chris Batten, and Krste Asanovic 2

3 Concurrent Programming to the Today, an often heard answer is concurrent programming, using Threads and locks, Actors with messages, or Agents, or STM All these concepts are useful and essential for many apps. But they alone will not solve the PPP Challenge. Fundamental problem: non-determinism Rescue? Leads to Heisenbugs, different behavior on different hardware, etc class Person(val name:string, val age: Int) new Actor { def receive = { case people: Set[Person] => val (minors, adults) = people partition (_.age < 18) Facebook! minors LinkedIn! adults 3

4 The Root of the Problem Non-determinism caused by concurrent threads accessing shared mutable state. We can encapsulate state in actors or transactions, but the fundamental problem is the same. var x = 0 async { x = x + 1 async { x = x * 2 // can give 0, 1, 2 So, non-determinism = parallel processing + mutable state To get deterministic processing, avoid the mutable state! Avoiding mutable state means programming functionally 4

5 Space vs Time Space (functional/parallel) Time (imperative/concurrent) 5

6 What about Objects? So, should we forget OO and all program in functional programming languages? No! What the industry learned about OO decomposition in analysis and design stays valid. Central question: What goes where? In the end, need to put things somewhere, or risk unmanageable global namespace. 6

7 New Objects Previously: Objects are characterized by state, identity, and behavior. (Booch) Now: Eliminate or reduce mutable state. Structural equality instead of reference identity. Concentrate on functionality (behavior) 7

8 New Objects What about: Tell, don t ask.? This advice is due to the Von-Neumann bottleneck (Backus), i.e. the tendency to communicate with small, primitive values. Now: Ask to construct 8

9 Scala: An object-functional language Scala has established itself as one of the main alternative languages on the JVM. Prehistory: : Pizza : GJ, Java generics, javac ( make Java better ) Timeline: : The Scala Experiment : An industrial strength programming language ( make a better Java ) 1-9

10 Scala Community Community growing 100%+ annually 25+ books 60+ active user groups Sold out Scala Days conference with 400 attendees, 60+ talks job trends on indeed.com 10

11 Github vs. Stack Overflow RedMonk: Revisiting the Dataists Programming Language Rankings Typesafe Confidential 11

12 Select Commercial Users Migrated core messaging service from Ruby to Scala to sustain 3 orders of magnitude growth Scala drives the core LinkedIn social graph service with 400+ million transactions per day "Nearly our entire server codebase is written in Scala. This has worked out super well." With Akka we deliver systems that meet the most strict performance requirements in a near-realtime environment.

13 Scala cheat sheet (1): Definitions Scala method definitions: def fun(x: Int): Int = { result or def fun(x: Int) = result def fun = result Java method definition: int fun(int x) { return result; (no parameterless methods) Scala variable definitions: var x: Int = expression val x: String = expression or var x = expression val x = expression Java variable definitions: int x = expression final String x = expression 2-13

14 Scala cheat sheet (2): Expressions Scala method calls: obj.meth(arg) or obj meth arg Scala choice expressions: if (cond) expr1 else expr2 expr match { case pat 1 => expr 1... case pat n => expr n Java method call: obj.meth(arg) (no operator overloading) Java choice expressions, stats: cond? expr1 : expr2 if (cond) return expr1; else return expr2; switch (expr) { case pat 1 : return expr 1 ;... case pat n : return expr n ; // statement only 2-14

15 Scala cheat sheet (3): Objects and Classes Scala Class and Object Java Class with static class Sample(x: Int) { def instmeth(y: Int) = x + y object Sample { def staticmeth(x:int, y:int) = x * y class Sample { final int x; Sample(int x) { this.x = x int instmeth(int y) { return x + y; static int staticmeth(int x,int y) { return x * y; 2-15

16 Scala cheat sheet (4): Traits Scala Trait trait T { def absmeth(x:string):string def concretemeth(x: String) = x+field Java Interface interface T { String absmeth(string x) (no concrete methods) var field =! (no fields) Scala mixin composition: class C extends Super with T Java extension + implementation: class C extends Super implements T 2-16

17 Scala cheat sheet (5): Packages and Imports Scala Package Clause Java Package Clause package org.project.module package org.project.module; or package org.project package module Scala Import Java import import collection.mutable.map import collection.mutable._ import collection.mutable.{ Map => mmap import collection.mutable.map; import collection.mutable.*; (no import renaming) 2-17

18 Scala s Type Hierarchy 2-18

19 Top Types: Any, AnyRef, AnyVal Any The base type of all types Methods: ==,!=, equals ##, hashcode tostring asinstanceof isinstanceof AnyRef The base type of all reference types, alias of java.lang.object Methods: eq, ne AnyVal The base types of all value types 2-19

20 The Nothing Type Nothing is a type without any values. Why is that useful? To signal abnormal termination: throw new Error() has type Nothing As an element of empty collections. The two meanings hang together: Taking an element of a List[Nothing] has type Nothing, and will not terminate normally. 2-20

21 The Null Type The null value also has a type in Scala; it is called Null scala> val x = null x: Null = null Null is a subtype of every reference type in Scala, but it is not compatible with value types. scala> val x: String = null x: String = null scala> val x: Int = null <console>:7: error: type mismatch; found : Null(null) required: Int val x: Int = null ^ 2-21

22 A Closer Look at Collections De-emphasize destructive updates Focus on transformers that map collections to collections Have a complete range of immutable, persistent collections scala> val ys = List(1, 2, 3) ys: List[Int] = List(1, 2, 3) scala> val xs: Seq[Int] = ys xs: Seq[Int] = List(1, 2, 3) scala> xs map (_ + 1) res0: Seq[Int] = List(2, 3, 4) scala> ys map (_ + 1) res1: List[Int] = List(2, 3, 4) 13

23 Using Collections: Map and filter scala> val xs = List(1, 2, 3) xs: List[Int] = List(1, 2, 3) scala> val ys = xs map (x => x + 1) ys: List[Int] = List(2, 3, 4) scala> val ys = xs map (_ + 1) ys: List[Int] = List(2, 3, 4) scala> val zs = ys filter (_ % 2 == 0) zs: List[Int] = List(2, 4) scala> val as = ys map (0 to _) as: List(Range(0, 1, 2), Range(0, 1, 2, 3), Range(0, 1, 2, 3, 4)) 23

24 Using Collections: flatmap and groupby scala> val bs = as.flatten bs: List[Int] = List(0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4) scala> val bs = ys flatmap (0 to _) bs: List[Int] = List(0, 1, 2, 0, 1, 2, 3, 0, 1, 2, 3, 4) scala> val fruit = Vector("apple", pear", pineapple") fruit: Vector[String] = Vector(apple, pear, pineapple) scala> fruit groupby (_.head) res11: scala.collection.immutable.map[char,vector[string]] = Map(a -> Vector(apple), p -> Vector(pear, pineapple)) 24

25 Using Collections: For Notation scala> for (x <- xs) yield x + 1 res14: List[Int] = List(2, 3, 4) // same as map scala> for (x <- res14 if x % 2 == 0) yield x res15: List[Int] = List(2, 4) // ~ filter scala> for (x <- xs; y <- 0 to x) yield y res17: List[Int] = List(0, 1, 0, 1, 2, 0, 1, 2, 3) // same as flatmap 25

26 Using Maps scala> val m = Map(1 -> "ABC", 2 -> "DEF", 3 -> "GHI") m: Map[Int, String] = Map(1 -> ABC, 2 -> DEF, 3-> GHI) scala> m(2) res0: String = DEF scala> m + (4 -> "JKL") res1: Map[Int, String] = Map(1 -> ABC, 2 -> DEF, 3 -> GHI, 4 -> JKL) scala> m map { case (k, v) => (v, k) res8: Map[String,Int] = Map(ABC -> 1, DEF -> 2, GHI -> 3) 26

27 An Example Task: Phone keys have mnemonics assigned to them. val mnemonics = Map( '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ") Assume you are given a dictionary dict as a list of words. Design a class Coder with a method translate such that new Coder(dict).translate(phoneNumber) produces all phrases of words in dict that can serve as mnemonics for the phone number. Example: The phone number should have the mnemonic Scala rocks as one element of the list of solution phrases. 27

28 Program Example: Phone Mnemonics This example was taken from: Lutz Prechelt: An Empirical Comparison of Seven Programming Languages. IEEE Computer 33(10): (2000) Tested with Tcl, Python, Perl, Rexx, Java, C++, C Code size medians: 100 loc for scripting languages loc for the others 28

29 Outline of Class Coder class Coder(words: List[String]) { private val mnemonics = Map( '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ") /** Invert the mnemonics map to give a map from chars 'A'... 'Z' to '2'... '9' */ private val charcode: Map[Char, Char] =?? /** Maps a word to the digit string it can represent, e.g. Java -> 5282 */ private def wordcode(word: String): String =?? /** A map from digit strings to the words that represent them, * e,g > Set( Java, Kata, Lava,...) */ private val wordsfornum: Map[String, Set[String]] =?? /** Return all ways to encode a number as a list of words */ def encode(number: String): Set[List[String]] =?? /** Maps a number to a list of all word phrases that can represent it */ def translate(number: String): Set[String] = encode(number) map (_ mkstring " ") 29

30 Class Coder (1) class Coder(words: List[String]) { private val mnemonics = Map( '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ") /** Invert the mnemonics map to give a map from chars 'A'... 'Z' to '2'... '9' */ private val charcode: Map[Char, Char] = /** Maps a word to the digit string it can represent */ private def wordcode(word: String): String =?? /** A map from digit strings to the words that represent them */ private val wordsfornum: Map[String, List[String]] =?? /** Return all ways to encode a number as a list of words */ def encode(number: String): Set[List[String]] =?? /** Maps a number to a list of all word phrases that can represent it */ def translate(number: String): Set[String] = encode(number) map (_ mkstring " ") 30

31 Class Coder (1) class Coder(words: List[String]) { private val mnemonics = Map( '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ") /** Invert the mnemonics map to give a map from chars 'A'... 'Z' to '2'... '9' */ private val charcode: Map[Char, Char] = for ((digit, str) <- mnemonics; ltr <- str) yield (ltr -> digit) /** Maps a word to the digit string it can represent */ private def wordcode(word: String): String =?? /** A map from digit strings to the words that represent them */ private val wordsfornum: Map[String, List[String]] =?? /** Return all ways to encode a number as a list of words */ def encode(number: String): Set[List[String]] =?? /** Maps a number to a list of all word phrases that can represent it */ def translate(number: String): Set[String] = encode(number) map (_ mkstring " ") 31

32 Class Coder (2) class Coder(words: List[String]) { private val mnemonics = Map( '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ") /** Invert the mnemonics map to give a map from chars 'A'... 'Z' to '2'... '9' */ private val charcode: Map[Char, Char] = for ((digit, str) <- m; letter <- str) yield (letter -> digit) /** Maps a word to the digit string it can represent, e.g. Java -> 5282 */ private def wordcode(word: String): String = /** A map from digit strings to the words that represent them */ private val wordsfornum: Map[String, Set[String]] =?? /** Return all ways to encode a number as a list of words */ def encode(number: String): Set[List[String]] =?? /** Maps a number to a list of all word phrases that can represent it */ def translate(number: String): Set[String] = encode(number) map (_ mkstring " ") 32

33 Class Coder (2) class Coder(words: List[String]) { private val mnemonics = Map( '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ") /** Invert the mnemonics map to give a map from chars 'A'... 'Z' to '2'... '9' */ private val charcode: Map[Char, Char] = for ((digit, str) <- m; letter <- str) yield (letter -> digit) /** Maps a word to the digit string it can represent, e.g. Java -> 5282 */ private def wordcode(word: String): String = word.touppercase map charcode /** A map from digit strings to the words that represent them */ private val wordsfornum: Map[String, Set[String]] =?? /** Return all ways to encode a number as a list of words */ def encode(number: String): Set[List[String]] =?? /** Maps a number to a list of all word phrases that can represent it */ def translate(number: String): Set[String] = encode(number) map (_ mkstring " ") 33

34 Class Coder (3) class Coder(words: List[String]) { private val mnemonics = Map( '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ") /** Invert the mnemonics map to give a map from chars 'A'... 'Z' to '2'... '9' */ private val charcode: Map[Char, Char] = for ((digit, str) <- m; letter <- str) yield (letter -> digit) /** Maps a word to the digit string it can represent */ private def wordcode(word: String): String = word.touppercase map charcode /** A map from digit strings to the words that represent them, * e,g > Set( Java, Kata, Lava,...) */ private val wordsfornum: Map[String, List[String]] = /** Return all ways to encode a number as a list of words */ def encode(number: String): Set[List[String]] =?? /** Maps a number to a list of all word phrases that can represent it */ def translate(number: String): Set[String] = encode(number) map (_ mkstring " ") 34

35 Class Coder (3) class Coder(words: List[String]) { private val mnemonics = Map( '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ") /** Invert the mnemonics map to give a map from chars 'A'... 'Z' to '2'... '9' */ private val charcode: Map[Char, Char] = for ((digit, str) <- m; letter <- str) yield (letter -> digit) /** Maps a word to the digit string it can represent */ private def wordcode(word: String): String = word.touppercase map charcode /** A map from digit strings to the words that represent them, * e,g > Set( Java, Kata, Lava,...) */ private val wordsfornum: Map[String, List[String]] = (words groupby wordcode) withdefaultvalue Nil /** Return all ways to encode a number as a list of words */ def encode(number: String): Set[List[String]] =?? /** Maps a number to a list of all word phrases that can represent it */ def translate(number: String): Set[String] = encode(number) map (_ mkstring " ") 35

36 Class Coder (4) class Coder(words: List[String]) {... /** Return all ways to encode a number as a list of words */ def encode(number: String): Set[List[String]] = /** Maps a number to a list of all word phrases that can represent it */ def translate(number: String): Set[String] = encode(number) map (_ mkstring " ") 36

37 Class Coder (4) class Coder(words: List[String]) {... /** Return all ways to encode a number as a list of words */ def encode(number: String): Set[List[String]] = if (number.isempty) Set(List()) /** Maps a number to a list of all word phrases that can represent it */ def translate(number: String): Set[String] = encode(number) map (_ mkstring " ") 37

38 Class Coder (4) class Coder(words: List[String]) {... /** Return all ways to encode a number as a list of words */ def encode(number: String): Set[List[String]] = if (number.isempty) Set(List()) else { for { splitpoint <- 1 to number.length /** Maps a number to a list of all word phrases that can represent it */ def translate(number: String): Set[String] = encode(number) map (_ mkstring " ") 38

39 Class Coder (4) class Coder(words: List[String]) {... /** Return all ways to encode a number as a list of words */ def encode(number: String): Set[List[String]] = if (number.isempty) Set(List()) else { for { splitpoint <- 1 to number.length word <- wordsfornum(number take splitpoint) /** Maps a number to a list of all word phrases that can represent it */ def translate(number: String): Set[String] = encode(number) map (_ mkstring " ") 39

40 Class Coder (4) class Coder(words: List[String]) {... /** Return all ways to encode a number as a list of words */ def encode(number: String): Set[List[String]] = if (number.isempty) Set(List()) else { for { splitpoint <- 1 to number.length word <- wordsfornum(number take splitpoint) rest <- encode(number drop splitpoint) yield word :: rest.toset /** Maps a number to a list of all word phrases that can represent it */ def translate(number: String): Set[String] = encode(number) map (_ mkstring " ") 40

41 A solution in Java by the expert 41

42 Going Further In Scala 2.9, collections support parallel operations. Two new methods: c.par returns parallel version of collection c c.seq returns sequential version of collection c The right tool for addressing the PPP (popular parallel programming) challenge. I expect this to be the cornerstone for making use of multicores for the rest of us. 42

43 a parallel collection Parallel Coder class Coder(words: ParVector[String]) { private val mnemonics = Map( '2' -> "ABC", '3' -> "DEF", '4' -> "GHI", '5' -> "JKL", '6' -> "MNO", '7' -> "PQRS", '8' -> "TUV", '9' -> "WXYZ") /** Invert the mnemonics map to give a map from chars 'A'... 'Z' to '2'... '9' */ private val charcode: Map[Char, Char] = for ((digit, str) <- m; letter <- str) yield (letter -> digit) /** Maps a word to the digit string it can represent */ private def wordcode(word: String): String = word.touppercase map charcode /** A map from digit strings to the words that represent them */ private val wordsfornum: Map[String, List[String]] = words groupby wordcode /** Return all ways to encode a number as a list of words */ def encode(number: String): Set[List[String]] = if (number.isempty) Set(List()) else { for { splitpoint <- (1 to number.length).par word <- wordsfornum(number take splitpoint) rest <- encode(number drop splitpoint) yield word :: rest.toset mapping sequential collection to parallel 43

44 Parallel Collections Split work by number of Processors Each Thread has a work queue that is split exponentially. Largest on end of queue Granularity balance against scheduling overhead On completion threads work steals from end of other thread queues

45 In Summary In the original experiment: Scripting language programs were shorter and often even faster than Java/C/C++ because their developers tended to use standard collections. In Scala s solution: Obtained a further 5x reduction in size because of the systematic use of functional collections. Scala s collection s are also easily upgradable to parallel. Think collection transformers, not CRUD! 45

46 The Future Scala s persistent collections are easy to use: concise: safe: fast: universal: few steps to do the job one word replaces a whole loop type checker is really good at catching errors collection ops are tuned, can be parallelized one vocabulary to work on all kinds of collections We see them play a rapidly increasing role in software development.

47 But how is all this implemented? 47

48 Everything is a Library Collections feel like they are an organic part of Scala But in fact the language does not contain any collectionrelated constructs no collection types no collection literals no collection operators Everything is done in a library Everything is extensible You can write your own collections which look and feel like the standard ones 48

49 The Uniform Return Type Principle Bulk operations return collections of the same type (constructor) as their left operand. (DWIM) scala> val ys = List(1, 2, 3) ys: List[Int] = List(1, 2, 3) scala> val xs: Seq[Int] = ys xs: Seq[Int] = List(1, 2, 3) scala> xs map (_ + 1) res0: Seq[Int] = List(2, 3, 4) scala> ys map (_ + 1) res1: List[Int] = List(2, 3, 4) This is tricky to implement without code duplication! 49

50 Pre 2.8 Collection Structure trait Iterable[A] { def filter(p: A => Boolean): Iterable[A] =... def partition(p: A => Boolean) = (filter(p(_)), filter(!p(_))) def map[b](f: A => B): Iterable[B] =... trait Seq[A] extends Iterable[A] { def filter(p: A => Boolean): Seq[A] =... override def partition(p: A => Boolean) = (filter(p(_)), filter(!p(_))) def map[b](f: A => B): Seq[B] =... 50

51 Types force duplication filter needs to be re-defined on each level partition also needs to be re-implemented on each level, even though its definition is everywhere the same. The same pattern repeats for many other operations and types. ideal conditions for Bit Rot 51

52 Signs of Bit Rot Lots of duplications of methods. Methods returning collections have to be repeated for every collection type. Inconsistencies. Sometimes methods such as filter, map were not specialized in subclasses More often, they only existed in subclasses, even though they could be generalized Broken window effect. Classes that already had some ad-hoc methods became dumping grounds for lots more. Classes that didn t stayed clean. 52

53 Excerpts from List.scala 4-53

54 How to do better? Can we abstract out the return type? Look at map: Need to abstract out the type constructor, not just the type. trait Iterable[A] def map[b](f: A => B): Iterable[B] trait Seq[A] def map[b](f: A => B): Seq[B] But we can do that using Scala s higher-kinded types! 54

55 HK Types Collection Structure trait TraversableLike[A, CC[X]] { def filter(p: A => Boolean): CC[A] def map[b](f: A => B): CC[B] trait Traversable[A] extends TraversableLike[A, Traversable] trait Iterable[A] trait Seq[A] extends TraversableLike[A, Iterable] extends TraversableLike[A, Seq] Here, CC is a parameter representing a type constructor. 55

56 Implementation with Builders All ops in Traversable are implemented in terms of foreach and newbuilder. trait Builder[A, Coll] { def += (elem: A) // add elems def result: Coll // return result trait TraversableLike[A, CC[X]] { def foreach(f: A => Unit) def newbuilder[b]: Builder[B, CC[B]] def map[b](f: A => B): CC[B] = { val b = newbuilder[b] foreach (x => b += f(x)) b.result 56

57 Unfortunately things are not as parametric as it seems at first. Take: class BitSet extends Set[Int] scala> val bs = BitSet(1, 2, 3) bs: scala.collection.immutable.bitset = BitSet(1, 2, 3) scala> bs map (_ + 1) res0: scala.collection.immutable.bitset = BitSet(2, 3, 4) scala> bs map (_.tostring + "!") res1: scala.collection.immutable.set[java.lang.string] = Set(1!, 2!, 3!) Note that the result type is the best possible type that fits the element type of the new collection. Other examples: SortedSet, String, Array 57

58 How to advance? We need more flexibility. Can we define our own type system for collections? Question: Given old collection type From, new element type Elem, and new collection type To: Can an operation on From build a collection of type To with Elem elements? Captured in: CanBuildFrom[From, Elem, To] 58

59 Facts about CanBuildFrom Can be stated as axioms and inference rules: CanBuildFrom[Traversable[A], B, Traversable[B]] CanBuildFrom[Set[A], B, Set[B]] CanBuildFrom[BitSet, B, Set[B]] CanBuildFrom[BitSet, Int, BitSet] CanBuildFrom[String, Char, String] CanBuildFrom[String, B, Seq[B]] CanBuildFrom[SortedSet[A], B, SortedSet[B]] :- Ordering[B] where A and B are arbitrary types. 59

60 Implicitly Injected Theories Type theories such as the one for CanBuildFrom can be injected using implicits. A predicate: trait CanBuildFrom[From, Elem, To] { def apply(coll: From): Builder[Elem, To] Axioms: implicit def bf1[a, B]: CanBuildFrom[Traversable[A], B, Traversable[B]] implicit def bf2[a, B]: CanBuildFrom[Set[A], B, Set[B]] implicit def bf3: CanBuildFrom[BitSet, Int, BitSet] Inference rule: implicit def bf4[a, B] (implicit ord: Ordering[B]) : CanBuildFrom[SortedSet[A], B, SortedSet[B]] 60

61 Connecting with Map Here s how map can be defined in terms CanBuildFrom: trait TraversableLike[A, Coll] { this: Coll => def foreach(f: A => Unit) def newbuilder: Builder[A, Coll] def map[b, To](f: A => B) (implicit cbf: CanBuildFrom[Coll, B, To]): To = { val b = cbf(this) foreach (x => b += f(x)) b.result 61

62 Objections 62

63 4-63

64 Use Cases How to explain def map[b, To](f: A => B) (implicit cbf: CanBuildFrom[Coll, B, To]): To to a beginner? Key observation: We can approximate the type of map. For everyone but the most expert user def map[b](f: A => B): Traversable[B] // in class Traversable def map[b](f: A => B): Seq[B] // in class Seq, etc is detailed enough. These types are correct, they are just not as general as the type that s actually implemented. 64

65 Part of the Solution: Flexible Doc Comments 65

66 Going even further But how do we keep a bunch of Fermi s happy? How to find and deal with threads in an application? Parallel collections are necessary but not sufficient for this. Our bet for the future: parallel embedded DSLs. Find parallelism in domains: machine learning, simulation, statistics,... Joint work with Kunle Olukuton, Pat Stanford. EPFL side funded by ERC. 66

67 EPFL / Stanford Research Applications Scientific Engineering Virtual Worlds Personal Robotics Data informatics Domain Specific Languages Rendering Physics (Liszt) Scripting Probabilistic (RandomT) Machine Learning (OptiML) Domain Embedding Language (Scala) DSL Infrastructure Polymorphic Embedding Staging Static Domain Specific Opt. Parallel Runtime (Delite, Sequoia, GRAMPS) Dynamic Domain Spec. Opt. Task & Data Parallelism Locality Aware Scheduling Heterogeneous Hardware Hardware Architecture OOO Cores SIMD Cores Threaded Cores Specialized Cores Programmable Hierarchies Scalable Coherence Isolation & Atomicity On-chip Networks Pervasive Monitoring 67

68 Example: Liszt - A DSL for Physics Simulation Turbulence Combustion Mesh-based Numeric Simulation Huge domains millions of cells Transition Turbulence Example: Unstructured Reynolds-averaged Navier Stokes (RANS) solver Fuel injection Thermal 68

69 Liszt as Virtualized Scala val // calculating scalar convection (Liszt) val Flux = new Field[Cell,Float] val Phi = new Field[Cell,Float] val cell_volume = new Field[Cell,Float] val deltat = untilconverged { for(f <- interior_faces) { val flux = calc_flux(f) Flux(inside(f)) -= flux Flux(outside(f)) += flux for(f <- inlet_faces) { Flux(outside(f)) += calc_boundary_flux(f) for(c <- cells(mesh)) { Phi(c) += deltat * Flux(c) /cell_volume(c) for(f <- faces(mesh)) Flux(f) = 0.f DSL Library AST Optimisers Generators Schedulers Hardware GPU, Multi-Core, etc 69

Analyse et Conception Formelle. Lesson 5. Crash Course on Scala

Analyse et Conception Formelle. Lesson 5. Crash Course on Scala Analyse et Conception Formelle Lesson 5 Crash Course on Scala T. Genet (ISTIC/IRISA) ACF-5 1 / 36 Bibliography Simply Scala. Online tutorial: http://www.simply.com/fr http://www.simply.com/ Programming

More information

Overview. Elements of Programming Languages. Advanced constructs. Motivating inner class example

Overview. Elements of Programming Languages. Advanced constructs. Motivating inner class example Overview Elements of Programming Languages Lecture 12: Object-oriented functional programming James Cheney University of Edinburgh November 6, 2015 We ve now covered: basics of functional and imperative

More information

Tutorial on Writing Modular Programs in Scala

Tutorial on Writing Modular Programs in Scala Tutorial on Writing Modular Programs in Scala Martin Odersky and Gilles Dubochet 13 September 2006 Tutorial on Writing Modular Programs in Scala Martin Odersky and Gilles Dubochet 1 of 45 Welcome to the

More information

HIGH PERFORMANCE BIG DATA ANALYTICS

HIGH PERFORMANCE BIG DATA ANALYTICS HIGH PERFORMANCE BIG DATA ANALYTICS Kunle Olukotun Electrical Engineering and Computer Science Stanford University June 2, 2014 Explosion of Data Sources Sensors DoD is swimming in sensors and drowning

More information

Applications to Computational Financial and GPU Computing. May 16th. Dr. Daniel Egloff +41 44 520 01 17 +41 79 430 03 61

Applications to Computational Financial and GPU Computing. May 16th. Dr. Daniel Egloff +41 44 520 01 17 +41 79 430 03 61 F# Applications to Computational Financial and GPU Computing May 16th Dr. Daniel Egloff +41 44 520 01 17 +41 79 430 03 61 Today! Why care about F#? Just another fashion?! Three success stories! How Alea.cuBase

More information

Web development... the server side (of the force)

Web development... the server side (of the force) Web development... the server side (of the force) Fabien POULARD Document under license Creative Commons Attribution Share Alike 2.5 http://www.creativecommons.org/learnmore Web development... the server

More information

Crash Course in Java

Crash Course in Java Crash Course in Java Based on notes from D. Hollinger Based in part on notes from J.J. Johns also: Java in a Nutshell Java Network Programming and Distributed Computing Netprog 2002 Java Intro 1 What is

More information

Programming Language Rankings. Lecture 15: Type Inference, polymorphism & Type Classes. Top Combined. Tiobe Index. CSC 131! Fall, 2014!

Programming Language Rankings. Lecture 15: Type Inference, polymorphism & Type Classes. Top Combined. Tiobe Index. CSC 131! Fall, 2014! Programming Language Rankings Lecture 15: Type Inference, polymorphism & Type Classes CSC 131 Fall, 2014 Kim Bruce Top Combined Tiobe Index 1. JavaScript (+1) 2. Java (-1) 3. PHP 4. C# (+2) 5. Python (-1)

More information

Semester Review. CSC 301, Fall 2015

Semester Review. CSC 301, Fall 2015 Semester Review CSC 301, Fall 2015 Programming Language Classes There are many different programming language classes, but four classes or paradigms stand out:! Imperative Languages! assignment and iteration!

More information

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program Free Java textbook available online "Thinking in Java" by Bruce Eckel, 4th edition, 2006, ISBN 0131872486, Pearson Education Introduction to the Java programming language CS 4354 Summer II 2015 The third

More information

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program

Free Java textbook available online. Introduction to the Java programming language. Compilation. A simple java program Free Java textbook available online "Thinking in Java" by Bruce Eckel, 4th edition, 2006, ISBN 0131872486, Pearson Education Introduction to the Java programming language CS 4354 Summer II 2014 Jill Seaman

More information

Fundamentals of Java Programming

Fundamentals of Java Programming Fundamentals of Java Programming This document is exclusive property of Cisco Systems, Inc. Permission is granted to print and copy this document for non-commercial distribution and exclusive use by instructors

More information

Software and the Concurrency Revolution

Software and the Concurrency Revolution Software and the Concurrency Revolution A: The world s fastest supercomputer, with up to 4 processors, 128MB RAM, 942 MFLOPS (peak). 2 Q: What is a 1984 Cray X-MP? (Or a fractional 2005 vintage Xbox )

More information

09336863931 : provid.ir

09336863931 : provid.ir provid.ir 09336863931 : NET Architecture Core CSharp o Variable o Variable Scope o Type Inference o Namespaces o Preprocessor Directives Statements and Flow of Execution o If Statement o Switch Statement

More information

Scala Programming Language

Scala Programming Language Scala Programming Language Tomáš Bureš DISTRIBUTED SYSTEMS RESEARCH GROUP http://nenya.ms.mff.cuni.cz CHARLES UNIVERSITY PRAGUE Faculty of Mathematics and Physics What is Scala Programming language class-based

More information

Java SE 8 Programming

Java SE 8 Programming Oracle University Contact Us: 1.800.529.0165 Java SE 8 Programming Duration: 5 Days What you will learn This Java SE 8 Programming training covers the core language features and Application Programming

More information

A Multi-layered Domain-specific Language for Stencil Computations

A Multi-layered Domain-specific Language for Stencil Computations A Multi-layered Domain-specific Language for Stencil Computations Christian Schmitt, Frank Hannig, Jürgen Teich Hardware/Software Co-Design, University of Erlangen-Nuremberg Workshop ExaStencils 2014,

More information

14/05/2013 Ed Merks EDL V1.0 1

14/05/2013 Ed Merks EDL V1.0 1 14/05/2013 Ed Merks EDL V1.0 1 Java Performance is Complex Write once run everywhere Java is slow because it s interpreted No, there are Just In Time (JIT) compilers Different hardware and platforms Different

More information

A Scala Tutorial for Java programmers

A Scala Tutorial for Java programmers A Scala Tutorial for Java programmers Version 1.3 January 16, 2014 Michel Schinz, Philipp Haller PROGRAMMING METHODS LABORATORY EPFL SWITZERLAND 2 1 Introduction This document gives a quick introduction

More information

e ag u g an L g ter lvin v E ram Neal G g ro va P Ja

e ag u g an L g ter lvin v E ram Neal G g ro va P Ja Evolving the Java Programming Language Neal Gafter Overview The Challenge of Evolving a Language Design Principles Design Goals JDK7 and JDK8 Challenge: Evolving a Language What is it like trying to extend

More information

Scala Actors Library. Robert Hilbrich

Scala Actors Library. Robert Hilbrich Scala Actors Library Robert Hilbrich Foreword and Disclaimer I am not going to teach you Scala. However, I want to: Introduce a library Explain what I use it for My Goal is to: Give you a basic idea about

More information

The C Programming Language course syllabus associate level

The C Programming Language course syllabus associate level TECHNOLOGIES The C Programming Language course syllabus associate level Course description The course fully covers the basics of programming in the C programming language and demonstrates fundamental programming

More information

Intro to scientific programming (with Python) Pietro Berkes, Brandeis University

Intro to scientific programming (with Python) Pietro Berkes, Brandeis University Intro to scientific programming (with Python) Pietro Berkes, Brandeis University Next 4 lessons: Outline Scientific programming: best practices Classical learning (Hoepfield network) Probabilistic learning

More information

Reactive Slick for Database Programming. Stefan Zeiger

Reactive Slick for Database Programming. Stefan Zeiger Reactive Slick for Database Programming Stefan Zeiger Introduction Slick 3.0 Reactive Slick Completely new API for executing database actions Old API (Invoker, Executor) deprecated Will be removed in 3.1

More information

Green-Marl: A DSL for Easy and Efficient Graph Analysis

Green-Marl: A DSL for Easy and Efficient Graph Analysis Green-Marl: A DSL for Easy and Efficient Graph Analysis Sungpack Hong*, Hassan Chafi* +, Eric Sedlar +, and Kunle Olukotun* *Pervasive Parallelism Lab, Stanford University + Oracle Labs Graph Analysis

More information

Microsoft Technical Computing The Advancement of Parallelism. Tom Quinn, Technical Computing Partner Manager

Microsoft Technical Computing The Advancement of Parallelism. Tom Quinn, Technical Computing Partner Manager Presented at the COMSOL Conference 2010 Boston Microsoft Technical Computing The Advancement of Parallelism Tom Quinn, Technical Computing Partner Manager 21 1.2 x 10 New Bytes of Information in 2010 Source:

More information

How Scala Improved Our Java

How Scala Improved Our Java How Scala Improved Our Java Sam Reid PhET Interactive Simulations University of Colorado http://spot.colorado.edu/~reids/ PhET Interactive Simulations Provides free, open source educational science simulations

More information

core. Volume I - Fundamentals Seventh Edition Sun Microsystems Press A Prentice Hall Title ULB Darmstadt

core. Volume I - Fundamentals Seventh Edition Sun Microsystems Press A Prentice Hall Title ULB Darmstadt core. 2008 AGI-Information Management Consultants May be used for personal purporses only or by libraries associated to dandelon.com network. Volume I - Fundamentals Seventh Edition CAY S. HORSTMANN GARY

More information

HPC Wales Skills Academy Course Catalogue 2015

HPC Wales Skills Academy Course Catalogue 2015 HPC Wales Skills Academy Course Catalogue 2015 Overview The HPC Wales Skills Academy provides a variety of courses and workshops aimed at building skills in High Performance Computing (HPC). Our courses

More information

Scientific Computing Programming with Parallel Objects

Scientific Computing Programming with Parallel Objects Scientific Computing Programming with Parallel Objects Esteban Meneses, PhD School of Computing, Costa Rica Institute of Technology Parallel Architectures Galore Personal Computing Embedded Computing Moore

More information

Java Interview Questions and Answers

Java Interview Questions and Answers 1. What is the most important feature of Java? Java is a platform independent language. 2. What do you mean by platform independence? Platform independence means that we can write and compile the java

More information

Virtual Machine Learning: Thinking Like a Computer Architect

Virtual Machine Learning: Thinking Like a Computer Architect Virtual Machine Learning: Thinking Like a Computer Architect Michael Hind IBM T.J. Watson Research Center March 21, 2005 CGO 05 Keynote 2005 IBM Corporation What is this talk about? Virtual Machines? 2

More information

CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages. Nicki Dell Spring 2014

CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages. Nicki Dell Spring 2014 CSE 373: Data Structure & Algorithms Lecture 25: Programming Languages Nicki Dell Spring 2014 What is a Programming Language? A set of symbols and associated tools that translate (if necessary) collections

More information

Efficient Parallel Graph Exploration on Multi-Core CPU and GPU

Efficient Parallel Graph Exploration on Multi-Core CPU and GPU Efficient Parallel Graph Exploration on Multi-Core CPU and GPU Pervasive Parallelism Laboratory Stanford University Sungpack Hong, Tayo Oguntebi, and Kunle Olukotun Graph and its Applications Graph Fundamental

More information

Poor Man's Type Classes

Poor Man's Type Classes Poor Man's Type Classes Martin Odersky EPFL IFIP WG2.8 workin roup meetin Boston, July 2006. 1 Goals Type classes are nice. A cottae industry of Haskell prorammers has sprun up around them. Should we add

More information

Chapter 6: Programming Languages

Chapter 6: Programming Languages Chapter 6: Programming Languages Computer Science: An Overview Eleventh Edition by J. Glenn Brookshear Copyright 2012 Pearson Education, Inc. Chapter 6: Programming Languages 6.1 Historical Perspective

More information

Redesigning the language for business logic in the Maconomy ERP system and automatic translation of existing code

Redesigning the language for business logic in the Maconomy ERP system and automatic translation of existing code Master thesis Redesigning the language for business logic in the Maconomy ERP system and automatic translation of existing code Author: Piotr Borowian (s091441) Supervisors: Ekkart Kindler Christian W.

More information

opalang - Rapid & Secure Web Development

opalang - Rapid & Secure Web Development opalang - Rapid & Secure Web Development Syllabus Brief History of Web Development Ideas and Goals The Language itself Community Reason for Development Services and Apps written in OPA Future of OPA OPA

More information

Lecture 18-19 Data Types and Types of a Language

Lecture 18-19 Data Types and Types of a Language Lecture 18-19 Data Types and Types of a Language April 29, 2014 Data Types and Types of a Language Data, Data Types and Types Type: Generalities Type Systems and Type Safety Type Equivalence, Coercion

More information

Java EE Web Development Course Program

Java EE Web Development Course Program Java EE Web Development Course Program Part I Introduction to Programming 1. Introduction to programming. Compilers, interpreters, virtual machines. Primitive types, variables, basic operators, expressions,

More information

Scalable and Reactive Programming for Semantic Web Developers

Scalable and Reactive Programming for Semantic Web Developers Proceedings of the ESWC2015 Developers Workshop 47 Scalable and Reactive Programming for Semantic Web Developers Jean-Paul Calbimonte LSIR Distributed Information Systems Lab, EPFL, Switzerland. firstname.lastname@epfl.ch

More information

Java 6 'th. Concepts INTERNATIONAL STUDENT VERSION. edition

Java 6 'th. Concepts INTERNATIONAL STUDENT VERSION. edition Java 6 'th edition Concepts INTERNATIONAL STUDENT VERSION CONTENTS PREFACE vii SPECIAL FEATURES xxviii chapter i INTRODUCTION 1 1.1 What Is Programming? 2 J.2 The Anatomy of a Computer 3 1.3 Translating

More information

Improving the performance of data servers on multicore architectures. Fabien Gaud

Improving the performance of data servers on multicore architectures. Fabien Gaud Improving the performance of data servers on multicore architectures Fabien Gaud Grenoble University Advisors: Jean-Bernard Stefani, Renaud Lachaize and Vivien Quéma Sardes (INRIA/LIG) December 2, 2010

More information

Software Engineering Techniques

Software Engineering Techniques Software Engineering Techniques Low level design issues for programming-in-the-large. Software Quality Design by contract Pre- and post conditions Class invariants Ten do Ten do nots Another type of summary

More information

History OOP languages Year Language 1967 Simula-67 1983 Smalltalk

History OOP languages Year Language 1967 Simula-67 1983 Smalltalk History OOP languages Intro 1 Year Language reported dates vary for some languages... design Vs delievered 1957 Fortran High level programming language 1958 Lisp 1959 Cobol 1960 Algol Structured Programming

More information

CS 111 Classes I 1. Software Organization View to this point:

CS 111 Classes I 1. Software Organization View to this point: CS 111 Classes I 1 Software Organization View to this point: Data Objects and primitive types Primitive types operators (+, /,,*, %). int, float, double, char, boolean Memory location holds the data Objects

More information

The Flink Big Data Analytics Platform. Marton Balassi, Gyula Fora" {mbalassi, gyfora}@apache.org

The Flink Big Data Analytics Platform. Marton Balassi, Gyula Fora {mbalassi, gyfora}@apache.org The Flink Big Data Analytics Platform Marton Balassi, Gyula Fora" {mbalassi, gyfora}@apache.org What is Apache Flink? Open Source Started in 2009 by the Berlin-based database research groups In the Apache

More information

The Importance of Software License Server Monitoring

The Importance of Software License Server Monitoring The Importance of Software License Server Monitoring NetworkComputer How Shorter Running Jobs Can Help In Optimizing Your Resource Utilization White Paper Introduction Semiconductor companies typically

More information

Glossary of Object Oriented Terms

Glossary of Object Oriented Terms Appendix E Glossary of Object Oriented Terms abstract class: A class primarily intended to define an instance, but can not be instantiated without additional methods. abstract data type: An abstraction

More information

Ubiquitous access Inherently distributed Many, diverse clients (single purpose rich) Unlimited computation and data on demand

Ubiquitous access Inherently distributed Many, diverse clients (single purpose rich) Unlimited computation and data on demand Ubiquitous access Inherently distributed Many, diverse clients (single purpose rich) Unlimited computation and data on demand Moore s Law (Dennard scaling) is running out Scale out, not scale up Inescapably

More information

Multi-GPU Load Balancing for Simulation and Rendering

Multi-GPU Load Balancing for Simulation and Rendering Multi- Load Balancing for Simulation and Rendering Yong Cao Computer Science Department, Virginia Tech, USA In-situ ualization and ual Analytics Instant visualization and interaction of computing tasks

More information

General Introduction

General Introduction Managed Runtime Technology: General Introduction Xiao-Feng Li (xiaofeng.li@gmail.com) 2012-10-10 Agenda Virtual machines Managed runtime systems EE and MM (JIT and GC) Summary 10/10/2012 Managed Runtime

More information

Habanero Extreme Scale Software Research Project

Habanero Extreme Scale Software Research Project Habanero Extreme Scale Software Research Project Comp215: Java Method Dispatch Zoran Budimlić (Rice University) Always remember that you are absolutely unique. Just like everyone else. - Margaret Mead

More information

Cache Database: Introduction to a New Generation Database

Cache Database: Introduction to a New Generation Database Cache Database: Introduction to a New Generation Database Amrita Bhatnagar Department of Computer Science and Engineering, Birla Institute of Technology, A 7, Sector 1, Noida 201301 UP amritapsaxena@gmail.com

More information

Tutorial: Getting Started

Tutorial: Getting Started 9 Tutorial: Getting Started INFRASTRUCTURE A MAKEFILE PLAIN HELLO WORLD APERIODIC HELLO WORLD PERIODIC HELLO WORLD WATCH THOSE REAL-TIME PRIORITIES THEY ARE SERIOUS SUMMARY Getting started with a new platform

More information

A Case Study in DSL Development

A Case Study in DSL Development A Case Study in DSL Development An Experiment with Python and Scala Klaus Havelund Michel Ingham David Wagner Jet Propulsion Laboratory, California Institute of Technology klaus.havelund, michel.d.ingham,

More information

Parallel Databases. Parallel Architectures. Parallelism Terminology 1/4/2015. Increase performance by performing operations in parallel

Parallel Databases. Parallel Architectures. Parallelism Terminology 1/4/2015. Increase performance by performing operations in parallel Parallel Databases Increase performance by performing operations in parallel Parallel Architectures Shared memory Shared disk Shared nothing closely coupled loosely coupled Parallelism Terminology Speedup:

More information

Migration Scenario: Migrating Batch Processes to the AWS Cloud

Migration Scenario: Migrating Batch Processes to the AWS Cloud Migration Scenario: Migrating Batch Processes to the AWS Cloud Produce Ingest Process Store Manage Distribute Asset Creation Data Ingestor Metadata Ingestor (Manual) Transcoder Encoder Asset Store Catalog

More information

HPC Deployment of OpenFOAM in an Industrial Setting

HPC Deployment of OpenFOAM in an Industrial Setting HPC Deployment of OpenFOAM in an Industrial Setting Hrvoje Jasak h.jasak@wikki.co.uk Wikki Ltd, United Kingdom PRACE Seminar: Industrial Usage of HPC Stockholm, Sweden, 28-29 March 2011 HPC Deployment

More information

Chapter 15 Functional Programming Languages

Chapter 15 Functional Programming Languages Chapter 15 Functional Programming Languages Introduction - The design of the imperative languages is based directly on the von Neumann architecture Efficiency (at least at first) is the primary concern,

More information

The countdown problem

The countdown problem JFP 12 (6): 609 616, November 2002. c 2002 Cambridge University Press DOI: 10.1017/S0956796801004300 Printed in the United Kingdom 609 F U N C T I O N A L P E A R L The countdown problem GRAHAM HUTTON

More information

Dart a modern web language

Dart a modern web language Dart a modern web language or why web programmers need more structure Kasper Lund & Lars Bak Software engineers, Google Inc. Object-oriented language experience: 26 + 12 years The Web Is Fantastic The

More information

PostgreSQL Functions By Example

PostgreSQL Functions By Example Postgre joe.conway@credativ.com credativ Group January 20, 2012 What are Functions? Introduction Uses Varieties Languages Full fledged SQL objects Many other database objects are implemented with them

More information

The Needle Programming Language

The Needle Programming Language The Needle Programming Language The Needle Programming Language 1 What is Needle? Needle is an object-oriented functional programming language with a multimethod-based OO system, and a static type system

More information

The Decaffeinated Robot

The Decaffeinated Robot Developing on without Java Texas Linux Fest 2 April 2011 Overview for Why? architecture Decaffeinating for Why? architecture Decaffeinating for Why choose? Why? architecture Decaffeinating for Why choose?

More information

Android Application Development Course Program

Android Application Development Course Program Android Application Development Course Program Part I Introduction to Programming 1. Introduction to programming. Compilers, interpreters, virtual machines. Primitive data types, variables, basic operators,

More information

Big Data Storage, Management and challenges. Ahmed Ali-Eldin

Big Data Storage, Management and challenges. Ahmed Ali-Eldin Big Data Storage, Management and challenges Ahmed Ali-Eldin (Ambitious) Plan What is Big Data? And Why talk about Big Data? How to store Big Data? BigTables (Google) Dynamo (Amazon) How to process Big

More information

Computing Concepts with Java Essentials

Computing Concepts with Java Essentials 2008 AGI-Information Management Consultants May be used for personal purporses only or by libraries associated to dandelon.com network. Computing Concepts with Java Essentials 3rd Edition Cay Horstmann

More information

Comp 411 Principles of Programming Languages Lecture 34 Semantics of OO Languages. Corky Cartwright Swarat Chaudhuri November 30, 20111

Comp 411 Principles of Programming Languages Lecture 34 Semantics of OO Languages. Corky Cartwright Swarat Chaudhuri November 30, 20111 Comp 411 Principles of Programming Languages Lecture 34 Semantics of OO Languages Corky Cartwright Swarat Chaudhuri November 30, 20111 Overview I In OO languages, data values (except for designated non-oo

More information

The Sun Certified Associate for the Java Platform, Standard Edition, Exam Version 1.0

The Sun Certified Associate for the Java Platform, Standard Edition, Exam Version 1.0 The following applies to all exams: Once exam vouchers are purchased you have up to one year from the date of purchase to use it. Each voucher is valid for one exam and may only be used at an Authorized

More information

Web Development in Java

Web Development in Java Web Development in Java Detailed Course Brochure @All Rights Reserved. Techcanvass, 265, Powai Plaza, Hiranandani Garden, Powai, Mumbai www.techcanvass.com Tel: +91 22 40155175 Mob: 773 877 3108 P a g

More information

MapReduce Systems. Outline. Computer Speedup. Sara Bouchenak

MapReduce Systems. Outline. Computer Speedup. Sara Bouchenak MapReduce Systems Sara Bouchenak Sara.Bouchenak@imag.fr http://sardes.inrialpes.fr/~bouchena/teaching/ Lectures based on the following slides: http://code.google.com/edu/submissions/mapreduceminilecture/listing.html

More information

CS11 Java. Fall 2014-2015 Lecture 7

CS11 Java. Fall 2014-2015 Lecture 7 CS11 Java Fall 2014-2015 Lecture 7 Today s Topics! All about Java Threads! Some Lab 7 tips Java Threading Recap! A program can use multiple threads to do several things at once " A thread can have local

More information

A Technical Review of TIBCO Patterns Search

A Technical Review of TIBCO Patterns Search A Technical Review of TIBCO Patterns Search 2 TABLE OF CONTENTS SUMMARY... 3 ARCHITECTURAL OVERVIEW... 3 HOW DOES TIBCO PATTERNS SEARCH WORK?... 5 ELIMINATE THE NEED FOR RULES... 7 LOADING AND SYNCHRONIZING

More information

Java SE 7 Programming

Java SE 7 Programming Java SE 7 Programming The second of two courses that cover the Java Standard Edition 7 (Java SE 7) Platform, this course covers the core Application Programming Interfaces (API) you will use to design

More information

Programming Languages

Programming Languages Programming Languages Qing Yi Course web site: www.cs.utsa.edu/~qingyi/cs3723 cs3723 1 A little about myself Qing Yi Ph.D. Rice University, USA. Assistant Professor, Department of Computer Science Office:

More information

Compiling Object Oriented Languages. What is an Object-Oriented Programming Language? Implementation: Dynamic Binding

Compiling Object Oriented Languages. What is an Object-Oriented Programming Language? Implementation: Dynamic Binding Compiling Object Oriented Languages What is an Object-Oriented Programming Language? Last time Dynamic compilation Today Introduction to compiling object oriented languages What are the issues? Objects

More information

Java Programming Language

Java Programming Language Lecture 1 Part II Java Programming Language Additional Features and Constructs Topics in Quantitative Finance: Numerical Solutions of Partial Differential Equations Instructor: Iraj Kani Subclasses and

More information

GTask Developing asynchronous applications for multi-core efficiency

GTask Developing asynchronous applications for multi-core efficiency GTask Developing asynchronous applications for multi-core efficiency February 2009 SCALE 7x Los Angeles Christian Hergert What Is It? GTask is a mini framework to help you write asynchronous code. Dependencies

More information

Monitoring Hadoop with Akka. Clint Combs Senior Software Engineer at Collective

Monitoring Hadoop with Akka. Clint Combs Senior Software Engineer at Collective Monitoring Hadoop with Akka Clint Combs Senior Software Engineer at Collective Collective - The Audience Engine Ad Technology Company Heavy Investment in Hadoop and Other Scalable Infrastructure Need to

More information

Visualizing Software Projects in JavaScript

Visualizing Software Projects in JavaScript Visualizing Software Projects in JavaScript Tim Disney Abstract Visualization techniques have been used to help programmers deepen their understanding of large software projects. However the existing visualization

More information

What Is Datacenter (Warehouse) Computing. Distributed and Parallel Technology. Datacenter Computing Application Programming

What Is Datacenter (Warehouse) Computing. Distributed and Parallel Technology. Datacenter Computing Application Programming Distributed and Parallel Technology Datacenter and Warehouse Computing Hans-Wolfgang Loidl School of Mathematical and Computer Sciences Heriot-Watt University, Edinburgh 0 Based on earlier versions by

More information

SMock A Test Platform for the Evaluation of Monitoring Tools

SMock A Test Platform for the Evaluation of Monitoring Tools SMock A Test Platform for the Evaluation of Monitoring Tools User Manual Ruth Mizzi Faculty of ICT University of Malta June 20, 2013 Contents 1 Introduction 3 1.1 The Architecture and Design of SMock................

More information

Openbus Documentation

Openbus Documentation Openbus Documentation Release 1 Produban February 17, 2014 Contents i ii An open source architecture able to process the massive amount of events that occur in a banking IT Infraestructure. Contents:

More information

Service Oriented Architecture

Service Oriented Architecture Service Oriented Architecture Version 9 2 SOA-2 Overview Ok, now we understand the Web Service technology, but how about Service Oriented Architectures? A guiding analogy Terminology excursion Service,

More information

AP Computer Science Java Subset

AP Computer Science Java Subset APPENDIX A AP Computer Science Java Subset The AP Java subset is intended to outline the features of Java that may appear on the AP Computer Science A Exam. The AP Java subset is NOT intended as an overall

More information

iservdb The database closest to you IDEAS Institute

iservdb The database closest to you IDEAS Institute iservdb The database closest to you IDEAS Institute 1 Overview 2 Long-term Anticipation iservdb is a relational database SQL compliance and a general purpose database Data is reliable and consistency iservdb

More information

CSC408H Lecture Notes

CSC408H Lecture Notes CSC408H Lecture Notes These lecture notes are provided for the personal use of students taking Software Engineering course in the Summer term 2005 at the University of Toronto. Copying for purposes other

More information

DIPLOMADO DE JAVA - OCA

DIPLOMADO DE JAVA - OCA DIPLOMADO DE JAVA - OCA TABLA DE CONTENIDO INTRODUCCION... 3 ESTRUCTURA DEL DIPLOMADO... 4 Nivel I:... 4 Fundamentals of the Java Programming Language Java SE 7... 4 Introducing the Java Technology...

More information

Scaling Up & Out with Actors: Introducing Akka

Scaling Up & Out with Actors: Introducing Akka Scaling Up & Out with Actors: Introducing Akka Akka Tech Lead Email: viktor.klang@typesafe.com Twitter: @viktorklang The problem It is way too hard to build: 1. correct highly concurrent systems 2. truly

More information

language 1 (source) compiler language 2 (target) Figure 1: Compiling a program

language 1 (source) compiler language 2 (target) Figure 1: Compiling a program CS 2112 Lecture 27 Interpreters, compilers, and the Java Virtual Machine 1 May 2012 Lecturer: Andrew Myers 1 Interpreters vs. compilers There are two strategies for obtaining runnable code from a program

More information

Tools, Trends and Techniques for Developing Scientific Software

Tools, Trends and Techniques for Developing Scientific Software Tools, Trends and Techniques for Developing Scientific Software Tom Clune - NASA GSFC Brice Womack - NASA/NGC-TASC Brian Foote - The Refactory, Inc. Jeffrey Overbey - University of Illinois ASTG Advanced

More information

The Advantages and Disadvantages of Network Computing Nodes

The Advantages and Disadvantages of Network Computing Nodes Big Data & Scripting storage networks and distributed file systems 1, 2, in the remainder we use networks of computing nodes to enable computations on even larger datasets for a computation, each node

More information

Parallelism and Cloud Computing

Parallelism and Cloud Computing Parallelism and Cloud Computing Kai Shen Parallel Computing Parallel computing: Process sub tasks simultaneously so that work can be completed faster. For instances: divide the work of matrix multiplication

More information

MA-WA1920: Enterprise iphone and ipad Programming

MA-WA1920: Enterprise iphone and ipad Programming MA-WA1920: Enterprise iphone and ipad Programming Description This 5 day iphone training course teaches application development for the ios platform. It covers iphone, ipad and ipod Touch devices. This

More information

Architectures for massive data management

Architectures for massive data management Architectures for massive data management Apache Kafka, Samza, Storm Albert Bifet albert.bifet@telecom-paristech.fr October 20, 2015 Stream Engine Motivation Digital Universe EMC Digital Universe with

More information

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON

PROBLEM SOLVING SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON PROBLEM SOLVING WITH SEVENTH EDITION WALTER SAVITCH UNIVERSITY OF CALIFORNIA, SAN DIEGO CONTRIBUTOR KENRICK MOCK UNIVERSITY OF ALASKA, ANCHORAGE PEARSON Addison Wesley Boston San Francisco New York London

More information

by Mario Fusco mario.fusco@gmail.com twitter: @mariofusco Monadic

by Mario Fusco mario.fusco@gmail.com twitter: @mariofusco Monadic by Mario Fusco mario.fusco@gmail.com twitter: @mariofusco Monadic Imperative languages Java C# C / C++ Fortran Add abstractions Scala F# Subtract abstractions Hybrid languages Algol Lisp ML Haskell Functional

More information

Programming models for heterogeneous computing. Manuel Ujaldón Nvidia CUDA Fellow and A/Prof. Computer Architecture Department University of Malaga

Programming models for heterogeneous computing. Manuel Ujaldón Nvidia CUDA Fellow and A/Prof. Computer Architecture Department University of Malaga Programming models for heterogeneous computing Manuel Ujaldón Nvidia CUDA Fellow and A/Prof. Computer Architecture Department University of Malaga Talk outline [30 slides] 1. Introduction [5 slides] 2.

More information

David Rioja Redondo Telecommunication Engineer Englobe Technologies and Systems

David Rioja Redondo Telecommunication Engineer Englobe Technologies and Systems David Rioja Redondo Telecommunication Engineer Englobe Technologies and Systems About me David Rioja Redondo Telecommunication Engineer - Universidad de Alcalá >2 years building and managing clusters UPM

More information