Reason for the Reasonable πŸ€“

Typed FP, bad puns, and emojis πŸ™Œ

What It Is πŸ˜€

  • Strongly typed functional programming language (JS of FP languages)
  • Dialect of Ocaml that looks like JS
  • Compiles to JS (BuckleScript), Node (BuckleScript), orΒ  Native (Ocaml)
  • Uses not 1, not 2, but 3 APIs: Reason/Ocaml/BuckleScript

What It's Not 😞

  • Pure
  • HKT or Ad Hoc Polymorphism
  • Super duper functional algabraic expialidocious

BenefitsΒ  πŸ‘

  • Looks like JS with the just right amount of FP
  • Types are inferred
  • ADT
  • Fast compile times
  • Bindings (node, express, react, jest, etc.)
  • FFI
  • Write once, run everywhere
  • Macros
  • Plain ole' JS escape hatch - desperate times call for desperate measures

Downsides πŸ‘Ž

  • Small community
  • Good but not great error messages
  • No create-reason-react-app
  • bs-platform build dependency
  • API hell
  • Data first? Data last? Make up your mind
  • Did I mention BS?

Similarities πŸ’©

  • Objects
  • Functions
  • Arrays
  • Strings
  • let bindings
  • Mutable values
  • Boolean
  • for/while loops
  • if/else
  • Promise
  • Destructuring
  • Exceptions

Differences πŸ‘¨β€πŸŽ€

  • Int/Floats
  • Lists
  • Records
  • ADT/Variants
  • Pipe/pipe first (|> / ->)
  • Options (Maybes)
  • Tuples
  • Chars
  • Global Modules
  • Labeled/optional/as function arguments w/partial application
  • Unused variable indicators

Code Time ⏰

ReasonReact 🀯

  • Everything you like about Reason in React
  • Reminder: Go to ReasonReact in Browser

The End is Nigh πŸ˜„

Made with Slides.com