Reasonml: Indyjs, August 2017
Reasonml: Indyjs, August 2017
Reasonml: Indyjs, August 2017
1. yes
2. OF COURSE!
3. no
4. maybe
[^_^]
Complaints
"there are five hundred thousand packages to capitalize the first
letter of every word, and each of them have about fifty hundred
thousand dependencies, each of which is in turn has about one
line of code."
etc., etc.,
-- JavaScript for People Who Hate JavaScript
React is cool, OMG
Static Typing
Functional
Programming
Tools to improve
Javascript experience
Flow
Flow is a static typechecker for Javascript
Flow
Prettier
-- <@_chenglou>
Compile to JS
• what are you talking about?
• I don't like them because ___
• I have used them, but ___
List of languages that
compile to JS ·
jashkenas/
coffeescript Wiki
Scala.js
More mainstream(?)
• Dart
• Typescript
More fun(?)
• O'Reilly book
• Free to read online
• website
OCaml in the "news"
Hack PHP compiler
Hack
src
Flow
"Using data flow analysis, Flow infers types and tracks data as it
moves through your code. You don't need to fully annotate your
code before Flow can start to find bugs."
OCaml provides:
• Algebraic data types
• Pattern matching (operate on Abstract syntax trees)
• Statically typed
Rust
cd my-first-app
npm run build
node lib/js/src/demo.js
[...jump to Code...]
Syntax
• https://reasonml.github.io/guide/language/overview
Code Optimization
ReasonML:
let muli a b => a * b;
JS:
var Caml_int32 = require("stdlib/caml_int32");
var muli = Caml_int32.imul;
Code optimization (2)
• codepan
Visual Studio Code
Where is it used?
• over quarter of the code on messenger.com
React-Reason
• Reason bindings for ReactJS docs
It integrates deeply with language level features in order to create
an expressive, statically typed API, packed into a tiny API surface
area.
By binding directly to ReactJS, ReasonReact gives you access to
the entire React ecosystem, so that you can adopt it incrementally.
• example project -- https://github.com/reasonml-
community/reason-react-example
Thank you
Questions?