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
21
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
ECSアプリログをFireLensでコスト削減しようとしたけど諦めた話 in Fargate×Node.js
akihisaikeda
2
4.2k
例外の正しい扱い方 そのエラー try-catchして大丈夫?
jinwatanabe
0
320
【やさしく解説 設計編 #0】DDDのコード、読めるのに分からない人へ
panda728
PRO
1
190
その問い、本当に正しいですか?AI時代のエンジニアに必要な哲学と認知科学 / ai-philosophy-cognitive-science
minodriven
14
6.6k
LLMによるContent Moderationの本番運用の裏側と品質担保への挑戦
suikabar
3
820
鹿野さんに聞く!『TypeScriptコードレシピ集』で磨く実践力
tonkotsuboy_com
4
990
Creating Composable Callables in Contemporary C++
rollbear
0
190
音楽のための関数型プログラミング言語mimiumにおける多段階計算の活用
tomoyanonymous
1
220
Vue × Nuxt × Oxc どこまで使える?実運用の現在地
andpad
0
350
Even G2とAWSで推しのエージェントを召喚しよう!
har1101
1
140
AI がコードを書く時代における新卒エンジニアの仕事風景 (2026) / New Graduate Engineers in the Era of AI Coding (2026)
sushichan044
0
200
ローカルLLMでどこまでコードが書けるか -拡張版 / How much code can be written on a local LLM Extended
kishida
12
4.6k
Featured
See All Featured
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Rails Girls Zürich Keynote
gr2m
96
14k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
380
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
410
Making Projects Easy
brettharned
120
6.7k
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
350
Leo the Paperboy
mayatellez
8
1.9k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.2k
Between Models and Reality
mayunak
4
360
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
72
40k
The Pragmatic Product Professional
lauravandoore
37
7.4k
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