by dmkolobov · 5y ago · 0 comments
Purescript also shares this goal, and it is a bummer, performance-wise, in older browsers that don't handle currying and various other "readable" representations well.
Worse still, if your target output is readable, then someone might start touching the compiled runtime objects with Javascript and then... god help you as you watch the guarantees of your fancy type system unravel before your very eyes.
https://rescript-lang.org/docs/manual/latest/shared-data-typ...
- Uncurrying functions
- Compiling OCaml modules to idiomatic JavaScript objects
- Compiling OCaml record values to idiomatic JavaScript objects
- Compiling tail recursion to idiomatic while loops
- And so on.
> someone might start touching the compiled runtime objects with Javascript and then... god help you as you watch the guarantees of your fancy type system unravel before your very eyes.
That's exactly what genType is for--it produces JavaScript, TypeScript, and Flow interfaces for ReScript output code so that people in the JS world can consume it transparently.