0:13 apricity: anyone have advise for cider-jack-in taking like a minute to start up, I don't get errors and it finally brings up a lein repl but takes foreeever and I'm on a fast machine running arch linux. running lein repl only takes like 3 seconds.
0:35 tolstoy: apricity: I don't know, but you can try "lein repl :headless" and then cider-connect.
0:59 dysfun: hrm, there's a repl option i had to use for boot to make it start up faster, maybe there's something similar for lein
1:36 justin_smith: apricity: does your "lein repl" load up your main ns, or start up in the user ns?
2:02 apricity: justin_smith: it starts in the user namespace
2:03 justin_smith: but, when i use cider, it's just a test project created with lein new testing, I haven't edited anything in the project
2:07 should I be using boot instead of lein? I'm just starting to learn clojure
2:08 dysfun: no. boot is the thing you should use when you're being clever and lein no longer solves your problem
2:08 it's a fantastic tool, but it still confuses the hell out of me sometimes
2:10 tolstoy: Do you ever worry that a turing complete build system will lead to spaghetti on non-personal projects?
2:10 dysfun: not really. you're still working with high level primitives and there just isn't that much that you might actually want to do in a build for the jvm
2:11 plus i don't hack proprietary code any more, which helps
2:28 tolstoy: Yeah. I've just seem some interesting projects (10+ years) with Ant extensions designed to introduce scripting, etc, etc, to the point where no one remaining understands the build anymore.
2:29 dysfun: a previous client used ant for deploying their php, and it was a total clusterfuck
2:29 but my answer there is what the hell were you thinking using ant for that?
2:29 tolstoy: I kinda liked Ant + check your jars into CVS, back in the day.
2:30 dysfun: there is nothing about CVS I can say that is nice
2:30 and i'm not terribly fond of ant to start with
2:31 much as i get annoyed with git from time to time, i think back to using svn and cvs and suddenly it doesn't seem so bd
2:33 we're pretty spoiled today. i complain when i have to check out a mercurial or a darcs repo
2:37 tolstoy: At that time, Ant and CVS were all there was, I think, and I don't miss that, but I do like the basic simplicity.
2:37 But that might have just been my mind set.
2:37 Build system for building the app.
2:38 Some other project then knows what to do with the artifact.
2:38 A build system that does everything scares me a little. Too tempting under pressure to just add more "query this thing, get keys, deploy to that server, log a receipt over there," etc, etc. ;)
2:39 I like my complexity distributed around a bunch of simple projects, each one of which is isolated at the source level.
2:44 dysfun: most of my stuff is deployed to clojars
4:31 Rovanion: A function has [{:as ev-msg :keys [event uid ?data]}] as its arguments list. Can someone link a doc which explains what that actually means?
4:32 opqdonut: http://
4:32 or actually, http://
4:35 Rovanion: Thank you opqdonut!
4:48 hellofunk: i'm curious about core.async channels that are accessed from multiple threads. if i think of a channel as a queue, and values can be placed on this queue from any other channel/thread, then are these channels explicitly implemented with locking to avoid race conditions? are they not shared memory?
4:49 dysfun: they're safe. don't worry too much about how they're implemented
4:49 hellofunk: dysfun: i'm not worried, i know they are awesome. but i'm studying multithreading in another language and it made me think of core.async and howt hey might be implemented.
4:50 dysfun: yes, it uses locks under the hood
4:50 i saw a great presentation on youtube about it
4:50 hellofunk: dysfun: do you recall which one?
4:50 dysfun: not in the slightest, sorry
4:50 clojurebot: Titim gan éirí ort.
4:50 hellofunk: clojurebot: perhaps you know which video?
4:50 clojurebot: No entiendo
4:50 hellofunk: clojurebot: only speak spanish?
4:50 clojurebot: Excuse me?
4:51 dysfun: clojurebot picks a random "i don't understand" phrase from a list
4:51 hellofunk: i know, just having fun
4:52 dysfun: hrm, it may have been this one
4:53 https://
4:53 if not, it's a good talk for your interests anyway
4:59 hellofunk: thanks
5:04 dysfun: yw
8:54 shiranaihito: please check this out: https://
10:29 sdegutis: Is it possible for a compile-time parsing of (format) strings using a Clojure macro similar to how Rust does this?
10:29 Thanks, eh.
10:58 djcoin: Hi all, i'm not very good with the JVM ecosystem, excuse me for asking a trivial question! I would like to install apache commons in .m2 so that leiningen can use it straight away, how can I do that?
10:59 amoe: djcoin: leiningen will automatically pull Maven dependencies from the central repository, so if you just specify the commons dependency in project.clj, lein will retrieve it when it builds your project
11:00 djcoin: like [commons-validator/commons-validator "1.5.0"]
11:02 dysfun: lein will automatically put things into ~/.m2/repository when it fetches them
11:03 djcoin: dysfun: amoe ok thanks!
11:11 Rovanion: Can I lein run any argumentless function in my code?
11:13 I'm trying to run a function which can be found in src/clj/proj/file.clj, but lein complains that file.clj is not in the classpath. Meanwhile the same file is found when compiling normally.
11:19 gandhi: If I'm running Datomic with a transactor does that mean my Clojure app will need 2 JVM instances?
11:24 mavbozo_: Rovanion, how do you run with leiningen? like this lein run -m proj.file.your-function ?
11:25 Rovanion, "lein run -m proj.file/your-function" ?
11:25 Rovanion: mavbozo_: No, I was doing lein run -m database/migrate instead of lein run -m proj.database/migrate. Thank you!
11:26 mavbozo_: gandhi, yup! 1 for your clojure app and 1 for your datomic transoctor
11:27 djcoin: dysfun: amoe , if I may bother you some more! from the repl I can do: (import org.apache.commons.compress.compressors.xz.XZCompressorInputStream)
11:28 dysfun: with a quote in front of it, sure you can
11:28 djcoin: but it will fail, when I try to run "lein node-webkit-build" ; clojure.lang.Compiler$CompilerException: java.lang.ClassNotFoundException: org.apache.commons.compress.compressors.xz.XZCompressorInputStream, compiling:(me/raynes/fs/compression.clj:1:1)
11:29 a quote does not seem to be necessary, but from the repl, it just works, I can use reflect on the class etc. seems correctly loaded
11:29 dysfun: okay
11:29 what code is triggering that error? is it yours or in the plugin?
11:31 djcoin: dysfun: i'm just running the lein node-webkit-build with a basic template. It somes to blow up in the mentionned library raynes/fs/compression.clj
11:31 even though I have specified this lib in my dependencies and specified also the commons-compress that it is using (and then did "lein deps")
11:31 dysfun: and you've definitely got commons-compress in your deps?
11:31 djcoin: to be sure to have the correct dependencies
11:32 well, as I said, if i do lein repl I can import it
11:32 not sure where to look
11:32 dysfun: yeah, sorry, i'm still half asleep
11:32 djcoin: no worries, if anyone has a clue... thanks
11:33 dysfun: i can only suggest looking at the node-webkit-build lein plugin github to see if anyone else has encountered it
11:34 but it sounds like one of these tedious build things that should be impossible but happen anyway and take ages to debug
11:36 djcoin: ok thnks dysfun
11:36 thanks
11:36 *
11:41 amoe: djcoin: can you paste the full output?
11:42 djcoin: amoe: THanks! Sure, here you go: http://
11:42 amoe: djcoin: what about if you remove the explicit commons-compress dependency -- same behaviour?
11:43 djcoin: also can you paste project.clj?
11:43 djcoin: amoe: yes :|
11:44 amoe:
11:44 http://
11:47 amoe: I'm using a leiningen from nixos a not so common linux distro, maybe that's why. I would have to tweak some things so that leiningen uses the .m2 at start up. I don't know
11:49 dysfun: you should really install the latest lein
11:49 justin_smith: yeah, it works best if you just put it in ~/bin
11:49 dysfun: distributions have been known to package quite elderly versions
11:51 djcoin: yep... here is the result of lein classpath, commons-compress is not here, would that be the reason? http://
11:51 (i'm using lein 2.6.1)
11:52 dysfun: oh. that's actually reasonably recent
11:52 actually that's what i'm running
11:52 wow. and that's a distribution package?
11:53 djcoin: dysfun: yeah, but Nix (and nixos) seems pretty fast on this
11:53 justin_smith: djcoin: the classpath is not determined by the contents of your .m2, it's determined by your project.clj
11:53 dysfun: yeah, i've noticed that freebsd is very quick with jvm updates
11:54 justin_smith: djcoin: it just caches things in .m2
11:54 dysfun: and they also ship lein 2.6.1 heh
11:54 djcoin: justin_smith: when I use a plugin (here the node-webkit-build - https://
11:55 amoe: djcoin: the problem goes away if I remove the lein-cljsbuild plugin
11:55 dysfun: djcoin: whatever is in your dependencies in the project.clj
11:55 djcoin: Those librairies seems to be in .m2
11:55 justin_smith: djcoin: lein starts two jvms
11:55 djcoin: the jvm that runs plugins does not see your project deps
11:55 and the jvm that runs your project does not see lein/plugin deps
11:56 that's a generalization, there are ways to make things accessible to plugins, but it isn't always intuitive
11:57 djcoin: whether they are in m2 is just a caching question, what matters is what ends up in classpath during the apropriate java task
11:58 djcoin: justin_smith: yes, I suppose, anyway to see this classpath?
11:58 justin_smith: djcoin: it will show up in the command line args via ps x
11:58 djcoin: amoe: when I remove the plugin from project.clj, I can't use the lein task
11:59 justin_smith: if the task lasts long enough to capture that
11:59 amoe: djcoin: really? It seems to work for me, or at least it gets further before breaking
11:59 ridcully: what about `lein deps :plugin-tree` ?
11:59 justin_smith: ridcully: ahh! that's the one -- djcoin ^
12:00 amoe: then I get to see log messages, "Reading node-webkit available versions" and then it chokes because I don't have 'package.json'
12:01 djcoin: http://
12:02 http://
12:02 including some related to fs
12:03 dysfun: hrm, i seem to be perpetrating macro evil
12:03 amoe: I think you want to add commons-compress to the exclusion list for lein-cljsbuild
12:03 djcoin: Thanks ridcully
12:04 dysfun: i have a bunch of functions of the form [state val] -> [newstate converted-val]
12:05 it's getting to be an awfully repetitive pattern in my code and i just know there's some obvious way of factoring it out that hasn't occurred to me
12:05 djcoin: amoe: YES that's it !
12:05 justin_smith: sounds like a job for a monad
12:05 djcoin: Now I only have an error for the missing package.json
12:05 :)
12:05 clojurebot: Pardon?
12:05 dysfun: right, but monads suck in clojure, so how about something more practical?
12:05 TimMc: sounds like a job for Eclipse code templates!
12:05 oh wait this isn't Java
12:06 dysfun: i think plumbing can do it if i turn the vecs into maps
12:06 any other libraries that spring to mind?
12:06 justin_smith: dysfun: I bet there's a trick with fluokitten or cats
12:07 dysfun: when i said 'monads suck in clojure', i was specifically talking about my experience with cats
12:07 justin_smith: :)
12:07 dysfun: (to which i have contributed code, therefore i feel justified in slating it)
12:09 amoe: djcoin: actually probably just exclude fs
12:53 idev: is there any cljs gui library where: (1) all your gui state is in datomic/cljs, (2) view is just datomic->dom via react, and (3) all changes to ui is done via datomic queries
12:55 http://
12:58 dysfun: i think om.next is supposed to cover off a certain amount of that
12:59 idev: https://
13:24 justin_smith: yeah, om.next is that plus "parsers" to handle the datomic results
13:50 beaky: om.next apparently has a query lang on steroids?
14:13 idev: in datomic, aRe the only valid ops (add e a v) and (remove e a v)
14:13 so we can't remove an item unless swe know the e,a,v of the item we want to remove ?
14:20 dysfun: you can't remove it unless you know the e and a of it
14:48 jsselman: Is emacs+cider the most powerful development environment currently for clojure? Anyone know if any of other solutions (vim-fireplace, lighttable, cursive) are approximately as powerful?
14:49 dysfun: i think cider is still the most powerful, but some people prefer an IDE like experience
14:49 jsselman: Setting up emacs+cider from scratch has been pretty painful for me, but I'm willing to endure it if the tooling is worth it
14:49 dysfun: hah, i have one of my friends learning emacs (with evil-mode) because he was unimpressed with vim-fireplace
14:52 jsselman: Hmm, I haven't tried evil-mode
14:52 I feel it would probably be frustrating though; like how vim-mode in IntelliJ mostly works until it doesn't
14:53 dysfun: well the joy of emacs is that you really can just fix it
14:53 but it depends on your tolerance for frustration :)
14:53 mavbozo: jsselman, what editor you use daily?
14:53 jsselman: True but it's overwhelming for someone new to the entire ecosystem
14:53 I used IntelliJ for years, but lately have been using vim daily
14:53 mavbozo: i use emacs regularly, so I use cider
14:54 jsselman: for development that is, basically switched from java -> ruby development
14:54 doing clojure for personal stuff
14:57 amalloy: jsselman: i've heard good things about evil from at least a couple vim->emacs guys
15:03 finishingmove: I am just starting out, but I decided to go with Cursive, because I generally find Jetbrains IDEs to be best in class
15:04 with that said, I am considering NeoVim (have used Vim a bit in the past, but making it do all the things I want from an IDE makes it too slow)
15:07 I know emacs is popular with FP languages, especially lisps, but it's like a world of its own which makes me question is it all worth it really
15:33 dysfun: well it really depends on what you want
15:33 the cider environment is pretty much as powerful as it gets
15:34 but mostly i use it because my hands are hardwired to emacs and i value the productivity
16:56 patham9_: https://
16:56 why would this shuffle-random always return the same shuffle?
16:56 altough its incrementing this value
16:58 justin_smith: patham9_: defn has an implicit do, you don't need to use it explcitly like that
16:58 patham9_: ah I see
16:58 justin_smith: (not your question, but just FYI)
16:58 patham9_: thank you :)
16:59 justin_smith: patham9_: also, you should use commute instead of a deref / ref-set combo
16:59 that removes the need for the extra deref at the end of the block too
17:00 ,(def r (ref 0))
17:00 clojurebot: #'sandbox/r
17:00 justin_smith: ,(dosync (commute r inc))
17:00 clojurebot: 1
17:00 justin_smith: ,(dosync (commute r inc))
17:00 clojurebot: 2
17:01 patham9_: ithe incrementation seems to work yes. interestingly i still get the same shuffles altough its incremented
17:01 justin_smith: right, just saying commute does it more simply
17:01 patham9_: thanks a lot, changed to commute now
17:02 justin_smith: patham9_: I thought I'd be able to help more but I have a meeting, I'll check in later if someone else doesn't sort it out
17:02 patham9_: thanks a lot :)
17:11 amalloy: patham9_: implementation looks fine. can you demonstrate a usage of it that defies your expectations?
17:12 patham9_: (shuffle-random '[1 2] ) => [1 2]
17:12 no matter how often its called
17:12 altough use-counter gets incremented in each usage
17:13 its a bit frustrating to not have seed in Clojures shuffle, making it nearly a no-go for most scenarios where testcases etc. are involved.
17:13 and this java-version for some reason has trouble accepting the seed
17:16 also with manual setting seed it doesnt work so the reference part at least seems not to be the issue
17:16 amalloy: small numbers are just bad seeds for j.u.Random
17:16 you are using very little of the randomness in it, just a single coinflip
17:17 ignore the whole reference part, and try just constructing some Random objects with seeds manually, and shuffling using them
17:17 with a small seed and a two-element collection, you seem to always get no change
17:18 patham9_: ah I see, so collection seems to be too small
17:18 maybe I should use seed*10 mod 1000 or something?
17:18 amalloy: those seeds are all way too small
17:18 the range of an int goes up to 2 billion
17:19 TEttinger: java.util.Random is a... pretty flawed RNG. it's a linear congruential generator, so it is in theory the fastest kind, but only 42 bits of randomness are possible IIRC
17:19 might be 48
17:19 amalloy: 48 apparently
17:19 TEttinger: so nextLong won't produce all longs
17:19 amalloy: the good news is, to shuffle a 2-element array, you don't need a lot of entropy
17:19 TEttinger: true
17:20 patham9_: ah i see :)
17:20 ridcully: ,(frequencies (take 10000 (repeatedly #(shuffle [1 2]))))
17:20 TEttinger: java 8's SplittableRandom class is nice
17:20 clojurebot: {[2 1] 5036, [1 2] 4964}
17:20 patham9_: with (* seed 10000) it seems to work now :)
17:22 TEttinger: might want unchecked-multiply instead of *, since I think * will eventually overflow and throw an exception
17:22 ,(reduce * (range 10 1000))
17:22 clojurebot: #error {\n :cause "integer overflow"\n :via\n [{:type java.lang.ArithmeticException\n :message "integer overflow"\n :at [clojure.lang.Numbers throwIntOverflow "Numbers.java" 1501]}]\n :trace\n [[clojure.lang.Numbers throwIntOverflow "Numbers.java" 1501]\n [clojure.lang.Numbers multiply "Numbers.java" 1867]\n [clojure.lang.Numbers$LongOps multiply "Numbers.java" 467]\n [clojure.lang.Numbers ...
17:23 TEttinger: ,(reduce unchecked-multiply (range 10 1000)) ; might need these to be longs
17:23 clojurebot: #error {\n :cause "integer overflow"\n :via\n [{:type java.lang.ArithmeticException\n :message "integer overflow"\n :at [clojure.lang.Numbers throwIntOverflow "Numbers.java" 1501]}]\n :trace\n [[clojure.lang.Numbers throwIntOverflow "Numbers.java" 1501]\n [clojure.lang.Numbers multiply "Numbers.java" 1867]\n [clojure.lang.Numbers$LongOps multiply "Numbers.java" 467]\n [clojure.lang.Numbers ...
17:23 TEttinger: ,(reduce (comp unchecked-multiply long) (range 10 1000)) ; might need these to be longs
17:23 clojurebot: #error {\n :cause "Wrong number of args (2) passed to: core/long"\n :via\n [{:type clojure.lang.ArityException\n :message "Wrong number of args (2) passed to: core/long"\n :at [clojure.lang.AFn throwArity "AFn.java" 429]}]\n :trace\n [[clojure.lang.AFn throwArity "AFn.java" 429]\n [clojure.lang.AFn invoke "AFn.java" 36]\n [clojure.core$comp$fn__4727 invoke "core.clj" 2461]\n [clojure.lang.L...
17:23 TEttinger: gah
17:27 amoe: what's the most natural representation for byte streams in clojure?
17:51 TimMc: amoe: An InputStream or OutputStream, I suppose, but I've never really worked directly with bytes in Clojure.
17:51 If it doesn't need to be particularly performant, you can pass Bytes around in seqs or queues or whatever.
17:53 Anything better than that is likely implemented as a Java lib, not Clojure-specific.
18:03 patham9_: (set/union (for [x (range 10)] 1)) => (1 1 1 1 1 1 1 1 1 1)
18:03 wat ^^
18:04 ,(set/union (for [x (range 10)] 1))
18:04 clojurebot: #error {\n :cause "No such namespace: set"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: No such namespace: set, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6688]}\n {:type java.lang.RuntimeException\n :message "No such namespace: set"\n :at [clojure.lang.Util runtimeException "Util.java" 221]}]\n ...
18:04 patham9_: ,(require '[clojure.set :as set])
18:04 clojurebot: nil
18:04 patham9_: ,(set/union (for [x (range 10)] 1))
18:04 clojurebot: (1 1 1 1 1 ...)
18:04 amalloy: don't call set functions on things that aren't sets
18:04 also, set/union wants N arguments, not one
18:05 patham9_: how can i unfold these entries as a sort of arguments?
18:05 amalloy: apply
18:05 and then you'll get the quite-reasonable arror that 1 is not a set
18:05 patham9_: makes sense :)
18:05 ,(apply set/union (for [x (range 10)] #{1}))
18:05 clojurebot: #{1}
18:05 patham9_: nice :)
18:06 thanks a lot
19:33 TEttinger: interesting stuff here, not sure how many of y'all web-dev-elopers are going to be scrambling to update: https://
22:25 TimMc: amalloy: Do you have something in useful that does max-n of a sequence?
22:26 amalloy: i don't think so
22:26 it'd be in useful.seq if so
22:26 TimMc: Thanks, I checked that one.
22:27 justin_smith: TimMc: if you google "max n ruby" you get a bunch of reference implementations
22:27 that's not true, you get a bunch of kids videos
22:28 TimMc: haha
22:56 namra: greetings. i'm kinda confused. do i still need ring-core and ring-jetty-adapter as dependency when using the lein-ring plugin?
22:56 or are they pulled through lein-ring?
22:56 justin_smith: namra: you only need ring-jetty-adaptor if you plan on running jetty standalone in production (I'd consider using aleph or deploying to a container isntead)
22:57 lein-ring helps abstract between a dev time embedded server and whatever server you want (embedded or as a host/container) in production
22:58 namra: because lein-ring provides 'lein ring uberjar'
22:58 justin_smith: and lein ring uberwar
22:58 and lein ring server
22:59 namra: yes so what server will it use for uberjar? jetty?
22:59 justin_smith: I usually choose aleph
23:27 TimMc: aleph confuses and terrifies me
23:29 TEttinger: I'm having doubts here... I'm not sure if clojure will be the best choice for this project I'm starting.
23:30 I already know I'll be doing a small amount of inheritance or at least implementation of java interfaces, that shouldn't be a huge problem. I'm concerned about code verbosity on array-based things possibly being worse than with Java once type hints are factored in
23:31 lots of 2d and some 3d arrays
23:32 I looked at Kotlin for a middle ground but it currently doesn't handle non-1d arrays super well
23:33 would it be possible to get macros in place that would simplify array handling code and if possible insert type hints?
23:34 namra: TEttinger: aren't macros for such purposes? to build the language you need?
23:35 TEttinger: yeah, I'm just not sure what the technical limitations are here. I know I can't use macros like fns as arguments
23:36 also type hints are metadata, or are like it, so I don't know if that gets preserved with macros
23:37 I know array code performance drops like a rock without it
23:38 justin_smith: TEttinger: there's options like hiphip and core.matrix if you haven't checked them out
23:38 TEttinger: I've used hiphip
23:38 long time ago
23:38 justin_smith: TEttinger: there's also the possibility of doing the shit that needs array performance in java, and the glue in clojure - best of both worlds
23:38 TEttinger: my stuff is an odd case and is unlikely to fit core.matrix
23:38 yeah, I am planning on as much of that as possible
23:41 I have about... 25-30K? lines of Java I've written in a lib that handles lots of game-related stuff that would be slow in clojure, I'm starting to have concerns about code using that lib that needs to do array handling. it won't be critical I hope in this section
23:41 other people have written more, total is about 41K Java SLoC but I won't use all of it
23:42 it might make sense to just make a small glue lib?
23:43 I wonder how hard it is to have java code take Clojure IFn values