Fork me on GitHub
#clojurescript
<
2015-11-24
>
cjmurphy00:11:01

jaredly - that page gives three options. I've used lein - in which case [quil "2.2.6"] can be put as a dependency.

cjmurphy00:11:39

, the downloading then happens for you, you don't need to worry about it.

jaredly00:11:54

right. the clojurescript quickstart https://github.com/clojure/clojurescript/wiki/Quick-Start#dependencies talks about getting jars directly though 😕 and it's not clear how to do it

cjmurphy00:11:52

If you used lein they would end up in a .m2 directory in your userspace. But that's a rather indirect method of gettings jars from Clojars I guess.

easystreet00:11:59

@jaredly: https://clojars.org/repo/ has directory browsing enabled. so you can navigate pretty easily to find the jar at https://clojars.org/repo/quil/quil/2.2.6/quil-2.2.6.jar

jaen00:11:52

But then it has it's own dependencies, and probably those dependencies have dependencies as well

jaen00:11:19

So if you require a non-trivial library it's probably easier to move over to a build tool like boot (or lein)

jaen00:11:18

Something like reagent is probably still in the trivial category - it only requires React, but looking at the clojars page for quil, I don't think you would want to take care of it's dependencies by hand.

danielcompton02:11:55

Looking at our compilation logs, cljs.pprint.cljs is taking quite a long time to compile. What’s involved in making the compiler create and use an analysis cache for this file?

mfikes04:11:40

@danielcompton: I just tried (require 'cljs.pprint) at the REPL. It is nearly instantaneous for me. And a cljs/pprint.cache.edn file is created in my out dir. Maybe you have the :cache-analysis false compiler option set?

danielcompton04:11:15

nope we don’t have :cache-analysis false set

danielcompton04:11:44

A cache file exists for pprint.cljs

mfikes04:11:06

Is this a :none build?

danielcompton04:11:21

This line Compiling out/cljs/pprint.cljs suggests no analysis cache is used

danielcompton04:11:35

whereas I see other lines like Reading analysis cache for jar:file:/Users/Daniel/.m2/repository/com/andrewmcveigh/cljs-time/0.3.14/cljs-time-0.3.14.jar!/cljs_time/extend.cljs

jaredly04:11:02

has anyone had success getting typed clojure going w/ cljs? I'm just getting weird errors Assert failed: Cannot find namespace: clojure.core.typed.check-ns-cljs

mrg15:11:09

Would anyone know how to inject methods into the evaluation environment?

mrg15:11:13

(defn eval-str [s]
  (eval (empty-state)
        s;(read-string s)
        {:eval       js-eval
         :source-map true
         :context    :expr}
        (fn [result] result)))

mrg15:11:20

I'm assuming I could potentially define them within the result fn, but maybe there's a better way? Perhaps replacing the (empty-state) with something?

dnolen15:11:49

@mrg: not possible. Either they are in the global js environment or you eval'ed them.

mrg15:11:09

Thanks @dnolen. So would i be able to let them within the result fn?

dnolen15:11:07

You cannot inject period

mrg15:11:56

Thanks, then I'll have to find another way

yogthos15:11:02

@dnolen: btw I notice that with advanced compilation the code stops working, is there an extra step for that?

dnolen15:11:22

@yogthos: it’s not supposed to work

yogthos15:11:42

ah ok works as designed then simple_smile

dnolen15:11:31

making bootstrapped work with advanced is impossible without bootstrapping Google Closure into ClojureScript

yogthos15:11:36

yeah that makes sense, although that might be an interesting option in the future 😉

martinklepsch15:11:38

@yogthos: if I understand correctly you’d need to port Google Closure Compiler to Javascript. I doubt someone will take on that work unless Google somehow decides they need it.

dnolen15:11:27

@yogthos: ha, not interested in it myself. But if somebody else ports a 6 year old Java codebase to ClojureScript in their copious amounts of free time, I won’t complain 😄

yogthos15:11:25

I’m not going to hold my breath on that one 😉

yogthos15:11:44

but who knows what might happen in another 5 years 😛

dnolen15:11:14

crazier things have happened … we did finally bootstrap after all

yogthos15:11:25

my thoughts exactly

yogthos15:11:41

maybe we’ll even get a common browser bytecode one day

jaen15:11:57

Aren't there plans for that?

yogthos15:11:06

yeah if that actually gets buy in then things will get really interesting

yogthos15:11:48

although from user perspective it probably won’t change all that much for cljs

yogthos15:11:19

Js is already an implementation detail that you generally don’t have to worry about, and even with a common bytecode you’d still have to do interop

gabe15:11:26

I’m wondering where :*cljs-ns* is defined

gabe15:11:44

it looks like this is what @mrg is looking for

gabe15:11:17

actually, i see where it’s defined

gabe15:11:36

would it not be possible to define a namespace in opts that would be used as the execution context in @yogthos’s example?

joelkuiper15:11:41

any word yet on a Reagent compatible with the new React-dom stuff (keep getting deprecation warnings 😉 )

joelkuiper15:11:36

nice, thanks!

dnolen15:11:16

what I said above holds

dnolen15:11:32

@yogthos: yeah I remain unconvinced that WebAssembly will ever buy us anything of value

dnolen15:11:27

we’re already close to JVM performance with source-to-source strategy

dnolen16:11:21

there’s no such thing as injecting into eval in Clojure at all

dnolen16:11:43

and by association ClojureScript

gabe16:11:35

but if ’cljs.user is used as the execution context and (or (:ns opts) ‘cljs.user)

jaen16:11:38

@dnolen: well, it would buy threading for one.

gabe16:11:03

then it would stand to reason that you could pass a namespace to opts and use that

dnolen16:11:05

@jaen it would not

gabe16:11:18

but if that’s not possible then i’ll accept it

dnolen16:11:36

multithreading comes from the host VM

gabe16:11:01

just trying to understand the why

gabe16:11:41

but i guess i can just RTFS

dnolen16:11:06

setting the *cljs-ns* is not related to “execution contexts"

jaen16:11:13

Any VM supporting WebAssembly specification would have to expose multithreading from what I understand.

gabe16:11:53

@dnolen: maybe i’m conflating namespaces, environments and execution contexts

dnolen16:11:09

@jaen there’s so much handwaving there

dnolen16:11:40

@jaen and anything post MVP … 4-5 years before they actually bring any reality to the hand waving

gabe16:11:58

but like i said, i can just read through the source and figure it out

jaen16:11:07

Not saying it's not, but there are plans for that none the less.

dnolen16:11:29

they also had “plan” for GC story for asm.js, I’m not holding my breath

jaen16:11:05

Well, we'll see then.

dnolen16:11:14

@gabe: yes it seems you are assuming things about Clojure(Script) eval that just aren’t the case

gabe16:11:06

it should make for some fun reading anyway 😄

dnolen16:11:25

once you realize the only real business value for WebAssembly is portable C++ then your idealism for things that benefit alternative languages drops pretty fast

jaen16:11:14

Sure, but threading is actually well within that business value.

dnolen16:11:41

if the boundary between C++ / JS / DOM isn’t correctly designed then these will just be walled execution environments talking over some inexpressive interface

dnolen16:11:48

C++ code bases don’t care about that problem

dnolen16:11:24

since they’re building buildings out of toothpicks already

jstew16:11:17

Am I being obtuse, missing something or is the google closure api documentation really bad when it comes to dates/times?

gabe16:11:00

@dnolen: one last question on this topic. Can you point me to a use of eval passed an opts map that contains :ns?

dnolen16:11:22

@gabe: you’ll have to poke around sorry

dnolen16:11:12

@jstew: might be easier to get a sense of Closure’s date/time stuff with cljs-time

jstew16:11:30

@dnolen: Thanks. Looks like a great library!

darwin17:11:17

I have just open-sourced a sample extension using chromex library (with some docs in the readme): https://github.com/binaryage/chromex-sample suggestions on idiomatic clojurescript API design/usage would be appreciated, thanks

bhauman17:11:08

@dnolen got rid of that darn, pprint bug

bhauman17:11:19

so annoying

bhauman17:11:50

@dnolen: we are getting closer to a consistent good set of recommendations for new developers. Thinking about having the figwheel-template generate scripts soon and sending folks down that route from the get go. Thoughts??

dnolen17:11:36

@bhauman: no thoughts from me on that, I’m a horrible person to ask about templates since I don’t use them

bhauman17:11:31

@dnolen: I hear ya, just wondering if there is a consistent get started story broiling in the back of your mind after the quick start. There is no rush on this. Just letting you know I've been thinking about it a bunch and if you have thoughts percolating don't hesitate to drop me a note.

bhauman17:11:47

I really think that we are getting to a really nice place

dnolen17:11:54

there is not

dnolen17:11:17

“there is not” a “getting started story in the back of my mind” simple_smile

dnolen17:11:35

I’m happy to see more basic setup tutorials on the ClojureScript wiki

dnolen17:11:45

but there’s a limit

dnolen17:11:59

I’m not interested in seeing stuff like Figwheel + Ring or anything remotely like that

dnolen17:11:21

rather just the basic tooling / editor integrations

arohner17:11:48

are there any known issues/gotchas with cljs modules in 1.7.170?

dnolen17:11:21

@arohner: not that I’ve heard since it’s release

dnolen17:11:37

that was 20 days ago

arohner17:11:14

k. I’m seeing something weird. my production build, which worked fine in 1.7.48 doesn’t work yet in 1.7.170

arohner17:11:00

and the problem goes away if I don’t try to build modules

dnolen17:11:25

some important things changed with 1.7.170 wrt. :module support

dnolen17:11:37

deterministic build order + Google Closure Compiler dep bump broke our :modules support (since fixed)

dnolen17:11:34

it’s possible something about these 2 changes are related to your problem but you will need to have a theory about the issue you are seeing

clojuregeek19:11:37

I am wanting to use clojurescript to pull records from dynamodb .. i found hildebrand library ... is it good to use inside of clojurescript?

dnolen19:11:12

@clojuregeek: it seems designed for ClojureScript, haven’t tried it myself though

dnolen19:11:50

the author has been doing some fun stuff with CLJS + AWS Lambda - https://nervous.io/clojure/clojurescript/aws/lambda/node/lein/2015/07/05/lambda/

clojuregeek19:11:43

yeah, i saw that simple_smile I have to build a dashboard that will list records in different dydb databases

clojuregeek19:11:56

it looks like the query functions loads into a channel.. but when i include core async into project.clj and in the cljs file ... I have a message ANALYSIS ERROR: No such namespace: clojure.core.async, in figwheel log.

dnolen20:11:53

@clojuregeek: sounds like you may be trying to load clojure.core.async instead of cljs.core.async

dnolen20:11:18

or perhaps not requiring the right hildebrand cljs namespace for cljs usage?

dnolen20:11:36

(could also be a hildebrand bug of course)

clojuregeek20:11:20

ok yeah I am trying to use the clojure one not cljs, let me see if i can figure it out.. thanks!

clojuregeek20:11:54

thanks.. i was there... dont remember dynadb ... but i'll watch again .. simple_smile

shaun-mahood20:11:27

Pretty sure dynamo db was their back end, and they're definitely using it in some fashion in https://github.com/aerostat/serverless/blob/master/sso/src/sso/core.cljs

clojuregeek20:11:36

yah i guess they did mention dyndb for storing the logins.

shaun-mahood20:11:41

Cool that you're actually using dynamo db from cljs, though.

clojuregeek20:11:55

if i can get it working simple_smile

gabe23:11:52

how do i resolve a symbol created at runtime (i.e. (symbol “foo/“ function-name))?

gabe23:11:07

my guess is that i can't

jaen23:11:34

Yeah, I don't think Clojurescript can resolve symbols.

mfikes23:11:58

@gabe: if you go down the path of using bootstrap / self-host you can do stuff at runtime