Fork me on GitHub
#clojurescript
<
2021-02-20
>
datran05:02:34

Does anybody know where I can find documentation on how to build clojurescript and run the tests? I'd like to try fixing an issue but I've always used cljsbuild and shadow-cljs, so I'm not sure how to build vanilla cljs.

Mio Q05:02:46

is there anything like elm-ui / theme-ui in the cljs ecosystem? closest thing Ive found is this: https://github.com/hoplon/ui

simongray10:02:58

Can you explain what elm-ui/theme-ui is for those of us who haven't used Elm?

Mio Q10:02:05

@U4P4NREBY I havent used elm either, but watched a clip on it. essentially an abstraction on top of html/css that does away with the bad parts. theme-ui is similar but less ambitious, you use design tokens instead of hardcoding with pixels and hex/rgb colors

Mio Q10:02:56

this should give a good idea

Mio Q10:02:33

width fill, centerY, spacing 30
el [ alignRight ] myElement

Mio Q10:02:38

these kinds of things

agold13:02:19

You can use reagent/hiccup with a simple css frame work like Bulma to accomplish the same thing.

Mio Q13:02:40

@U2CR1J4UV not exactly the same thing unfortunately

lilactown17:02:28

I haven't seen these before, but ostensibly you could build something yourself on top of theme-ui and a more barebones React wrapper

Mio Q05:02:28

but something react based would be cool

Sam Ritchie20:02:15

Interesting, in Clojure:

[(mod 8.5 1.4) (rem 8.5 1.4)]
;;=> [0.10000000000000142 0.10000000000000142]
But in CLJS:
[(mod 8.5 1.4) (rem 8.5 1.4)]
;;=> [0.10000000000000053 1.5]

Sam Ritchie20:02:05

Ah, because (quot 8.5 1.4) is 6.0 in Clojure, 5 in js

andy.fingerhut01:02:05

That is so weird that they would be off by 1 from each other. That is 0.1 away from being an epsilon type of rounding error.

andy.fingerhut01:02:52

Oh, I see how CLJS quot is implemented now. It is very sensitive to tiny epsilon differences in double arithmetic.

thheller20:02:17

more like JVM and JS 🙂

Sam Ritchie20:02:05

haha, yes, sorry!

Sam Ritchie20:02:43

sicmutils.numbers-test> (/ 8.5 1.4)
6.071428571428572
sicmutils.numbers-test> (quot 8.5 1.4)
5

Sam Ritchie20:02:17

but this is a bug for sure, yeah @thheller? wherever the fix goes

Sam Ritchie20:02:33

sicmutils.numbers-test> (/ (- 8.5 (js-mod 8.5 1.4)) 1.4)
5.999999999999999

Sam Ritchie20:02:52

it doesn’t QUITE make it internally to the 6 it should be at. floating point shenanigans

Sam Ritchie20:02:04

is this sort of thing worth filing, or just JS floating point stuff that we inherit?

Sam Ritchie20:02:50

similar strangeness,

(rem 9037601485536036300227801N 1e4)
1.073741824E9
sicmutils.numbers-test> (rem 9037601485536036300227801N 10000)
7801N
on the JVM side

Sam Ritchie20:02:12

double on the right gets this wrong, and returns a number greater than the modulus