SlideShare a Scribd company logo
Reasonable 🍺 React
What I do
Thomas Haessle
CTO @ Cutii
Teacher @ MIAGE Lille
@Oteku

https://oteku.github.io/ cutii.io
Cutii au coeur
de la ville
Création
d’un réseau
d’animateurs
locaux
Implication
des agents
publics
Villes
numériques
Valoriser le
patrimoine
MUSEUM
www.cutii.io
Cutii est une plateforme de mise en relation à distance pour les
personnes isolées ou dépendantes avec leur famille et une communauté
regroupant particuliers, aidants, associations et médecins.
Communauté solidaire
CUTII RÉSEAU
Activités premium Recréer du lien social Rencontres citoyennes
est 🤩
Tooling
Fast (web point of view)
+
+
Servo
SSR
est 🥶
Style Packaging Test « improve » Js libs
NPM Nightmare
as a bytecode 🤨
🤦
🧝
'
dans une perspective reactjs
Reason lets you write simple, fast and quality type safe
code while leveraging both the JavaScript & OCaml ecosystems.
Syntaxe (
let greeting: string = "hello"; /* let binding */
let score: int = 10;
let score_mut: ref(int) = ref(10); /* immutable by default */
score_mut := 5;
type scoreType = int; /* type alias */
let score: scoreType = 10;
/* function as values */
let concat_str: (string, string) => string = (a, b) => a ++ b;
/* OCaml type inference */
let twelve = 12; /* val twelve : int */
let add_int = (a, b) => a + b; /* val add_int : (int, int) -> int */
let add_float = (a, b) => a +. b; /* val add_float : (float, float) -> float */
/* Lists are immutable, fast at prepending items */
let beers: list(string) = ["La Maline", "La Rouge Flamande", "Lepers 8", "Psychedelia"];
/* Arrays are mutable, fast at random access & updates */
let breweries: array(string) = [|"Triez", "Lepers"|];
breweries[0] = "Thiriez"; /* Triez is a district of Mouvaux not a brewery */
breweries[3] = "Craig Allan";
Types algébriques )
/* Product types */
type point2d = (int, int);
type couple('a, 'b) = ('a, 'b);
type beer = {
label: string,
abv: float,
};
/* Sum types */
type boolean =
| True
| False;
type numeric =
| Int(int)
| Float(float);
type option('a) =
| Some('a)
| None;
Correspondance par motifs 🖖
/* product type */
let fst = ((x, _)) => x; /* val fst : (('a,'b)) => 'a */
let snd = ((_, y)) => y; /* val snd : (('b,'a)) => 'a */
/* sum type */
let apply = (f, optional) =>
switch (optional) {
| Some(x) => Some(f(x))
| None => None
}; /* val apply : ('b => 'a, option('b)) => 'a */
Fonctions 🤘
let prices = [10., 42., 11.5, 5.9]; /* val prices : list(float) */
/* spead operator : like in JS */
let prepend = (elem, tab) => [elem, ...tab]; /* val prepend : ('a, list('a)) => list('a) */
let add_tax = (tax, tab) => List.map(elem => elem *. (1. +. tax), tab);
/* partial application */
let add_FR_tax = add_tax(0.2); /* val add_FR_tax : list(float) => list(float) */
/* pipe operator */
prepend(0.8, prices) |> add_FR_tax |> List.sort(Pervasives.compare);
/* same as */
List.sort(Pervasives.compare, add_FR_tax(prepend(0.8, prices)));
/* pipe first operator */
0.8 ->prepend(prices) |> add_FR_tax |> List.sort(Pervasives.compare);
/*
* let f = ('a, 'b) => …
* x |> f === f(x)
* y |> f(x) === f(x)(y) === f(x,y)
* x -> f(y) === f(x)(y) === f(x,y)
*/
/* named parameters */
let concat = (~left, ~right) => left @ right; /* val concat : (list('a), list('a)) => list('a) */
concat(~left=[1., 3.2], ~right=prices);
ason est 🐫
• Langage statiquement typé
• Une syntaxe OCaml
• OCaml + JSX
• Un langage multiparadigmes mais qui incite fortement à
la programmation fonctionnelle
• Statiquement typé (langage de type ML)
• Compilé vers natif, bytecode ou js (via js_of_ocaml ou
buckelscript)
🥴
• Rapide … très rapide
• En constante amélioration
• Licence LGPL
• Compile le bytecode bas niveau en js
• Orienté opam
• Fait des optimisation bluffantes sur 

le js produit
• Compile le raw lambda  en js
• Orienté npm
• produit un code js proche du code 

original
Buckelscript interop🧪
/* js string with supports Unicode characters */
let icn_cheers = {js|'🍻'|js};
let icn_tube = [%raw {|'🧪'|}];
/* binding to global value */
type timerId;
[@bs.val] external setTimeout: (unit => unit, int) => timerId = "setTimeout";
[@bs.val] external clearTimeout: float => timerId = "clearTimeout";
[@bs.scope "Math"] [@bs.val] external random: unit => float = "random";
let someNumber = random();
/* Handle null or undefined values */
let jsNull = Js.Nullable.null;
let jsUndefined = Js.Nullable.undefined;
/* Object method */
[@bs.send] external map: (array('a), 'a => 'b) => array('b) = "map";
[|1, 2, 3|] ->map(a => a + 1) |> Js.log;
/* module */
[@bs.module "path"] external dirname : string => string = "dirname";
/* variadic function */
[@bs.module "path"] [@bs.variadic]
external join : array(string) => string = "join";
let v = join([|"a", "b"|]);
ReasonReact 😎
Mieux que des mots : une démo
Buckelscript bindings pour reactjs
OU
https://github.com/oteku/reason-react-beer
ReasonReactNative 📱
https://github.com/oteku/reason-react-native-welcome
• ReactNative bindings 🔧 : https://github.com/reasonml-community/
reason-react-native
Au delà du web 3
• Applications Native : brisk-reconciler 

➡ Electron app avec Revery 💎 : https://www.outrunlabs.com/revery/ 

➡ Native UI avec Brisk ⚗: https://github.com/briskml/brisk
Encore expérimental mais méritent d’être suivi !
Merci !

Des questions ?
🤔

More Related Content

PDF
Javascript good parts - for novice programmers
PPT
Javascript Ks
PPTX
Advanced JavaScript
PDF
Javascript status 2016
KEY
Learning To Walk In Shoes
KEY
iOS Einführung am Beispiel von play NEXT TEE
KEY
JavaScript Neednt Hurt - JavaBin talk
PDF
Converting your JS library to a jQuery plugin
Javascript good parts - for novice programmers
Javascript Ks
Advanced JavaScript
Javascript status 2016
Learning To Walk In Shoes
iOS Einführung am Beispiel von play NEXT TEE
JavaScript Neednt Hurt - JavaBin talk
Converting your JS library to a jQuery plugin

Similar to ⚛️ Reasonable React (with beers) (20)

PDF
Get started with Reason
PDF
Nik Graf - Get started with Reason and ReasonReact
PDF
Reason - introduction to language and its ecosystem | Łukasz Strączyński
PDF
The Future of JavaScript (Ajax Exp '07)
PDF
Web futures
PDF
Functional JS for everyone - 4Developers
PDF
Mini-curso JavaFX Aula2
PDF
Introduction to ReasonML
PDF
Perkenalan ReasonML
PDF
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
PDF
Workshop 10: ECMAScript 6
PDF
deepjs - tools for better programming
KEY
【第一季第三期】Thinking in Javascript & OO in Javascript - 清羽
PDF
Eloquent JavaScript Book for Beginners to Learn Javascript
PDF
EloquenFundamentalsof Web Developmentt_JavaScript.pdf
PPTX
Academy PRO: ES2015
PDF
JavaScript The Definitive Guide 7th Edition David Flanagan
PDF
ECMAScript 6 major changes
PPT
introduction to javascript concepts .ppt
Get started with Reason
Nik Graf - Get started with Reason and ReasonReact
Reason - introduction to language and its ecosystem | Łukasz Strączyński
The Future of JavaScript (Ajax Exp '07)
Web futures
Functional JS for everyone - 4Developers
Mini-curso JavaFX Aula2
Introduction to ReasonML
Perkenalan ReasonML
HelsinkiJS meet-up. Dmitry Soshnikov - ECMAScript 6
Workshop 10: ECMAScript 6
deepjs - tools for better programming
【第一季第三期】Thinking in Javascript & OO in Javascript - 清羽
Eloquent JavaScript Book for Beginners to Learn Javascript
EloquenFundamentalsof Web Developmentt_JavaScript.pdf
Academy PRO: ES2015
JavaScript The Definitive Guide 7th Edition David Flanagan
ECMAScript 6 major changes
introduction to javascript concepts .ppt
Ad

Recently uploaded (20)

PPTX
Essential Infomation Tech presentation.pptx
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Digital Strategies for Manufacturing Companies
PDF
System and Network Administraation Chapter 3
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
L1 - Introduction to python Backend.pptx
PPTX
history of c programming in notes for students .pptx
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
System and Network Administration Chapter 2
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
medical staffing services at VALiNTRY
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
AI in Product Development-omnex systems
PDF
Understanding Forklifts - TECH EHS Solution
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PPTX
ai tools demonstartion for schools and inter college
PDF
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Essential Infomation Tech presentation.pptx
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Digital Strategies for Manufacturing Companies
System and Network Administraation Chapter 3
How Creative Agencies Leverage Project Management Software.pdf
L1 - Introduction to python Backend.pptx
history of c programming in notes for students .pptx
Navsoft: AI-Powered Business Solutions & Custom Software Development
System and Network Administration Chapter 2
PTS Company Brochure 2025 (1).pdf.......
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Design an Analysis of Algorithms I-SECS-1021-03
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
medical staffing services at VALiNTRY
Design an Analysis of Algorithms II-SECS-1021-03
AI in Product Development-omnex systems
Understanding Forklifts - TECH EHS Solution
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
ai tools demonstartion for schools and inter college
Adobe Premiere Pro 2025 (v24.5.0.057) Crack free
Ad

⚛️ Reasonable React (with beers)

  • 2. What I do Thomas Haessle CTO @ Cutii Teacher @ MIAGE Lille @Oteku
 https://oteku.github.io/ cutii.io Cutii au coeur de la ville Création d’un réseau d’animateurs locaux Implication des agents publics Villes numériques Valoriser le patrimoine MUSEUM www.cutii.io Cutii est une plateforme de mise en relation à distance pour les personnes isolées ou dépendantes avec leur famille et une communauté regroupant particuliers, aidants, associations et médecins. Communauté solidaire CUTII RÉSEAU Activités premium Recréer du lien social Rencontres citoyennes
  • 3. est 🤩 Tooling Fast (web point of view) + + Servo SSR
  • 4. est 🥶 Style Packaging Test « improve » Js libs NPM Nightmare
  • 5. as a bytecode 🤨 🤦 🧝 ' dans une perspective reactjs
  • 6. Reason lets you write simple, fast and quality type safe code while leveraging both the JavaScript & OCaml ecosystems.
  • 7. Syntaxe ( let greeting: string = "hello"; /* let binding */ let score: int = 10; let score_mut: ref(int) = ref(10); /* immutable by default */ score_mut := 5; type scoreType = int; /* type alias */ let score: scoreType = 10; /* function as values */ let concat_str: (string, string) => string = (a, b) => a ++ b; /* OCaml type inference */ let twelve = 12; /* val twelve : int */ let add_int = (a, b) => a + b; /* val add_int : (int, int) -> int */ let add_float = (a, b) => a +. b; /* val add_float : (float, float) -> float */ /* Lists are immutable, fast at prepending items */ let beers: list(string) = ["La Maline", "La Rouge Flamande", "Lepers 8", "Psychedelia"]; /* Arrays are mutable, fast at random access & updates */ let breweries: array(string) = [|"Triez", "Lepers"|]; breweries[0] = "Thiriez"; /* Triez is a district of Mouvaux not a brewery */ breweries[3] = "Craig Allan";
  • 8. Types algébriques ) /* Product types */ type point2d = (int, int); type couple('a, 'b) = ('a, 'b); type beer = { label: string, abv: float, }; /* Sum types */ type boolean = | True | False; type numeric = | Int(int) | Float(float); type option('a) = | Some('a) | None;
  • 9. Correspondance par motifs 🖖 /* product type */ let fst = ((x, _)) => x; /* val fst : (('a,'b)) => 'a */ let snd = ((_, y)) => y; /* val snd : (('b,'a)) => 'a */ /* sum type */ let apply = (f, optional) => switch (optional) { | Some(x) => Some(f(x)) | None => None }; /* val apply : ('b => 'a, option('b)) => 'a */
  • 10. Fonctions 🤘 let prices = [10., 42., 11.5, 5.9]; /* val prices : list(float) */ /* spead operator : like in JS */ let prepend = (elem, tab) => [elem, ...tab]; /* val prepend : ('a, list('a)) => list('a) */ let add_tax = (tax, tab) => List.map(elem => elem *. (1. +. tax), tab); /* partial application */ let add_FR_tax = add_tax(0.2); /* val add_FR_tax : list(float) => list(float) */ /* pipe operator */ prepend(0.8, prices) |> add_FR_tax |> List.sort(Pervasives.compare); /* same as */ List.sort(Pervasives.compare, add_FR_tax(prepend(0.8, prices))); /* pipe first operator */ 0.8 ->prepend(prices) |> add_FR_tax |> List.sort(Pervasives.compare); /* * let f = ('a, 'b) => … * x |> f === f(x) * y |> f(x) === f(x)(y) === f(x,y) * x -> f(y) === f(x)(y) === f(x,y) */ /* named parameters */ let concat = (~left, ~right) => left @ right; /* val concat : (list('a), list('a)) => list('a) */ concat(~left=[1., 3.2], ~right=prices);
  • 11. ason est 🐫 • Langage statiquement typé • Une syntaxe OCaml • OCaml + JSX • Un langage multiparadigmes mais qui incite fortement à la programmation fonctionnelle • Statiquement typé (langage de type ML) • Compilé vers natif, bytecode ou js (via js_of_ocaml ou buckelscript)
  • 12. 🥴 • Rapide … très rapide • En constante amélioration • Licence LGPL • Compile le bytecode bas niveau en js • Orienté opam • Fait des optimisation bluffantes sur 
 le js produit • Compile le raw lambda  en js • Orienté npm • produit un code js proche du code 
 original
  • 13. Buckelscript interop🧪 /* js string with supports Unicode characters */ let icn_cheers = {js|'🍻'|js}; let icn_tube = [%raw {|'🧪'|}]; /* binding to global value */ type timerId; [@bs.val] external setTimeout: (unit => unit, int) => timerId = "setTimeout"; [@bs.val] external clearTimeout: float => timerId = "clearTimeout"; [@bs.scope "Math"] [@bs.val] external random: unit => float = "random"; let someNumber = random(); /* Handle null or undefined values */ let jsNull = Js.Nullable.null; let jsUndefined = Js.Nullable.undefined; /* Object method */ [@bs.send] external map: (array('a), 'a => 'b) => array('b) = "map"; [|1, 2, 3|] ->map(a => a + 1) |> Js.log; /* module */ [@bs.module "path"] external dirname : string => string = "dirname"; /* variadic function */ [@bs.module "path"] [@bs.variadic] external join : array(string) => string = "join"; let v = join([|"a", "b"|]);
  • 14. ReasonReact 😎 Mieux que des mots : une démo Buckelscript bindings pour reactjs OU https://github.com/oteku/reason-react-beer
  • 15. ReasonReactNative 📱 https://github.com/oteku/reason-react-native-welcome • ReactNative bindings 🔧 : https://github.com/reasonml-community/ reason-react-native
  • 16. Au delà du web 3 • Applications Native : brisk-reconciler ➡ Electron app avec Revery 💎 : https://www.outrunlabs.com/revery/ ➡ Native UI avec Brisk ⚗: https://github.com/briskml/brisk Encore expérimental mais méritent d’être suivi !