Systematic Software with Scala

Adam Rosien @arosien
Inner Product LLC inner-product.com

1 Apr 2019

  1. Systematic?
  2. Demonstration
  3. Semantics of Strategies
  4. Strategies
  5. Summary

Systematic?

Systematic processes are …

Consistent

Scalable

Save Time

What if (Scala) programming could be systematic? (A science?)

Consistent code = readable code

Juniors more productive

Better separation between levels of abstraction

Programming strategies

Demonstration

Demonstrate 5 strategies

Build a stream processing system (like FS2, Monix, etc.)

What’s a Stream?

Read the Literature

Huge literature

  • FRP
  • The Red book
  • FrTime
  • Scala.React
  • .Net Rx
  • etc.

A Stream is like a List

(where data is ordered by time, instead of space)

A Stream is like a List

Great artists steal

Many APIs are algebraic.

plus laws

How do we implement the ???s?

Reification

Reification

Reification

Reification

how do we run it?

Interpreter

Structural Recursion

Interpreter

Structural Recursion

Structural Recursion

how do we implement the ???s?

Follow the Types

Structural Recursion

Follow the Types

Follow the Types

Semantics of Strategies

Semantics of Strategies

 

operational

vs.

denotational

Strategies

Read the Literature: great artists steal

Algebraic Data Types: ANDs and ORs

Structural Recursion: transform ADTs

Sequencing: what must happen after something else, and what things can happen at the same time.

Applicative & Monad

Interpreters: separate what from how

Reification: functions as data

Church-Encoding: data as functions

Type Classes: ad-hoc polymorphism

Summary

Thank you!

Adam Rosien @arosien

Inner Product LLC inner-product.com

Hire us to teach your team! ☝︎

 

Special thanks to Noel Welsh for his hard work in codifying these strategies.