Reason

SBJS

@jamesdabbs

React

&

kingcons

Reasons for Reason

  • TypeScript

  • Elm

  • ReasonML

  • JavaScript

Reasons for Reason

  • Strong type system

  • Good, ergonomic type inference

  • Sound types

  • Small, easy to reason about

If it compiles

it runs

(without error)

*

Reasons for Reason

Reasons for Reason

  • Native support is slated

  • Tooling is surprisingly good

  • Designed for production use

  • Designed for adoptability

Code Samples

Findings

(so far)

  • Compile and iteration time is amazing

  • The type system is at a nice sweet spot

    • Inference generally just works

    • If it compiles it runs

    • If it doesn't compile, it caught a bug

  • Compiled output is readable, small, and structured similarly to the source

Findings

(so far)

  • Get to use OCaml, Reason, and JS ecosystems

  • Often have to keep all of those layers in your head simultaneously

Findings

(so far)

  • `optional` chaining requires more boilerplate than I'd like

  • Impossible to have `undefined is not a function` errors

Findings

(so far)

  • Some things that require a library in JS are just language features

    • Routing ⇒ pattern matching

    • Component composition

    • State management

Findings

(so far)

  • Some things are irritating

    • The autoformatter is fiddly

      • Comments

      • Test blocks

    • JSX requires boilerplate

      • <p>{React.string(string_of_int(5)}</p>

Findings

(so far)

  • Compile step has benefits

    • Optimizations

    • Dead function and module removal

    • Amenable to tree-shaking

    • Produces engine-friendly JS code

  • I've found it promising

  • Planning for one more experiment before pushing for adoption at work

  • Try it out!

Made with Slides.com