Getting Started

with ReasonML

William Beard

🐦 @thewillbeard

⚡️⚡️

5 - 10 mins

Find slides & resources @ gist.github.com/wbeard

Reason

  • A thin language/layer on top of OCaml
  • Workflow for compiling to JS & bytecode

Why?

  • Statically typed
  • Functional (but can do side effects)
  • Compiles to JavaScript
  • Comprehensive tools

Easy to write react components

 

JS Workflow

Dear future self,

`yarn add` does not work.

Bucklescript

Like babel for reason

reason-react

Don't forget -make-world!

Prebaked

Mental Mapping

  • Reason is a superset of OCaml == writing es2025
  • Bucklescript compiles it == babel + js bindings
  • bsconfig.json == package.json for deps & package info
  • reason-react == react, but reason
  • BuckleTypes == js bindings (like polyfills, popular node modules, etc.)

Harder parts

  • Ecosystem is very new so projects are in broken states at times
  • Type errors, especially function signature mismatches can be hard to parse
  • Bucklescript API is documented, but not much usage documentation

reasonable-hacker-news

Follow along as I fumble around with reason

Thanks!

Getting Started with ReasonML

By willb

Getting Started with ReasonML

  • 1,399