$30 off During Our Annual Pro Sale. View Details »

Whats the big deal with Scala

todkar
July 11, 2012

Whats the big deal with Scala

Scala is as expressive as Ruby and as performant as Java and let me show you how.

todkar

July 11, 2012
Tweet

Other Decks in Technology

Transcript

  1. Introduc=on  to  Scala   • Runs  on  JVM   • Fuses  object-­‐oriented

     &   func=onal  paradigms  though   biased  towards  func=onal  style   • Sta=cally-­‐typed  
  2. As  expressive  as  Ruby,     As  performant  as  Java

      Why  am  I  comparing  with  Ruby  and   Java?  
  3. Disclaimer   • Professionally  a  Ruby  and  Java   developer  

    • Haven’t  worked  with  Scala  on  a   “real”  project   • Based  on  my  experience  working   with  the  Credit  Union  Findr  
  4. Why  Expressiveness?   • Not  just  preUy   • Reduces  boilerplate  code

      • Less  code  to  deal  with  &  maintain   • Elegant  solu=on    
  5. Closures   • Closures  are  blocks  of  code  that   can

     be  passed  around  as   parameters   • Closures  “close  over”  variables   outside  of  its  scope  
  6. Tail  recursion   • Special  type  of  func=on  recursion   • Final

     ac=on  taken  in  a  func=on  is   the  recursive  call   • Can  avoid  penalty  of  crea=ng  a   new  stack  frame  for  each   recursive  call  
  7. Parallel  collec=ons   • Just  like  regular  collec=ons     • Can

     be  operated  upon  by   mul=ple  cores   • Use  Divide-­‐and-­‐conquer   algorithm   • Write-­‐your-­‐own  
  8. Actors   • Actors  are  high-­‐level  concurrency   construct  as  opposed

     to  threads   and  shared  memory  model   • Actors  communicate  via  message   passing   • PaUern  matching  is  used  for   message  processing  
  9. Cri=cism   • Slow  compiler   –   sbt  incremental  compila=on  

    –   Daemon  compiler   • Too  many  features