Northeast Scala Symposium Summary: Day 1 (Unconference)

The first day of the symposium was a self-organized free-to-attend unconference. In the morning participants collectively created the schedule grid and sessions began at 9.30.


9.30–10.30–11.30 Sunday morning Category Theory — Rúnar Bjarnason

An introduction to Category theory for Scala developers.

Category:

  • Objects
  • Arrows
  • Composition of arrows: associative and has an identity

Provided a lot of examples of categories: finite categories, monoids, category of categories, etc.

Scala category:

  • Objects: Scala types
  • Arrows: Scala functions (go from one type to another)
  • Composition: function composition

f compose g compose h — (x => f(g(h(x))))

identity — (x => x)

Recommended authors: Steve Awodey, William Lawvere, Bartosz Milewski, Emily Riehl, David Spivak


10.30–11.30 Event Sourcing http://microservices.io/patterns/data/event-sourcing.html

Typical systems:

In systems without event sourcing, state updates are done as a replacement of old version of the data with a new version, as a result the old version is lost.
State -> State — but old state is lost

Event sourcing:

The idea is to store events that change the state instead of changing the state.
Event -> State -> Event -> State — save all events

  • Keeps full history of everything what happened — keep multiple copies of state
  • Allows Command Query Responsibility Segregation — separation between read model and write model
  • You can build different read models at any time
     E.g. if you need graph db for some use case it is easy to build it as another read model
     — You can wipe out the state and recreate it
     — Even change the code that interprets the event
  • Downside: Eventual consistency

Events organized in streams, each stream corresponds to an Aggregate in DDD (or lets just call them entities with subentities (or dependent entities)) Streams can be sharded.

Events in each stream have serial identifier — good for caching in HTTP/REST APIs using ETags — just use revision number of an entity. System takes “Commands”, e.g ChangeName. Command can either be rejected or it can lead to an event created: NameChanged.

Event also has Revision associated with it.

Library lecturer uses — Delta: started development before akka, supported event stores, JDBC, MongoDb, Cassandra — once it started to support lightweight transactions, Kafka — not supported


11.30–12.30 Build tool discussion

Everybody shared their experience. Discussed build tools: SBT, Mill, Bazel, Bloop, Gradle, Pants, CBT, Maven. Conclusion: build tools are hard in general, no one really has ever had one they liked unconditionally.

Mill

Pros:

  • Automatic caching of tasks
  • Fast startup
  • Moving quickly
  • Hierarchical builds

Cons:

  • New / “beta”
  • Less editor/plugin integrations

Bazel

Pros:

  • Polyglot
  • Hierarchical

Cons:

  • Google doesn’t do OSS very well, often
  • ≈ Python

Bloop

Bloop does not replace any of the other build tools listed here. Its aim is to increase the speed of your existing build tool’s workflow for building, testing, and perhaps other tasks, by keeping a warm JVM waiting for you (via Nailgun).

Pros:

  • Use your existing build tool!
  • Enables quick command based workflows
  • Bloop test — project root
  • Bloop compile — project root
  • Bloop run — project root — main MyClass — args myarg

Cons:

  • Plugins only for sbt and maven so far (others coming)
  • Not yet at v1.0 (Milestone 7 came out this past week)

Full notes


14.30–15.30 Intro to Typeclasses — Mark “Justin” Waks

jQuery goodies:

  • Building Higher-level Gadgets
  • Browser Incompatibilities
  • Collections

But jQuery is loosely typed and DOM has types — Div, Para, B, Image, etc.

all return types are JQuery

Justin proposed sQuery — Scala style strongly typed jQuery.

Discussed how it can be implemented using type classes.

Three Key Concepts:

Typeclass — a functional interface

Typeclass Instance — implement this Typeclass for a given Type

Ops / Syntax — provide OO-like call syntax

Slides.


16.30–17.00 Introduction to Haskell Rúnar Bjarnason

Quick intro to Haskell programming language: HOF, strongly and statically typed but quite (no need to always specify types explicitly), has polymorphic types, it’s purely functional = programming with functions, programs in Haskell are IO values, it is lazy (for example, OR never! evaluates the second argument), has unbounded precision ints

because Haskell is lazy, min = head . Sort is O(n) operation!

Recommended books:

  1. Haskell from first principles
  2. Learn You a Haskell for Great Good
  3. Parallel and concurrent programming in Haskell

LIGHTNING TALKS 
- Typesafe regexes 
— Jon Pretty
- Parsing with Derivatives
 — Andrew Kuhnhausen
- Ridiculously simple Google Cloud Datastore API for Scala
— Jon Pretty
- Spark Transformations and Actions in Racket-Spark-Light
 — Yifan Xing
- Shims Exists: Bringing together scalaz and cats
 — Daniel Spiewak
- Scala Clippy: contextual compile errors 
— Adam Warski

Like what you read? Give Oli M a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.