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

Scala ecosystem

Scala ecosystem

Eduardo Costa

October 23, 2017
Tweet

More Decks by Eduardo Costa

Other Decks in Programming

Transcript

  1. Agenda - The Scala language - Lightbend and community -

    SBT and tools - Web development - Database libraries - Akka Toolkit - Extending Functional Programming - Dependency Injection - Other usages (machine learning..) - The future... - How could I learn more?
  2. The Scala Language - Martin Odersky - Released on 2004

    - EPFL background (École Polytechnique Fédérale de Lausanne) - Statically typed - Hybrid language (OOP and FP) - JVM based - Fully interoperable with Java
  3. Language versions - 2.0 until 2.90 (mar/2006 - may/2011) -

    2.10 (may/11) - 2.11 (apr/14) - 2.12 (nov/16) - 2.12.4 (out/17) and last version - Binary compatibility - 2.12.0 -> 2.12.4 - Upgrading from 2.10.x -> 2.11.x -> 2.12.x
  4. Lightbend - Founded in 2011 - Formerly know as Typesafe

    (changed in fev/16) - It provides open-source and enterprise platform for build reactive applications
  5. Reactive Streams - Main contributors of Reactive Streams - Provide

    a standard for asynchronous stream processing with non-blocking back pressure
  6. Reactive Streams - Main contributors of Reactive Streams - Provide

    a standard for asynchronous stream processing with non-blocking back pressure - JDK9 (released in set/2017)
  7. Reactive Manifesto - Responds in a timely manner if at

    all possible - Stays responsive in the face of failure - Stays responsive under varying workload - Works with asynchronous messaging to establish a boundary between components that ensures loose coupling, isolation and location transparency
  8. SBT and tools - A simple build tool - Ivy

    dependency management - Set tasks and then run them in parallel from the shell - Custom plugins (native packager etc) - Natural choice for Scala language, as well Leiningen for Clojure or Gradle for Android
  9. SBT and tools - SBT 1.0 (released on ago/2017) -

    Required Scala 2.12.x - Zinc 1, a faster incremental compiler
  10. Play framework - Web framework - Java and Scala -

    Modern web and mobile - Template engine - Support for internationalization - Uses dependency injection pattern - A complete web framework (like Rails!) - https://github.com/playframework/playframework
  11. Akka Http - It's general toolkit for providing and consuming

    HTTP-based services - HTTP stack on top of akka-actor and akka-stream - Streaming-first - Routing DSL - Directives - https://github.com/akka/akka-http
  12. Scalatra - Micro-framework - Sinatra-like - Quickly build high-performance websites

    and APIs - Template engine - Authentication, CORS, internalization - https://github.com/scalatra/scalatra
  13. Finagle - Created by Twitter - Finagle is an extensible

    RPC system for the JVM - Protocol-agnostic system - Finagle implementations (binary parsers, http2, memcached, thrift, oauth2, postgres, websockets) - https://github.com/twitter/finagle
  14. Finatra - Scala applications on top of TwitterServer and Finagle

    - Production use of Twitter - Support for HTTP & Thrift - https://github.com/twitter/finatra
  15. Lagom framework - Reactive systems - Java and Scala -

    Highly opinionated framework - Built on Akka and Play - CQRS and Event Sourcing support - Message Broker support - Service locator support - Embedded Cassandra and Kafka
  16. Slick - Like ORM, but it's not ORM - Data

    persistence (functional relational mapper) - Plain SQL queries - Requires boilerplate - Support for DB2, JavaDB, H2, HyperSQL, MSAccess, SQL Server, MySQL, Oracle, PostgreSQL and SQLite databases - https://github.com/slick/slick
  17. Quill - Compile-time language integrated queries and validation - Boilerplate-free

    mapping - Support for MySQL, PostgreSQL, SQLite, H2 and SQLServer database
  18. Akka Toolkit - Java and Scala - Actors model -

    Up to 50 million msg/sec on a single machine - ~2.5 million actors per GB of heap - Networking (clustering) - HTTP - Streams - Alpakka - Persistance
  19. Cats - Provide abstractions for functional programming - Used by

    several libraries for Scala - Better documentation than your competitor (ScalaZ) - Functor, monads, variance - https://github.com/typelevel/cats
  20. Cats - Easy and Efficient Data Validation with Cats –

    Daniela Sfregola - https://www.youtube.com/watch?v=OkTfcyFohS0
  21. Dependency Injection - Cake Pattern - Monad Reader - Or

    we could use some library to do that - MacWire - Guice
  22. Scala.js - A safer way to build robust front-end web

    applications - Incremental compilation guarantees speedy (1-2s) - Interoperability (React, Angular etc) - Go beyond JavaScript ES6, today
  23. Kamon - Metric recording and trace manipulation - Metrics collection

    - Akka, Scala Futures, Play framework, JDBC, System Metrics - Reporter backends - StatsD, NewRelic, Datadog, FluentD, JMX, InfluxDB
  24. Dotty - A next generation compiler for Scala - The

    focus in mainly on simplification - Currently in development - http://dotty.epfl.ch/
  25. Scala Native - Optimizing ahead-of-time compiler - Lightweight managed runtime

    - Cross-publishing infrastructure against JVM, JS and Native platforms - https://github.com/scala-native/scala-native
  26. Next steps - Meetup Scaladores - Scala Days conferences -

    Weekly Scala newspaper ( http://scalatimes.com/ ) - Coursera.org - Scala courses - The Neophyte's Guide to Scala