Upgrade to Pro — share decks privately, control downloads, hide ads and more …

A Glimpse of a Scala - Java Meetup Novi Sad May 2014

A Glimpse of a Scala - Java Meetup Novi Sad May 2014

I gave an introduction to Scala at Novi Sad on 29.05.2014. The corresponding code examples can be found here: https://github.com/lukaspustina/A-Glimpse-Of-Scala-Java-Meet-Up-in-Novi-Sad

Lukas Pustina

May 30, 2014

More Decks by Lukas Pustina

Other Decks in Programming


  1. A Glimpse of Scala Dr. Lukas Pustina @drivebytesting codecentric AG

  2. Which Programming Language would you use now on top of

    JVM? Scala! James Gosling, Father of Java
  3. Scala is fun and designed for the future.

  4. @drivebytesting

  5. What to expect

  6. Syntax vs. Idioms How to use a language.

  7. Before we start

  8. Open your mind

  9. Let’s program our minds The brain has bugs

  10. Exposure Effect We prefer things we know and are familiar

  11. None
  12. “Gott würfelt nicht!” “God doesn’t role the dice!” — Albert

  13. Bundesarchiv, Bild183-R57262 / CC-BY-SA

  14. Today’s Challenges

  15. CPU Memory

  16. !Von Neumann Bottleneck

  17. Can Programming Be Liberated from the von Neumann Style A

    Functional Style and Its Algebra of Programs — John Backus, 1977
  18. CPU Memory Cache

  19. CPU Memory Cache Cache

  20. CPU Memory Cache Cache Core Core Core Core

  21. CPU Memory Cache Cache Core Core Core Core

  22. !False Sharing

  23. Cache Cache Cache Core Core

  24. Cache Cache Cache Core Core

  25. Cache Cache Cache Core Core

  26. !I/O Waits

  27. This is the future Massive parallel computing

  28. ?Threads The software engineers’ answer

  29. A Universal Modular Actor Formalism for Artificial Intelligence Carl Hewitt,

    Peter Bishop, Richard Steiger 1973
  30. Reactive Programming Immutability, Functional, Actors are one approach.

  31. A Glimpse of Scala

  32. SCAlable LAnguage A multi-paradigm language

  33. Return of Computer Science Bear with me :)

  34. Object oriented, functional language Multi-paradigm language

  35. OO and func • State Mutation vs. Immutability • Object

    Composition vs. Functional Composition • Class Hierarchies vs. Pattern Matching
  36. Type Inference The type of variables and functions is interfered

    from assignments and return values.
  37. Immutability Immutability right in the language: val and immutable collections.

  38. Functions as 1st class citizens Pass a function as you

    would pass an Int, a String, or an arbitrary object.
  39. Hello World The first program in the REPL

  40. [lukas@muffin] ~ ➜ scala! Welcome to Scala version 2.11.1 (Java

    HotSpot(TM) 64-Bit Server VM, Java 1.7.0_51).! Type in expressions to have them evaluated.! Type :help for more information.! ! scala> print("Hello World")! Hello World
  41. A Closer Look

  42. With great power … … comes great responsibility.

  43. @drivebytesting

  44. End Dr. Lukas Pustina @drivebytesting codecentric AG