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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
23
FRONTIN | Elas Programam - Programação Funcional no Front-end
anabastos
0
140
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
280
Other Decks in Programming
See All in Programming
はてなアカウント基盤 State of the Union
cockscomb
1
1.3k
コーディングルールの鮮度を保ちたい for SRE NEXT 2026 / keep-fresh-go-internal-conventions-sre-next-2026
handlename
0
140
関数型プログラミングのメリットって何だろう?
wanko_it
0
180
音楽のための関数型プログラミング言語mimiumにおける多段階計算の活用
tomoyanonymous
1
340
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
860
AI時代、エンジニアはどう育つのか -未経験エンジニアの成長を間近で見て考えたこと-
thasu0123
0
130
これからAgentCoreを触る方へトレンドはGatewayです
har1101
6
500
吝嗇家のためのAI活用 / AI development for miser - ChatGPT + Issue Driven Development
tooppoo
0
190
継続モナドとリアクティブプログラミング
yukikurage
3
610
型も通る、synthも通る、それでも危ない 〜AIのCDKの権限とコストを機械で検証する〜 / It Passes Type Checks, It Passes Synth Checks, but It’s Still Risky — Automatically Verifying Permissions and Costs in AI’s CDK —
seike460
PRO
1
360
Hatena Engineer Seminar #37「言語モデルの活用に関する研究」
slashnephy
0
520
PHP初心者セッション2026 〜生成AIでは見えない裏側を知る:今だからLAMPを通して仕組みを学ぶ〜
kashioka
0
510
Featured
See All Featured
Docker and Python
trallard
47
4k
SERP Conf. Vienna - Web Accessibility: Optimizing for Inclusivity and SEO
sarafernandez
2
1.5k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
40k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
320
Writing Fast Ruby
sferik
630
63k
Thoughts on Productivity
jonyablonski
76
5.2k
The AI Search Optimization Roadmap by Aleyda Solis
aleyda
1
6k
Darren the Foodie - Storyboard
khoart
PRO
3
3.4k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Tell your own story through comics
letsgokoyo
1
1k
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