Re:Asset minification with Elm (2018)
by Chadtech_Real on Tuesday August 27, 2019 @06:29PM
(#20815088)
I havent actually written any ReasonML, but I once had to review some my former coworker wrote. Thats the extent of my ReasonML experience, so I dont have much of an opinion. However, I was surprised that the ReasonML code I looked at relied on impure functions. I like pure functions so that scares me off a bit from the OCaml as a whole.
Regarding static html/css, I havent done that either, so I dont know about it.
Re:Asset minification with Elm (2018)
by yawaramin on Wednesday August 28, 2019 @12:14AM
(#20816729)
> the ReasonML code I looked at relied on impure functions. I like pure functions so that scares me off a bit from the OCaml as a whole.
ReasonML (OCaml) allows impure functions but the best practice is to stay pure whenever possible. It's a very pragmatic language so despite providing all the functional and immutable programming features, it allows you to cut through the bureaucracy if you need to.
Re:Asset minification with Elm (2018)
by SupremumLimit on Tuesday August 27, 2019 @07:44PM
(#20815510)
One way to get static HTML/CSS from Elm is to execute the JS it produces and serialise the results from the DOM. That's what I do in my static site generator Elmstatic: https://korban.net/elm/elmstatic
https://reasonml.github.io/docs/en/what-and-why
I've really been digging slowly into ReasonML and the biggest gain I can see is that valid reason === valid ocaml (and there's some good server libraries out there for ocaml)
I also like that JSX is the templating language, not that it matters.
Also, have you had any success with manipulating Elm to output static HTML/CSS as well as JS? I know it can do it, but I've never been able to manipulate how it does it (most recent version I tried with: 0.18)