Fork me on GitHub
#clojurescript
<
2016-01-12
>
bostonaholic00:01:34

If I use a BigDecimal literal 3.14M in .cljc, what does that compile to in JS?

bostonaholic00:01:44

awesome, thanks!

macromancer01:01:50

hey everyone... @dnolen any idea if clojurescript might target webassembly?

dnolen01:01:07

@macromancer: please don’t direct questions at me - just ask the channel

dnolen01:01:24

and no plans to target web assembly anytime soon

dnolen01:01:29

currently the value propositions are non-existent

dnolen01:01:29

I honestly don’t ever see them swinging in favor of web assembly

dnolen01:01:39

as JS engines keep getting faster

dnolen01:01:08

and forthcoming JS features like enhanced numerics may address perf and semantic issues

macromancer01:01:21

right, i guess the extra leap in code translation isn't that much of burden anymore.

meow01:01:32

has anyone looked at A-Frame for VR: https://aframe.io/

meow01:01:46

wondering how it might be used with cljs

dnolen01:01:09

@macromancer: the best results for interpreters & JIT in webasm (er asm.js) seem to be like >4X slower or something

dnolen01:01:19

whereas with JSC today we’re like 1.5X of the JVM.

macromancer01:01:47

@dnolen yeah, its quite incredible.

macromancer01:01:46

@meow: nope, but it looks fun

meow01:01:35

I know, right!

donmullen02:01:18

@meow: Hoplon + A-Frame would be pretty cool.

jimmy09:01:21

hi guys, in chrome dev how do we use (clj->js <var>) to convert clojure data structure back to js, it's a bit easier to debug this way.

jimmy09:01:24

ah ok, I find it in cljs.core.clj__GT_js

jaen09:01:36

It helps a lot.

jimmy09:01:13

that thing looks magic 😄 THanks . I will try it out xD

jaen09:01:53

You just have to have recent enough Chrome, but I think 47 is already stable, right?

jimmy09:01:49

I use Canary so I think it would work fine

jaen09:01:23

Yup, you just need to enable them in the settings. In older versions you had to do the magic 5xshift secret dev experiments trick.

jaen09:01:30

But by now it's been mainlined.

jaen09:01:34

He's also working on something even more awesome - https://github.com/binaryage/dirac - but I didn't yet try this since it seems to require lein and figwheel.

meow09:01:31

#C0J01U7MY

jimmy09:01:29

ok it seems perfect, I use lein and figwheel btw

jaen09:01:22

So you should probably be able to use it as is.

jaen09:01:38

I'm a boot person, so I would probably have to port the figwheel-dependent part first, but didn't have time yet.

jaen09:01:44

Because it looks so great ❤️

jaen09:01:20

Also oh, there's a channel for that. Gonna lurk it.

jimmy09:01:41

hmm, I have things format nicely when I log it from nRepl, it's nicely formatted. But in browser it doesn't and the variable in my scope is not nicely format either T_T

mudphone09:01:17

Sablono mentions that I should be able to "Use the React dependencies from one of the ClojureScript wrappers” … is there a way to declare that I want to use the deps from a lib listed in my dependencies (in this case React)?

jaen09:01:56

Not sure what you mean? As long as you have React from cljsjs in your dependencies sablono or reagent or somesuch should just "pick it up" on their own.

mudphone09:01:45

you mean you list React dependencies in you project.clj?

mudphone09:01:00

The Sablono readme seems to imply that you don’t have to if you use a React wrapper.

jaen09:01:03

Yeah, for example:

[reagent "0.5.1" :exclusions [cljsjs/react]]
[cljsjs/react-with-addons "0.13.3-0"]

jimmy09:01:23

@jaen: ha ! put the required command to code then things work as expected 😄 Nicely format stuff for happy debugging time xD

jaen09:01:33

What sablono means is it will just use what you provided for the React wrapper.

jaen09:01:53

And one more thing

jaen09:01:01

If you don't need addons, like I do

jaen09:01:21

then just [reagent "0.5.1"] without the exclusion and additional dependency

jaen09:01:25

Should also just work.

jaen09:01:06

@nxqd: yup. First time I cam across that library I was all like rainbows and unicorns. It really makes debugging Clojurescript in the browser almost painless.

mudphone09:01:09

hmm… okay, so maybe because Sablono requires react.dom and react.dom.server, means that I have to use exclusions?

jaen09:01:24

Uh, maybe I'm explaining it confusingly.

jaen09:01:28

Basically

mudphone09:01:41

I’m assuming Om doesn’t include react.dom and react.dom.server

mudphone09:01:53

but, it does include plain old react

jaen09:01:55

Hmm, I don't use om

jaen09:01:04

But it seems to include what you need as well

jaen09:01:11

It's just docs that are not updated

jaen09:01:17

If you look at project.clj it's there

jaen09:01:39

So the rule of thumb is

jaen09:01:44

If you don't need React with addons

jaen09:01:53

You already get it in dependencies, no need to do anything.

juhoteperi09:01:01

@mudphone: Om includes react.dom but not react.dom.server

jaen09:01:03

Sablono or kioo or what have you will just pick it up.

mudphone09:01:10

but, it does need react.dom.server

jaen09:01:37

Ah, yes.

jaen09:01:47

If sablono needs that, then you need to include it manually it seems.

danbunea10:01:23

@cjmurphy: I did change the order I start them (test dev), then I changed the order in which they are in the project. Nothing works. It seems that the repl will conect to whichever compiles last

danbunea10:01:36

@cjmurphy: Dan-Bunea:vr danbunea$ rlwrap lein figwheel testguidelines devguidelines Figwheel: Starting server at http://localhost:3449 Figwheel: Watching build - devguidelines Compiling "resources/public/js/compiled/vr.guidelines.js" from ["src"]... Successfully compiled "resources/public/js/compiled/vr.guidelines.js" in 3.032 seconds. Figwheel: Watching build - testguidelines Compiling "resources/public/js/test/test.guidelines.js" from ["src" "test"]... Successfully compiled "resources/public/js/test/test.guidelines.js" in 2.829 seconds. Figwheel: Starting CSS Watcher for paths ["resources/public/css"] Launching ClojureScript REPL for build: testguidelines

danbunea10:01:01

sorry, first

danbunea10:01:15

and for some reason, tests get compiled faster

cjmurphy10:01:02

@danbunea Yes sorry I was just quickly guessing at things to try. Any reason you can't just have two lein OS consoles each doing what you want? You can use lein for a particular task either from the command line or from a repl you interact with.

danbunea10:01:27

@cjmurphy: I now start dev only

danbunea10:01:34

and from it I also start test

danbunea10:01:40

which seems to work ok

danbunea10:01:51

just an extra step simple_smile

danbunea10:01:20

(start-autobuild testguidelines)

danbunea10:01:27

after the repl starts

cjmurphy10:01:09

Glad you got something working. You could probably get it working exactly as you want, so with no extra steps. I'm pretty sure you could do the autobuilding from the command line, so permanently happening in a separate console. That is what I do for instance when auto-compiling garden.

cjmurphy10:01:16

Maybe whatever you do there's an 'extra step'.

grav12:01:23

@bensu: thanks for the suggestion re: doo, looks promising

progzilla12:01:24

If you are within the UK, around London i am seeking a tutor who can devote at least twice a week to helping me get through Clojure/ClojureScript. Also I am working on my final year project. I need maybe 2-3hours each day until 1st week of April. Name your rate/hour pls. Thanks.

kiranmysore13:01:20

Anyone please point me to some examples of how to use d3.js with clojurescript.

jcouyang13:01:37

hi @dnolen are you still maintaining mori, seems lot of issues and PRs are no addressed

jcouyang13:01:04

it's a really great lib, i’m really enjoy that i can using clj datastructure in vanilla js

grav13:01:41

What are the rules for using int. characters like æøå in defs etc

grav13:01:34

It seems to be alright when I inject the code using figwheel, but as soon as I reload the page, I get Uncaught SyntaxError: Unexpected token ILLEGAL

rm13:01:43

figwheel doesn't load wrong code. Maybe that's the reason. Also check the differences between main and figwheel reload functions

dnolen13:01:16

@jcouyang: I’m too busy to deal Mori - happy to see someone else take it over.

meow13:01:00

@kiranmysore: also ask on #C0F0V8DT5

meow13:01:59

@grav: someone else was discussing i18 stuff but can't remember where I saw that

meow13:01:05

lots of channels

jcouyang14:01:49

@dnolen: i’m very happy to contribute and maintain it if you like, do you have any plan for the future of mori

dnolen14:01:07

@jcouyang: nope, I haven’t really thought about it at all

dnolen14:01:17

it became lower priority for me after Immutable.js

jcouyang14:01:06

i still like the clj api over immutablejs

jcouyang15:01:16

@dnolen: can you add me to collaborator, or someone interesting in it, i’m really like to keep this cool project alive

dnolen15:01:28

@jcouyang: at this time not looking for collaborators - eventually I’ll figure out what to do with it.

dnolen15:01:33

just not a priority for me

meow15:01:26

@jcouyang: did you only want to collaborate or take it over

meow15:01:44

@dnolen: thought you said happy to see someone else take it over

dnolen15:01:29

@meow: I didn’t say when, and “someone” doesn’t necessarily mean anyone

meow15:01:39

ah, I see

wamaral15:01:00

one can always fork it into moria.js or something

jaen16:01:13

I like the name!

pbaille16:01:42

hello everyone, Any advices on finding a remote job around clojure(script)?

nha16:01:53

@pbaille: maybe see #C05006WDW

pbaille16:01:59

thank you nha

meow17:01:56

also #C06B40HMY

mikethompson19:01:02

@kiranmysore: notes regarding Reagent and stateful js components (D3) can be found here: https://github.com/Day8/re-frame/wiki/Using-Stateful-JS-Components

meow19:01:38

#C0J9ENAMS

meow19:01:22

@jcouyang: let's talk about what to do next

martinklepsch20:01:26

Wow, this looks like the ideal foundation for a cljs based react-alternative https://github.com/google/incremental-dom

dnolen20:01:35

@martinklepsch: it’s interesting but I’m not holding my breath - it’s too DOM-centric

jaredly20:01:46

@martinklepsch: sebastian markbage had some thoughts about it when it came out. something about solving the wrong problem

dnolen20:01:00

also React is supposedly dropping the junk it puts into the DOM which was always kind of busted

dnolen20:01:10

this means you can use whatever you want to generate DOM

dnolen20:01:28

i.e. Aaron Rohner’s talk from Clojure/conj

martinklepsch20:01:46

"ethe junk it puts into the DOM"?

dnolen20:01:20

yes all the generated stuff it uses to handle diffing

dnolen20:01:40

that’s going away

dnolen20:01:30

IMO, what we should be shooting for once that lands is Google Closure Soy template performance server side

martinklepsch20:01:33

Agree that centeredness on DOM might be a bit short-sighted. However given that they're trying to blend the borders between web & native anyways.

martinklepsch20:01:35

and when and where did incremental-dom get announced? Any twitter accounts that should be followed? simple_smile

dnolen21:01:13

Malte Ubl - he used to work on Closure compiler

dnolen21:01:39

he’s the one actually pointed us at the CommonJS & AMD transforms as well before GSoC started

juhoteperi21:01:47

Related to incremental-dom cljsjs package, they seem to be using goog.module definitions instead of goog.provide, and this reportedly doesn't work with ClojureScript.

dnolen21:01:33

right somebody may need submit patches for accepting other kinds of Closure compatible modules

martinklepsch21:01:12

hah, ex-berliner also I think 😛

darwin21:01:11

Just wondering if there is any known issue with goog.net.WebSocket when compiled under :whitespace or :advanced mode...

dnolen21:01:06

@darwin not aware of anything

darwin21:01:27

thanks, will debug it further, I’m using this tiny wrapper, the problem might be there: https://github.com/tomjakubowski/weasel/blob/master/src/cljs/weasel/impls/websocket.cljs

dnolen21:01:03

@darwin those don’t really matter

dnolen21:01:13

(.foo x) (.foo x ()) equivalent

dnolen21:01:29

the problem is lines 43-51 - that’s not going to work

dnolen21:01:53

I mean clearly not going to pass muster with advanced compilation

darwin21:01:57

makes sense, that is why my server receives connection, but my client does not hear back

darwin21:01:00

under advanced

darwin21:01:46

that was it, using the direct goog.net.WebSocket API works

ragge22:01:20

@juhoteperi: FYI a colleague of mine has packaged incremental-dom for cljs, and done some more experiments with it, i think he's planning on making that public