Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
ReasonML - Front in Vale 2018
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Ana Luiza Portello
August 11, 2018
Programming
340
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
ReasonML - Front in Vale 2018
Ana Luiza Portello
August 11, 2018
More Decks by Ana Luiza Portello
See All by Ana Luiza Portello
Clojure BR - Brazilian Utils: Simplificando o caos brasileiro com Clojure em uma biblioteca open source
anabastos
0
20
FRONTIN | Elas Programam - Programação Funcional no Front-end
anabastos
0
130
Workshop JSFP - SEMCOMP 2021
anabastos
0
310
Clojure é um Java melhor que Java - Codecon 2021
anabastos
0
180
Clojure 101 - Criciuma Dev
anabastos
0
370
TDC POA - GraphQL
anabastos
1
310
TDC Porto Alegre 2019 - JS Funcional com Ramda
anabastos
0
290
BackEndSP - GraphQL
anabastos
0
270
Git & Github - RLadies
anabastos
1
270
Other Decks in Programming
See All in Programming
Developing with AI Agents — Codex, Claude Code & Cowork Practical Guide
x5gtrn
PRO
0
1.3k
OSもどきOS
arkw
0
590
TSKaigi Night Talks 2026_TypeScriptでサプライチェーンの整合性を型に閉じ込める
geekplus_tech
0
410
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
260
Semantic Version 単位で戦略を柔軟に変えて、パッケージアップデートを自動化する
daitasu
1
300
脅威をエンジニアリングの糧にして――現場編 / Turning Threats into Engineering Fuel — Field Edition
nrslib
0
300
「AIで開発し、AIを届ける」をEvalでつなぐ 〜AIネイティブに始めるプロダクト開発の実践〜 / Connecting "Develop with AI, deliver AI" with Eval
rkaga
4
5.4k
Spring Security 実践 ─ GraphQL APIで実務に役立つ 認証・認可 を学ぶ
wagyu
0
260
Go1.27で導入されるジェネリクスメソッドでできること
mackee
0
170
LaravelLive Japan の裏方のすべて — 第188回 PHP勉強会@東京 (2026-06-24)
suguruooki
2
120
エンジニア向け会社紹介/Findy Company Profile
findyinc
6
350k
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.4k
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Deep Space Network (abreviated)
tonyrice
0
210
Chasing Engaging Ingredients in Design
codingconduct
0
230
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.5k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Building Better People: How to give real-time feedback that sticks.
wjessup
370
20k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
Evolving SEO for Evolving Search Engines
ryanjones
0
220
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
620
Game over? The fight for quality and originality in the time of robots
wayneb77
1
200
Transcript
ANA LUIZA BASTOS github.com/anabastos @naluhh @anapbastos Software Developer na Quanto
e cientista da computação na PUC-SP anabastos.me
JSLADIES fb.com/jsladiesbr twitter.com/jsladiessp meetup.com/JsLadies-BR/ LAMBDA.IO t.me/lambdastudygroup github.com/lambda-study-group/ meetup.com/Lambda-I-O-Sampa- Meetup/
None
JAVASCRIPT
Javascript foi pensado em 10 dias pelo Brendan Eich em
1995 para fazer sites interativos
None
None
None
None
Linguagens que compilam JS são os novos frameworks JS.
• Mudar de um ecossistema para outro. • Necessidade de
reescrever o projeto do 0. • Problemas com Interop. • Maioria das tools e frameworks são para o JS.
O que é ReasonML?
Mantida e usada pelo Facebook Se tornou open source em
2016 Criado pelo Jordan Walke (criador do React) Sintaxe em cima do OCaml e inspirada em JavaScript
Mesmo ecossistema e workflow
“it's a new syntax and toolchain for Ocaml.”
O que é OCaml?
Linguagem da familia ML(SML, OCaml, Haskell) Conhecido pela sua mantenabilidade
Décadas de pesquisa em sistemas de tipos e engenharia de compiladores tops
O que é ser uma nova syntax pra OCaml?
WORKFLOW OCAML
Ocaml AST OCAMLOPT Syntax OCaml(.ml) OCAMLC NativeCode ByteCode BUCKLESCRIPT Javascript
None
Ocaml AST Syntax Reason(.re) BUCKLESCRIPT OCAMLOPT Syntax OCaml(.ml) OCAMLC Javascript
NativeCode ByteCode .ml == .re
JAVASCRIPT FRIENDLY
let msg = ”hello world!”; Js.log(msg); // hello world! Hello
World
let add = (a, b) => a + b; Função
math.re
import { add } from “math.re”; add(1, 2) // 3
index.js
ESTRUTURAS DE DADOS IMUTÁVEIS & OTIMIZADAS const
É uma LINGUAGEM ESTATICAMENTE tipada.
String Bool List Float Int Record Tuple Option Unit
Inferencia de Tipos
let add = (a, b) => a + b; Inferencia
de Tipos val add: Int => Int => Int
/* REASON */ let add = (a, b) => a
+ b; /* JS + FLOW / TYPESCRIPT */ const add = (a: number, b: number): number => a + b;
Declaração de Tipos
None
type item = { title: string, completed: boolean, }; type
state = { items: list(item) };
type statusType = ToDo | Doing | Done
Option
null NaN -Infinity “undefined is not a function”
type option('a) = None | Some('a);
Currying & Partial Application (Proposal)
let add = (x, y) => x + y; let
inc = add(1); inc(10); /* 11 */
let multiply = (x, y) => x * y; let
multiplyBy10 = multiply(10); multiplyBy10(10); /* 100 */
Pipeline Operator (Proposal)
let number = 50 number |> inc |> multiplyBy10 /*
510 */ multiplyBy10(inc(50))
Pattern Matching (Proposal)
type color_type = White | Black let colorHex = (color)
=> switch(color) { | White => “#FFFFFF” | Black => “#000000” _ => “#999999” };
Recursão (ES6)
None
ReasonML x ReasonReact
REACT BINDINGS
None
JSX
AMBIENTE
npm install -g bs-platform
create-react-app NOME X bsb -init NOME -theme react
yarn start
None
None
NOME/ README.md node_modules/ public/ favicon.ico index.html src/ index.re index.css app.re
app.css Logo.svg package.json bsconfig.json { "name": <app-name>, "sources": [ "src" ], "bs-dependencies": [ "reason-react", "bs-jest", ], "reason": { "react-jsx": 2 }, "bsc-flags": [ "-bs-super-errors" ], "refmt": 3 } bsconfig.json = package.json + .babelrc + .eslintrc
"scripts": { "build": "bsb -make-world -clean-world", "watch": "bsb -make-world -clean-world
-w" }
Eu vou ter que reescrever tudo?
Adicionar bsconfig.json Buildar com o bucklescript
Já tem as features da ES2030 sem migrar de ecossistema
para outro
Documentação Ocaml caml.inria.fr/pub/docs/manual-ocaml/ Documentação BuckleScript bucklescript.github.io/bucklescript/Manual.html Documentação Reason reasonml.github.io/docs/en/quickstart-javascript.html Documentação
ReasonReact reasonml.github.io/reason-react/docs/en/installation.html Reason Package Index redex.github.io/ Exploring Reason reasonmlhub.com/exploring-reasonml
Comunidade Discord discord.gg/reasonml Twitter twitter.com/reasonml “StackOverFlow” reasonml.chat
OBRIGADA :) speakerdeck.com/anabastos anabastos.me github.com/anabastos @naluhh @anapbastos