#clojure log - Aug 18 2014

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

2:01 shafire: hi, does someone has clojure performance benchmarks of openjdk/oracle jvm?

2:05 TEttinger: shafire, what benchmarks do you have in mind?

2:06 shafire: just the same code runned on the openjdk/oracle jvm (same version)

2:17 TEttinger: shafire, I think with JDK 7 onward they basically use the same code

2:18 there's some options for opts with custom OpenJDK builds that aren't possible for legal reasons with the closed oracle JDK

2:18 shafire: TEttinger: that's what I read too, over 96 % the same code.

2:21 TEttinger: shafire, in my experience with Packr (useful for bundling JREs with applications to distribute to users who might not have recent java), there's a lot of the JRE that is completely unneeded for most apps

2:21 but you can't legally modify JDK 7 if you got it from oracle

2:22 an interesting thing is that on 32-bit windows, openjdk will smoke oracle

2:22 because 32-bit windows doesn't have a --server flag implemented on oracle and does on openjdk

2:23 (although it may use a ton of RAM)

2:24 Jaood: I hear that with java 8 you can streamline the jre

2:24 TEttinger: Jaood, I heard that too, though I don't know if you can redistribute it?

2:25 Jaood: no idea

2:37 andyf: shafire: There are some micro-benchmarks, i.e. of small Clojure expressions executed many times, on many different versions of Clojure and several different JDKs, here: http://jafingerhut.github.io/clojure-benchmarks-results/Clojure-expression-benchmarks.html

2:39 TEttinger: Jaood, just found it, it's a total joke http://www.oracle.com/technetwork/java/embedded/resources/tech/compact-profiles-overview-2157132.html

2:39 only in the embedded jre, and you have better control under OpenJDK

2:51 sm0ke: if i am trying to do lein repl and i get https://www.refheap.com/89241, how do i go about debugging this

2:52 lein install works otoh

2:52 oooooio: hey stop spamming

2:53 TEttinger: pretty sure that's a bot

2:53 sm0ke: yep

2:54 TEttinger: sm0ke, you probably have a toplevel form being run when it loads a namespace

2:58 sm0ke: hurm how do i find that rat

3:00 i just upgraded lein today

3:00 let me switch back to 2.4.2

3:02 wow! seems to work find with a lein from a repo once if forked from git

3:02 fine

3:03 TEttinger: sm0ke: /me head explode

3:04 sm0ke: you not taking it seriously, but on the old version I could not get deps :tree working

3:05 so i clone lein at some point of time, I gave up when the calls for :tree went into aether

3:06 i think there is some circular dep bug in way aether resolves dep

3:06 let me see if i can reproduce this in a small project

3:07 Can i get back 2.4.2 for time being

3:07 there should be a lein degrade too

3:10 TEttinger: sm0ke, yeah, uh delete the jars in the lein folder, I think ~/.lein

3:10 I could be wrong here easily

3:10 sm0ke: TEttinger: Ok i am able to reproduce it

3:10 TEttinger: filing an issue on git

3:11 TEttinger: ~/.lein/self-installs

3:11 clojurebot: Titim gan éirí ort.

3:11 TEttinger: good good, technomancy I hope can fix it like lightning

3:12 sm0ke: :P not so easily..let me first check it on some other machine to make sure i am not fooling around

3:15 TEttinger: DID YOU KNOW THAT Phil Hagelberg is an anagram of Bagel Pile Grhh?

3:19 phillord: No, but now I do, I feel that my life has been changed for ever

3:27 amalloy: i imagine "Hrgh, bagel pile" could be something he says when he wants breakfast

3:29 lvh: TEttinger: my passport name is an anagram of "Unshaven Aunt Lover"

3:29 TEttinger: You understand why I don't use it often.

3:29 TEttinger: that's uh, a lot of vowels

3:29 and v's

3:33 mskoud: How can we handle sessions in webapps in a clean functional manner? Using noir's session/put! will add side-effects to an othervice nice function. Is there a good solution?

3:39 sm0ke: Who do you find that anagram?

3:39 amalloy: sm0ke: there are anagram generators online

3:39 sm0ke: which is the funny one?

3:47 TEttinger: http://wordsmith.org/anagram/ sm0ke

3:47 sm0ke: TEttinger: #1647

3:47 TEttinger: in lein?

3:48 sm0ke: yes

3:54 hyPiRion: sm0ke: Is the hbase sources proprietary? because I get a "Could not find artifact org.apache.hbase:hbase-common:jar:0.98.4" error for them

3:55 sm0ke: oh crap! could you please suffix hbase sources with "-hadoop2"

3:55 i will update the isssue description

3:55 i mean versions

3:55 "0.98.4-hadoop2"

3:56 hyPiRion: oh, alright

3:56 sm0ke: my names anagram is "Labored Puke"

3:56 haha "Bad Leek Pour"

3:58 Hey! is TEttinger and hyPiRion the same person?

3:59 hyPiRion: sm0ke: yeah, I can reproduce that. Dang, thought we solved that issue :/

3:59 sm0ke: hyPiRion: what is it?

3:59 hyPiRion: sm0ke: no, I am not TEttinger

3:59 sm0ke: Oh, there was a stackoverflow issue we just fixed on master, I was hoping this was the same.

4:00 sm0ke: i actually tried to figure this but gave up, actually the call to pomergenade library is rouge

4:00 hyPiRion: technomancy/leiningen#1491 <-

4:00 lazybot: Running `lein deps :tree` may overflow the stack -- https://github.com/technomancy/leiningen/issues/1491 is closed

4:00 sm0ke: yes yes, i mentioned this in the issue too

4:01 hyPiRion: hrm

4:03 TEttinger: the hyPiRion can be distinguished from the TEttinger in the wild by its extensive use of non-alphanumeric calls and stable, largely diurnal sleep cycle

4:05 I've been watching a lot of nature documentaries lately

4:05 nature is a fantastic thing

4:07 sm0ke: nature is not a thing!

4:07 hyPiRion: sm0ke: the hyPiRion can be distinguished from the TEttinger through /whois calls as well

4:09 sm0ke: the confusion was caused, because i was talking to TEttinger but suddenly hyPiRion started asking questions as if he was aware of the context

4:09 may be he was eaves droping earlier

4:10 hyPiRion: sm0ke: oh, sorry. :p I looked through the logs, and saw something about lein, stackoverflows and dependencies. Since we just fixed something similar, I was wondering if this was the same issue

4:10 unfortunately it wasn't =/

4:12 sm0ke: hyPiRion: could you please add "P1" label too

4:14 if you agree that is

4:14 hyPiRion: Well, I don't think we have a P1 label, but I'll forward it to the rest

4:15 sm0ke: but i get a feeling this is going to be pushed to to pomegranate

4:15 hyPiRion: right, I am not sure where the problem resides yet

4:15 seems pretty critical to not be able to use dependencies due to stack overflows

4:15 sm0ke: yep its a dealbreaker

4:16 and pomegrante for sure will push this to aether

4:16 hyPiRion: If it's an aether issue then we have a serious issue

4:17 would be strange if it was though, as Aether is quite heavily used.

4:18 sm0ke: leiningen/core/classpath.clj dependency-hierarchy

4:18 that is the culprit

4:18 it never returns

4:18 aether/dependency-hierarchy to be precise

4:20 this was when i was checking it for deps :tree, not sure if repl command also has same code path

4:21 hyPiRion: lein runs deps beforehand, which uses dependency-hierarchy

4:26 TEttinger: http://www.infoworld.com/print/247823 heehee clojure can work away from the JVM, but Java not so much...

4:36 sm0ke: is anyone running openjdk on production machines

4:37 people still seem to stick to oracle's jdk

4:40 TEttinger: sm0ke, I don't think Oracle JDK 8 was immediately available for linux

4:40 at least OpenJDK wasn't

4:40 sm0ke: jdk8 is brand new who cares

4:41 TEttinger: (I still haven't seen a jdk 8 build for 32-bit windows)

4:41 but yeah there's a definite gap in when these things are available

4:42 I don't think openjdk has any of the old problems with stability it used to

4:43 schmir: Can anyone explain to me why openjdk exists and what's the relation to oracle's jdk?

4:44 vijaykiran: schmir: http://stackoverflow.com/questions/11547458/what-is-the-difference-between-jvm-jdk-jre-openjdk

4:44 sm0ke: some part of sun jdk was closed source and remaining was donated as open jdk i guess

4:44 wink: the best reason why it exists: because there's no harm in having alternatives

4:45 TEttinger: they're mostly the same code, JDK 7 was largely imported from OpenJDK work

4:45 people can contribute to OpenJDK without being Sun/Oracle employees

4:45 hyPiRion: also http://www.oracle.com/us/products/export/export-regulations-345813.html – which OpenJDK isn't affected by.

4:58 lintomaas:

4:58 TEttinger: hyPiRion, woah

4:58 I guess siemens isn't using java

5:00 https://en.wikipedia.org/wiki/Stuxnet the nuclear centrifuges that iran used (and got wrecked by stuxnet) were made by siemens

5:05 sm0ke: no way

5:05 made for rather

5:08 hyPiRion: TEttinger: they can use OpenJDK without any issues

5:09 TEttinger: hyPiRion, true!

5:10 seems odd though, hyPiRion

5:11 why would there be any real danger from allowing a java implementation to be used in, say, Cuba?

5:11 wink: webscale is not for commies!

5:12 TEttinger: wouldn't having large homogeneous installations be beneficial for cyberwarfare against those countries?

5:13 wink: there used to be a huge difference in quality though

5:13 hyPiRion: It's a strange thing. I guess it is an overly broad export regulation rule

5:13 wink: back at java 5 or maybe even 6

5:14 some pieces ran flawlessly only on sun/oracle jdk and some on openjdk

5:14 TEttinger: wink, yeah i remember

5:14 wink: or if they ran correct, the speed diff was many 100 %

5:15 TEttinger: I've run all my latest clojure stuff on openjdk without issue though

5:15 I think I had one issue related to memory usage maybe, it didn't read the correct total RAM on this computer

6:02 sm0ke: is there any plans for https on conjars?

6:12 TEttinger: conjars?

6:13 lvh: clojars probably :)

6:15 sm0ke: ugh..there is a conjar too!

6:15 http://conjars.org/

6:16 hurm why would they pick such name

6:16 con jars ?

6:16 its so obviously farud

6:16 stain: don't download that conjar!

6:16 karls: sm0ke: the company behind it is concurrent inc. probably a play on words con-current, con-jars.

7:04 sveri: Hi, I have a somewhat architectural question. Let's say I have a web application, receive a request and then that request should do two things, start a job of some kind and persist data in the database. Would it be ok to call the database function and let this one add the job (request -> database -> job)? Or should the request handler kick off both, the job and the database function (request -> database & job)? This is some kind of a

7:05 ucb: sveri: your question got truncated, however, have you considered (in the latter) option, what happens if either the database or the job runner can't perform the update?

7:06 skratl0x1C: how would I merge maps so that I end up with a map where each value endsup in a list, and when two input maps share a key, the value would be list of these two values?

7:06 ucb: skratl0x1C: look for merge-with

7:07 e.g. (merge-with conj map1 map2 map3 ... mapn)

7:07 sveri: This is the second part of my question: This is some kind of a common problem I guess where one could ask, when is the right time / place to trigger a question. I am open for any input / thoughts on this (as well as recommended links / books of course).

7:07 ucb: Good point, but I guess this can be solved independet of the place where things get started

7:08 shafire: sveri: first question: do the processes depend on each other?

7:09 ucb: sveri: absolutely. But with your latter approach, you need to keep both the job runner and the db in sync. By having the request just update the DB, and then having a daemon monitor this, you're effectively using it as a queue which is how I've seen this things done in general.

7:09 sveri: shafire: no, however, both should complete successfully

7:09 shafire: sveri: should complete successfully, so when one fails, the other should be reversed?

7:09 sveri: shafire: yea

7:10 ucb: That sounds nice too, so you have a single source of truth (database) and some listeners that act whenever that source changes

7:10 shafire: can you rollback the job, sveri?

7:10 ucb: sveri: right. And the request handler only cares about updating the db.

7:11 shafire: do you have rollback support in the db/for the job?

7:11 sveri: shafire: yea, I could do that, I can roll back both

7:11 shafire: then start both at the same time

7:13 sveri: shafire: ucb Thank you both for your time, I will look into the listener approach first :-)

7:14 ucb: nw

7:25 skratl0x1C: ucb: thanks, I ended up with these http://bit.ly/1n13Dif , further simplification welcome

7:27 ucb: look good

7:27 looks*

7:29 martinklepsch: I'm running into an error with cider-nrepl that I can't figure out on my own: https://github.com/clojure-emacs/cider-nrepl/issues/110 — if anyone has some ideas, they'd be welcome! :)

7:36 karls: martinklepsch: have you tried upgrading cider-nrepl to 0.8.0-SNAPSHOT? i had a similar problem yesterday and upgrading worked for me.

7:37 martinklepsch: also, i've not specified any repl-options in ~/.lein/profiles.clj

7:39 martinklepsch: karls: seems to stay the same

7:39 karls: but thanks :)

7:41 karls: martinklepsch: wait, does this happen when you do `lein repl`, or in emacs?

7:41 martinklepsch: karls: lein repl

7:41 karls: :-/

7:42 martinklepsch: starting from emacs with cider-jack-in shouldn't really make a difference, should it?

7:44 karls: not sure, the problem i had was with cider in emacs. the cider and cider-nrepl versions were not the same. after updating both to 0.8.0-SNAPSHOT everything worked.

7:44 there's also a problem with running lein repl in a directory without project.clj, in leiningen 2.4.3, but i think it's a different issue.

7:46 martinklepsch: karls: but at that point in time emacs isn't even interacting with that repl session at all so I don't see how cider itself could interfere here

7:48 karls: martinklepsch: i think it was a case of upgrading cider from quite an old version to latest, then discovering it's not working, then installing cider-nrepl 0.7.0 and then 0.8.0.

7:49 anyway, it was a similar issue. i thought it might help you get towards a solution :)

7:52 martinklepsch: karls: It's appreciated :)

8:39 sveri: ucb: I was thinking about that notifier concept instead of direct function calls (see my question two hours ago). Would it make sense to use core.async here and publish that change through a channel

8:39 ucb: sveri: it really depends on the semantics for your jobs and db updates

8:40 sveri: if you can fire-and-forget, then it doesn't really matter

8:40 carrumba: yella: how does it feel in freedom?

8:40 birdspider: hello, what is the corresponding char name for "empty" (like \newline \b \_ )

8:41 sveri: ucb: ok, I guess that's the case here, thank you again

8:42 ucb: nw

8:43 carrumba: woops! wrong window!

10:06 TimMc: I'm having trouble imagining what birdspider was asking about. NUL?

10:07 clgv: TimMc: probably space?

10:07 TimMc: ah

10:12 clgv: TimMc: though nil is the next best guess ;)

11:06 martinklepsch: is amazonica the go-to option for S3 stuff? https://github.com/mcohen01/amazonica

11:10 TimMc: I've used clj-aws-s3.

11:14 justin_smith: I also use clj-aws-s3

11:14 will someone please kickban oooooio already? technomancy ???

11:14 lazybot: justin_smith: How could that be wrong?

11:15 Bronsa: justin_smith: what is he doing?

11:15 justin_smith: spam links in private messages, repleatedly

11:15 it's a bot I am sure

11:16 if you go up the logs you will see other complaints from last night

11:16 Bronsa: justin_smith: ask a freenode staff member to kline it

11:16 justin_smith: ok

11:19 agocs: I have a question about this gist: https://gist.github.com/agocs/8916127a42312a65a990 What are the '#' characters decorating f, x, and e called, and what are they doing?

11:20 clgv: agocs: gensyms

11:20 TimMc: gensyms

11:20 agocs: Thanks

11:20 I'll look that up

11:20 TimMc: ,`[foo# foo# bar#]

11:20 gtrak: ,`#f

11:20 clojurebot: [foo__25__auto__ foo__25__auto__ bar__26__auto__]

11:20 #<RuntimeException java.lang.RuntimeException: EOF while reading>

11:20 TimMc: gtrak: Wrong side. :-P

11:20 gtrak: ,`f# ;-)

11:20 clojurebot: f__73__auto__

11:23 agocs: Interesting. So, f# ensures that f will have a unique name to avoid conflicts with the function I'm passing to the macro, correct?

11:23 ToxicFrog: Yes.

11:23 tanzoniteblack: agocs: correct

11:24 agocs: Nice. Thanks, all!

11:25 TimMc: agocs: All f# in the same syntax-quote will get the same name. Note that nested syntax-quotes do not provide this.

11:26 ,`[f# ~`f#]

11:26 clojurebot: [f__99__auto__ f__98__auto__]

11:26 agocs: That makes sense

11:27 I got got by oooooio too

11:28 gtrak: me too

11:29 acagle1: ooooooio

11:35 TimMc: Folks in #freenode say we need to ban the spammer ourselves.

11:35 I don't quite understand this -- they already have the list of nicks, and they don't need to be in the channel in order to privmsg...

11:50 CookedGryphon: is there a nice way to do a structural-sharing-aware diff of two vectors?

11:51 aaelony: CookedGryphon: can you use clojure.set/difference?

11:53 justin_smith: aaelony: that would be value based, so it would ignore sharing entirely

11:53 also it would ignore ordering

11:53 CookedGryphon: this is potentially simplified by the fact that I'm only really interested in appends to the list

11:53 aaelony: yes, depends what is required

11:54 justin_smith: aaelony: given that he specifically is interested in something that is aware of structural sharing, using set/diff, which would require using not the original structure, but a set initialized with its contents, would defeat the point

11:55 aaelony: justin_smith: i see your point

11:56 TimMc: CookedGryphon: I'd probably annotate the two vectors with the memory locations of their content values (hashCode from Object) and their position in the vector (map-indexed) and remove all that were shared.

11:56 I don't know if that qualifies as nice. :-P

11:57 justin_smith: TimMc: so would that involve casting to Object and calling .hashCode?

11:57 TimMc: Nah, can't do that.

11:57 justin_smith: so what *can* you do?

11:59 TimMc: &(let [v1 [0 1] v2 (conj v1 2) hashes (partial map #(if (nil? %) % (System/identityHashCode %)))] [(hashes v1) (hashes v2)])

11:59 lazybot: ⇒ [(709070580 1781789391) (709070580 1781789391 1477515494)]

11:59 TimMc: &(System/identityHashCode nil)

11:59 lazybot: ⇒ 0

11:59 TimMc: OK, that makes it even easier. :-)

11:59 hyPiRion: is that structural-sharing-aware though?

12:00 I can't see a way to do that without inspecting the nodes themselves.

12:00 TimMc: Maybe I don't understand the question...

12:01 hyPiRion: TimMc: Maybe I don't

12:01 justin_smith: hyPiRion: if the structures are shared, the object identity of the values always will be

12:01 TimMc: Eh, and I'm wrong anyway -- Object.hashCode isn't guaranteed unique. Obviously.

12:01 justin_smith: hyPiRion: problem being, the values could be shared but not the structure

12:01 hyPiRion: justin_smith: but not necessarily the inverse

12:01 yeah

12:01 justin_smith: exactly

12:01 TimMc: CookedGryphon: Give an example.

12:02 justin_smith: so maybe you want the object identity of the underlying datastructures of the vector

12:02 CookedGryphon: so my example is:

12:02 I'm collecting touches [x,y] in a persistent vector [[x,y],[x1,y1].....]

12:03 and because it's persistent I can neatly send touchDown, touchMove and touchUp events all with the entire persistent history for that touch

12:03 and I want to be able to drop touchMove events if i can't process them quickly enough

12:03 so I need to be able to efficiently work out what subvector I have yet to process since last I saw it

12:03 (it being this persistent vector)

12:04 justin_smith: CookedGryphon: what about [x, y, synthetic-id] where that synthetic ID is guaranteed unique, and added to a vector of "gesture sequence"

12:05 hyPiRion: CookedGryphon: well, you would only need the index of the last processed gesture, wouldn't you?

12:05 CookedGryphon: fair point

12:06 if I include a synthetic id with each vector that is

12:06 it should work fine, as I can guarantee it's only been added to

12:07 hyPiRion: Regardless, I don't think there are functions for vector diffs based upon structural sharing

12:11 sm0ke: umm what exactly is :native-path in lein for?

12:12 justin_smith: sm0ke: https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L287

12:12 that document reveals (almost) all

12:15 sm0ke: does it?

12:15 justin_smith: about lein project.clj options, yeah

12:16 if I want to know what some key in project.clj does, I just go to that page and search for the key

12:17 sm0ke: so i would like to pack some native deps into my final uberjar, how do i pack it such that those are available at runtime

12:17 technomancy: sm0ke: lein doesn't work with native-deps in uberjars

12:19 I mean, you can do it, but you're on your own

12:20 sm0ke: :p i dont like to be on my own

12:20 TimMc: technomancy: Because they're not portable?

12:20 sm0ke: nah i think it would need some custom code at least

12:21 technomancy: TimMc: because lein doesn't want to be invasive in your uberjars

12:21 justin_smith: sm0ke: put it in your resources, then extract it to disk at runtime?

12:22 sm0ke: justin_smith: sounds hip

12:22 is that the only way?

12:22 technomancy: I think so

12:22 you should see what overtone does

12:22 justin_smith: this is clojure, there are infinite ways! (and most all will consist of getting the file out of the jar and onto disk)

12:23 (or at least something the OS knows how to use as if it were a filesystem)

12:24 technomancy: sm0ke: basically none of the regular lein devs use native deps, so the docs are pretty bad

12:24 TimMc: sm0ke: At work we generally deploy a tarball containing the uberjar and some startup scripts; it's not too much effort to also include random other jars to add to the classpath.

12:25 Jaood: TimMc: are the scripts for jre args?

12:38 justin_smith: Jaood: not sure of his case, but I have used a script to store the process ID of the running server, and do clean shutdowns / restarts etc. based on that info, and to create log files from stdout

12:39 and specifying jvm args was part of that too, yeah

12:42 rkneufeld: Anyone else ever had trouble with clojure.java.jdbc setting UUID parameters correctly? I'm getting 'operator does not exist: uuid = character varying' on insert! even though it seems like ISQLParameter should be calling .setObject correctly.

12:53 Jaood: justin_smith: I see, you know if the jvm args can be included in the jar?

12:53 TimMc: justin_smith: That's about the extent of it, yeah.

12:54 justin_smith: Jaood: some Os's allow shebang inside a jar to make it executable, dunno all the details though

12:54 TimMc: Sometimes we also specify the environment the service is running in.

12:54 TEttinger: Jaood, if you bundle a JRE or use webstart you can specify jvm args

12:58 Jaood: TEttinger: yeah, its for server side, was hoping to just do java -jar my.jar

12:59 greghendershott: Checking if I understand correctly: Is the `for` comprehension seq -> list? i.e. It can consume any seq, but always produces a list?

12:59 hiredman: no

13:00 greghendershott: hiredman: OK, thanks. Back to studying it, then.

13:00 hiredman: ,(type (for [a (range 10)] a))

13:00 Jaood: greghendershott: it produces a lazyseq

13:00 clojurebot: clojure.lang.LazySeq

13:00 greghendershott: Jaood: Thanks.

13:02 technomancy: greghendershott: any coll function that is lazy must return a seq

13:34 martinklepsch: Should I use multipart upload when uploading a large chunk of text to S3 using clj-aws-s3 or is that explicitly meant for files?

13:35 justin_smith: martinklepsch: how can anything on s3 not be a file?

13:35 martinklepsch: justin_smith: files on my local disk I meant

13:35 http://weavejester.github.io/clj-aws-s3/aws.sdk.s3.html#var-put-multipart-object

13:36 "Do a multipart upload of a file into a S3 bucket at the specified key. The value must be a java.io.File object."

13:36 justin_smith: martinklepsch: I have used s3 to upload resized images from a buffer, without persisting to disk. I needed to fork clj-aws-s3 to make it work though

13:36 (the upload was multi-part because I did not know the actual size until done)

13:39 https://github.com/caribou/clj-aws-s3 this version has a stream upload option (I occasionally merge in upstream changes)

13:39 martinklepsch: I have a huge string, lets say 10mb but could be more, and I'm not sure if I should use multipart uploading or regular pu

13:39 justin_smith: I guess they don't like how I implemented the multi-part non-file-based uploads, because they haven't merged

13:39 martinklepsch: put

13:40 justin_smith: if you know the size, why not a regular put?

13:40 for reliability reasons maybe/

13:41 my fork has put-multipart-stream https://github.com/caribou/clj-aws-s3/blob/master/src/aws/sdk/s3.clj#L280

13:41 if you decide multipart is really the right option (it is on clojars as caribou/clj-aws-s3)

13:41 puttin 10 megs on disk just so you can upload it is silly, of course

13:42 *putting

13:43 martinklepsch: I looked at amazonica earlier which seems to do stream stuff btw.

13:43 justin_smith: oh, interesting

13:43 they have a really weird codebase iirc

13:44 martinklepsch: I thought I might be able to "fake" the File part about it so I can upload multipart without putting it on disk

13:44 justin_smith: they use macros to populate namespaces https://github.com/mcohen01/amazonica/tree/master/src/amazonica/aws

13:45 it's really weird

13:45 martinklepsch: yeah, tried reading the code but didn't get it so I went for the seemingly simpler clj-aws-s3

13:46 justin_smith: like I said, my fork is up to date, and can do multi-part upload from a stream

13:49 hiredman: https://github.com/hiredman/propS3t

13:49 justin_smith: hiredman: wow, looks very nice

13:49 I may just switch to that

13:50 hiredman: it is not very full featured

13:50 justin_smith: sure, but it has the features I actually use

13:51 except maybe the access permissions, hmm, not seeing that

13:51 hiredman: yeah, I don't think that is there

13:51 prs welcome :)

13:58 starlord: ,(System/setProperty "datomic.txTimeoutMsec" "60000")

13:58 clojurebot: #<AccessControlException java.security.AccessControlException: access denied (java.util.PropertyPermission datomic.txTimeoutMsec write)>

13:58 starlord: :/

13:58 Raynes: lol

14:00 TEttinger: well I think he's still messaging clojurebot, he only left not quit

14:57 justin_smith: weird software design question: I need to share some sensitive information with family. The family is technophobic (I can't make them use gpg). Feasability of making a server with an encrypted document, and serving the decrypted message if the right decryption key is present in an ssl protected post request - is this a dumbass scheme, or is it feasible? am I overlooking something here?

14:57 johnwalker: hi, i've run into a weird issue

14:57 https://github.com/xsc/lein-ancient/issues/37

14:57 is there some way to...not have the dependencies of lein tasks interfere with one another ?

14:58 TEttinger: justin_smith, how sensitive, like nuclear launch codes?

14:58 does it need to be long-term persistent?

14:59 or like a one-time thing?

14:59 justin_smith: TEttinger: more like "data that could be used to confiscate my entire savings and steal my identity and ruin my credit rating"

14:59 it can be one time

14:59 TEttinger: heh

14:59 piece of paper

14:59 justin_smith: yeah, that is probably best

14:59 probably better not to be 'clever' about it

15:00 TEttinger: don't let it get on a computer if you don't trust computers, maybe is best

15:00 justin_smith: heh, right

15:00 more I don't trust what they do with something once they have it on their computer, but yeah, definitely

15:00 teslanick: To go a step further, I recommend a blind drop in a public place with emplaced spotters to ensure safe delivery.

15:00 justin_smith: haha

15:00 teslanick: Get all cold war on it.

15:00 justin_smith: one time pad?

15:01 anyway, thanks for that bit of sanity, TEttinger

15:01 (inc TEttinger)

15:01 lazybot: ⇒ 21

15:01 TEttinger: heehee

15:02 justin_smith: now you have enough karma to legally drink on this channel

15:02 TEttinger: $karma justin_smith

15:02 lazybot: justin_smith has karma 59.

15:02 TEttinger: you can enter karma aarp

15:02 justin_smith: heh

15:02 TEttinger: $karma technomancy

15:02 lazybot: technomancy has karma 131.

15:03 justin_smith: me retire from this channel? you wish

15:03 $karma amalloy

15:03 lazybot: amalloy has karma 158.

15:03 clojurebot: Gabh mo leithscéal?

15:03 TEttinger: $karma clojure

15:03 lazybot: clojure has karma 17.

15:03 justin_smith: $karma so

15:03 lazybot: so has karma -32.

15:03 TEttinger: why is so so low?

15:03 stack overflow?

15:03 johnwalker: LOL

15:03 schmee: can someone help me figure out how to use the `alt!` macro in core.async correctly? https://gist.github.com/schmee/3f438ebf69998545e2ec

15:04 I can't figure out the syntax

15:04 justin_smith: TEttinger: because it's a commonly used word, and got highlighted as a nick in our clients, which many of us found annoying

15:04 johnwalker: thats hilarious

15:05 justin_smith: that's internet mob justice for you

15:07 johnwalker: ping hyPiRion

15:07 hyPiRion: johnwalker: pong

15:07 johnwalker: do you have a recommendation for resolving this issue?

15:07 https://github.com/xsc/lein-ancient/issues/37

15:08 it's near the bottom

15:08 we both have plugins that share dependencies, but are on different versions

15:08 and it appears that the plugin that appears earlier in the profiles.clj picks the version

15:11 hyPiRion: oh crap, that issue. Well, the only thing for now is `lein deps :plugin-tree` which emits warnings, or [lein-plugin :exclusions [[shared/dependency]]]

15:12 johnwalker: ahh, i see

15:13 ok, i'll add a note to my readme

15:13 thanks

15:13 (inc hyPiRion)

15:13 lazybot: ⇒ 43

15:13 hyPiRion: np

15:28 gmac_: Anyone found it difficult to work with OOP after discovering Clojure, FP and immutable data?

15:28 mdeboard: gmac_: it takes awhile to context switch back

15:28 justin_smith: I find it sort of distasteful to be sure - it often leaves me feeling a bit dirty

15:28 gmac_: When I see things like class << self in Ruby I just want to wretch :)

15:28 milos_cohagen: schmee: wrap the println .. in parens

15:29 TEttinger: gmac_, I haven't had any issue switching back and forth

15:29 justin_smith: (inc milos_cohagen)

15:29 lazybot: ⇒ 1

15:29 justin_smith: (facepalm, I should have seen that)

15:29 TEttinger: my clojure was fairly imperative though

15:30 mthvedt: gmac_: i find it easier. design patterns are boilerplate to the functional mind

15:30 milos_cohagen: schmee: eg.. (alt! ch ([v] (println "val: " v)))

15:31 gmac_: mthvedt: I was never that sold on OOP but now "this", "self" and introspection like "method_missing?" just seem alien.

15:33 mthvedt: Maybe I just need to take something medicinal before dealing with the entanglement of OOP code. Different code for differnt minds I guess.

15:37 teslanick: gmac_: It changes the way you think. I write a lot more pure functions in JS and Java since learning Clojure.

15:37 schmee: milos_cohagen: thanks, that worked perfectly!

15:38 milos_cohagen: schmee: no probs!

15:48 amalloy: mthvedt: "design patterns are unnecessary in a sufficiently-good language" is just a way to feel superior. the design patterns used in OOP will naturally be different and many don't apply (and are indeed "just functions"), but stuff like middleware is a pattern in clojure that's *not* captured by the language

15:48 gmac_: teslanick: I think it depends how detached you are about programming. I have to feel passionate, intellectually, about the language I'm using and it seems a passion for Clojure, FP and immutability, at least for me, goes hand in hand with an aversion to OOP and mutability.

15:48 mthvedt: amalloy: that would be a good response to what i had said, if that’s what i had said

15:49 amalloy: "design patterns are boilerplate to the functional mind"

15:49 mthvedt: correct

15:49 amalloy: sounds to me like another way of saying the same thing, but i'm not going to argue about it if that's not what you meant

15:50 gmac_: teslanick: Clojure is quite radically opposite to mainstream programming practices and that can lead to a kind of "conversion".

15:51 teslanick: gmac_: I think that's a false dichotomy. Someone can be passionate about programming and still be happy programming in different languages. The lessons that Clojure has to teach can be partially applied (har-har!) to other languages.

15:53 My primary language is JS, professionally, and a lot of what Clojure can do, JS can do as well. There are gnarly bits, but I'm solving real problems in applications where clojure would be inappropriate for non-programming-language reasons.

15:54 gmac_: teslanick: Not sure about that. Ruby is all pure OO under the hood so if you have to read source code Clojure ain't gonna help.

15:54 teslanick: I don't understand.

15:56 gmac_: teslanick: Ruby gems are pretty heavily OOP so you're wading through lost of "class << self" and "method_missing?" contortions most of the time. Just feels very ugly after Cloure.

15:59 teslanick: Anyway it probably boils down to mindset in the end. I'm more the passionate advocate than the detached professional, hence my experience is different.

15:59 gfredericks: I did a lot of ruby prior to clojure, and my experience now (which may just be ruby rustiness) is that it is several orders of magnitude more difficult to figure out what a ruby library does by reading the source, compared to clojure

15:59 might be not just rustiness but also not knowing the ruby lib conventions very well

15:59 gmac_: gfredericks: So I'm not alone :)

16:00 teslanick: gmac_: It's a problem that ruby uses a lot of mutability and statefulness, but it's not like good software didn't exist before clojure. It's likely that imported library code is well-tested and relatively reliable. The goal is to minimize problems in your own code, which will probably be far less-tested and requires your time to maintain.

16:00 gmac_: gfredericks: I find the context-switch grates these days.

16:00 teslanick: And don't assume I'm not a passionate advocate, but we all gotta get paid.

16:00 gmac_: teslanick: Agreed, Ruby does what it sets out to do very well. Not knocking it per se.

16:01 teslanick: Just that I experience it very differently after Clojure if I have to work with it.

16:01 teslanick: gmac_: Not disagreeing with you there.

16:03 johnwalker: part of is it that ruby has been around for 20 years

16:03 teslanick: My point is that understanding clojure (or principles of functional programming and immutability) make you a better programmer in any language.

16:04 gmac_: teslanick: Yes, but beware it may make working with OOP more distasteful :) That's my point really.

16:04 teslanick: In other words, there's a potential cost.

16:06 johncash: How do I compare two functions? e.g. (== foo/bar foo/baz)

16:07 amalloy: johncash: you gotta send technomancy an email

16:07 or hiredman. they love comparing functions

16:07 johncash: ok

16:08 amalloy: the tldr is basically: functions are really hard to compare, and even in the specific case that you have two pointers to the same function it's not actually that rewarding to compare them and discover they're the same

16:09 johnwalker: can you sort functions ?

16:12 mdrogalis: ,(sort [identity str])

16:12 clojurebot: #<ClassCastException java.lang.ClassCastException: clojure.core$identity cannot be cast to java.lang.Comparable>

16:16 TEttinger: $google serializable-fn clojure

16:16 lazybot: [technomancy/serializable-fn · GitHub] https://github.com/technomancy/serializable-fn

16:38 technomancy: (inc amalloy)

16:38 lazybot: ⇒ 159

16:47 danielszmulewicz: Is a :plugins key in Leiningen's production profile allowed? I can't get it to work...

17:11 gfredericks: danielszmulewicz: what are you doing, what do you expect to happen, what actually happens?

17:13 arohner_: is there a JVM-based http client that returns an nio ReadableByteChannel for the response body?

17:14 amalloy: ~helpme

17:14 clojurebot: A bug report (or other request for help) has three parts: What you did; what you expected to happen; what happened instead. If any of those three are missing, it's awfully hard to help you.

17:14 amalloy: gfredericks: ^ is handy

17:17 gfredericks: I knew there was something like that but no way was I going to remember that key off the top of my head

17:18 amalloy: gfredericks: i tried to wangle it into ~help but that key is irretrievably overloaded

17:20 gfredericks: ~help

17:20 clojurebot: Nobody can help with "X doesn't work". Please provide context: what you did, what you hoped would happen, and what happened instead. A stack trace is especially helpful, if applicable.

17:20 gfredericks: hey look at that

17:21 ~help

17:21 clojurebot: http://www.khanacademy.org/

17:21 gfredericks: clojurebot: forget help is http://www.khanacademy.org/

17:21 clojurebot: Roger.

17:21 gfredericks: ~help

17:21 clojurebot: http://www.khanacademy.org/

17:21 gfredericks: clojurebot: forget that help is http://www.khanacademy.org/

17:21 clojurebot: Ack. Ack.

17:21 gfredericks: ~help

17:22 ~help

17:22 amalloy: gfredericks: you're just making it worse

17:22 clojurebot: Nobody can help with "X doesn't work". Please provide context: what you did, what you hoped would happen, and what happened instead. A stack trace is especially helpful, if applicable.

17:22 gfredericks: ~forget

17:22 clojurebot: you need to put the verb in pipes

17:22 gfredericks: forget help |is| http://www.khanacademy.org/

17:22 this is a disaster

17:22 clojurebot: forget help |is| http://www.khanacademy.org/

17:22 clojurebot: I forgot that help is http://www.khanacademy.org/

17:22 gfredericks: clojurebot: forget forget help |is| http://www.khanacademy.org/

17:22 clojurebot: I forgot that forget help is http://www.khanacademy.org/

17:22 gfredericks: clojurebot: forget forget that help |is| http://www.khanacademy.org/

17:22 clojurebot: I forgot that forget that help is http://www.khanacademy.org/

17:23 gfredericks: ~help

17:23 clojurebot: help?

17:23 clojurebot is eventually available

17:23 CAP: pick eventually two

17:24 hiredman: clojurebot throttles you after some number of requests in a minute or something, I forget

17:24 https://github.com/hiredman/clojurebot/blob/master/clojurebot-facts/src/clojurebot/facts.clj#L49-L54

17:26 gfredericks: I don't see any time limits on that; is this written assuming the bot gets auto-restarted?

17:28 hiredman: https://github.com/hiredman/clojurebot/blob/master/clojurebot-facts/src/clojurebot/facts.clj#L38-L42

17:31 gfredericks: well look at that.

17:33 hiredman: obviously what it should be doing is mapping nicks to some kind of entities(via some kind of classification process) and throttling based on those

17:42 maybe some kind of clustering in an 256^n dimensional space where n is some max nick length, treating each letter in the nick as an ordinate

17:43 ah

17:43 no I guess it would be n dimensional

17:43 the value is just the value

17:45 obviously not the best since it precludes using what is said for determining which entity a nick belongs to, which I guess is sort of how people do it, not just relying on nicks

17:46 aperiodic: yeah, with that scheme, wouldn't it be pretty easy to deny somebody clojurebot access by changing your nick to something similar to theirs and then getting throttled?

17:46 hiredman: aperiodic: sure

17:47 aperiodic: but for example if I changed my nick to aperiodic1 and acted like a jerk, people might associate that behaviour with you

17:48 aperiodic: sure. I don't see why that's an argument for making clojurebot work in the same way. seems just worse than just naive nick throttling.

17:49 hiredman: worse, but way cooler

17:49 aperiodic: ah, ok

17:49 carry on then

17:50 hiredman: maybe you would want two systems, an immediate one that clusters nicks to entities when a new nick is encountered once, and then a long term system based on content that would split and merge entities and nicks as required

17:51 TEttinger: what's happening with clojurebot?

17:52 was this a starlord thing?

17:52 hiredman: nothing and no

17:53 johnwalker: hiredman: how often does that happen ?

17:53 hiredman: starlord like the movie?

17:54 TEttinger: hiredman, oh someone with the nick starlord came in, entered a datomic cmd to clojurebot, got an error, and left (not quit)

17:54 hiredman: *shrug*

17:54 TimMc: hiredman: I often get throttled while checking to see if a factoid went through properly.

17:55 TEttinger: $seen starlord

17:55 lazybot: starlord was last seen talking on #clojure 3 hours and 56 minutes ago.

17:55 hiredman: TimMc: ok

18:29 justin_smith: TEttinger: re starlord, sdegutis has switched back and forth with the starlord nick in the past iirc

18:29 TEttinger: oh phew

18:29 justin_smith: there is a marker for a bot to track "foo is now known as bar" type messages

18:30 though of course anyone can poison that by switching to the same unregistered nick you once did...

18:36 TEttinger: what's the problem with nick changes all of a sudden?

18:38 justin_smith: oh, relating that to the throttling conversation

18:38 since both are about the mutability of nicks

18:41 technomancy: but what if someone uses nicks as a designation of title or office?

18:41 like the Dread Pirate Roberts

18:42 then you have another layer of indirection between nicks and true identities

18:43 hiredman: technomancy: my hypothetical 2 part system would in theory notice a change in speach leading it change ownership of the nick to a new entity

18:43 technomancy: ...unless part of becoming the new Dread Pirate involved training in speech habits and quirks

18:43 mdeboard: I don't know what's going on in here, but I like it

18:44 hiredman: sure, I dunno, I am not trying to come with a perfect system, just one as good as me :)

18:44 technomancy: I'm not even sure if you'd *want* to track changes in ownership behind a persona

18:45 what if instead of disappearing, the guy behind _why the lucky stiff just appointed a successor?=

18:45 or it could be like the way they do things on Gallifrey

18:54 gtrak: anyone have issues with maven not seeing clojars correctly?

18:54 justin_smith: technomancy: I am suprised nobody has been motivated to go around raiding various web forums and communities under the name "anonymous", but acting in such a moronic and tedious manner that all the sexiness and credibility of that collective moniker / image disappears

18:54 gtrak: eg, classlojure:classlojure:0.5.2:jar is totally not missing from clojars, maven thinks it is

18:55 justin_smith: "we are anonimuss, the earth if flat, we believe in leprechauns, we don't forgivve and we donut forget"

18:55 gtrak: just noticed that clojars is redirecting to https...

18:55 but maven says http

18:55 godammit..

18:55 * technomancy points justin_smith to http://mturk.com

18:55 technomancy: crowdfund that sucka

18:56 justin_smith: lol - if I hated anonymous enough I would totally do it

18:56 I am just noting how easy it would be to poison the name, but I have no motivation to do it

18:56 TimMc: OK, given a fn such that (find-in {:a {:b 5}} [:a :b]) => [[:a :b] 5], what should be the result of (find-in nil [])?

18:57 gtrak: there's some stale clojars URLs in the wild

18:57 TimMc: Note that (find-in {} []) should return [[] {}]

18:58 gtrak: in maven central and dependencies

18:59 amalloy: TimMc: i would expect [[] nil]

18:59 cbp: (find-in x []) -> x ?

18:59 er [[] x]

18:59 amalloy: find-in with an empty keylist is weird enough that anything would be reasonable, but given that behavior for {} i would expect it to act correspondingly for nil

19:03 johnwalker: technomancy: do you know if anyone has tried clojurescript for trivial lein tasks ?

19:05 TimMc: amalloy: With nil punning as empty map?

19:08 gtrak: hugod: I think there's a bunch of breakage related to clojure-maven/zi and friends in the maven repos

19:08 technomancy: johnwalker: I doubt it. that sounds like a pain in the neck.

19:08 turbofail: doh. i can't seem to use clojure.java.api.Clojure.var(...) from scala because var is a reserved keyword

19:08 gtrak: had to manually use https://clojars.org/repo, I think http is no longer valid.

19:09 the URL i found in the poms was http://clojars.org/repos with an 's'

19:09 johnwalker: i bet it would sort of work

19:10 gtrak: we're using the buildversion-plugin in a java project, and it's hitting it.

19:15 turbofail: ah looks like i just need some backticks

19:15 yumanki is msg spamming

19:16 johnwalker: ._.

19:16 amalloy: TimMc: you keep using the phrase "nil punning" in contexts where it doesn't really make any sense to me

19:16 johnwalker: confirmed that yumanki is spamming

19:18 amalloy: and, weirdly, when i search for "nil punning" the results are overwhelmingly about clojure, and not about scheme or cl or whatever

19:19 justin_smith: amalloy: those fish don't know what water is!

19:19 Bronsa: amalloy: targetted results from google maybe?

19:20 justin_smith: Bronsa: https://duckduckgo.com/?q=nil+punning

19:21 Bronsa: oh well then

19:21 justin_smith: you won't see any targetting with ddg, and we still see clojure mostly

19:21 amalloy: Bronsa: i guessed as much, but don't really know how to (dis)prove it. even if i search for "nil punning scheme" i get mostly clojure results

19:25 akhudek: implementing a delayed change behaviour in core.async seems more difficult than using a standard timer :-/

19:26 TimMc: amalloy: What percent of it is me bitching?

19:26 johnwalker: i thought a nil pun was just the absence of a pun

19:27 technomancy: amalloy: maybe because "punning" has negative connotations, and CLers would rather embrace it?

19:28 plus in CL it's less punny--there's no laziness or actual booleans

19:28 amalloy: technomancy: doesn't have any such connotations to me

19:28 everybody loves puns, after all

19:29 technomancy: well I love a pun as much as the next humanoid, but puns are a form of cleverness, and cleverness is best avoided in production code.

19:30 amalloy: in my search for knowledge about nil punning, i found https://github.com/saniv/text/tree/master/criticism, which seems to be someone's collected criticisms of every programming language

19:31 johnwalker: rofl

19:31 technomancy: this can't be... his entry for java is only one line

19:32 johnwalker: i wonder why people make these things

19:32 justin_smith: amalloy: cool, but so hard to read from within github

19:32 technomancy: johnwalker: repeating yourself gets old after a while =)

19:32 justin_smith: technomancy: but the lines are so long

19:32 amalloy: yes, quite unpleasant, justin_smith

19:32 technomancy: https://github.com/technomancy/dotfiles/blob/master/.gripes.org <- mine

19:33 but it's not just for languages

19:33 amalloy: you should fork it, rename all the files to .md, and send him a pull request

19:33 justin_smith: excellent idea

19:33 johnwalker: lal

19:33 amalloy: also, add a markdown.md file complaining about its formatting rules

19:34 technomancy: amalloy: srs

19:34 johnwalker: http://www.cs.uky.edu/~keen/other/foot.txt

19:40 ahh shit a redditor http://www.cs.uky.edu/~keen/pics/cats/cats.html

19:41 CaptainLex: I'm getting an issue where (str "Hello" {:foo bar}), where bar is a hash map, is actually printing

19:41 amalloy: i was just reading http://cr.openjdk.java.net/~jrose/values/values.html, and i saw something that made me laugh, in the context of "this is a feature that should be added in java 9": "Methods should be able to return values."

19:41 CaptainLex: Ohhh nevermind

19:42 I'm a dummy

19:42 amalloy: Is there a context that justifies this?

19:42 amalloy: CaptainLex: he's really talking about value types, as opposed to pointer types

19:43 CaptainLex: amalloy: Aha! Yeah, Java just needs to be able to robustly clone an arbitrary object

19:43 justin_smith: aren't value types helpful for cache coherency?

19:44 or maybe I am using the term cache coherency wrong - keeping things close together in memory in a way that is friendly to pre-fetch caching

19:47 amalloy: value types are useful for a lot of things. better cache performance is one, i'm sure

19:58 justin_smith: thinking more about it, it seems like a value type only makes sense if the storage is contiguous (like a C struct with no pointer fields), which is inherently cache friendly

19:59 I was watching those "mechanical sympathy" videos recently, so that kind of stuff is on my mind

20:15 danielcompton: justin_smith: Put a turk on it

20:17 justin_smith: heh

20:18 kenrestivo: amalloy_: after reading #9 of PHP, it is clear to me that whomever wrote that repo is insane: https://github.com/saniv/text/blob/master/criticism/php.txt ... yuck.

20:19 justin_smith: kenrestivo: woah, yuck indeed

20:23 llasram: I missed the specific call-out to #9, and skimmed up to that point thinking "these aren't *that* off base, if at all"

20:23 Then -- #9; wow

20:23 kenrestivo: (also, it's not only vile, it's inaccurate: PHP was "designed" by a greenlandic/canadian guy. but i guess a greenladic/canadian conspiracy maybe wouldn't generate the right kind of hysteria)

20:24 justin_smith: it's like someone inserted a few pages of Mein Kampf into a cogent text on programming

20:24 akhudek: we conspire to hoard the maple syrup

20:25 * kenrestivo for one welcomes domination by the greenlandic/canadian overlords.

20:25 kenrestivo: akhudek: don't forget the beer!

20:26 justin_smith: akhudek: your syrup cartel may win the day now, but when the syrup wells run dry, get ready for some "freedom" from across the border

20:50 andrewchambers: Yo

20:50 Does clojurescript output all dependencies into the output javascript file?

20:51 I installed om, and noticed that leiningen pulls in a jar file called react

20:52 but then it still requires me to manually include react in my html

20:52 \join #clojurescript

20:52 whoops

20:53 justin_smith: what lein brings in isn't neccessarily all going to go into your served pages (for obvious reasons)

20:53 andrewchambers: yeah, but what is it even dowloading?

20:53 justin_smith: but #clojurescript will probably be more helpful about the particulars

20:53 you need the js in order to serve it

20:53 andrewchambers: ok

20:53 yeah, but I had to download the javascript myself from facebook

20:54 ill switch to clojurescript

20:54 justin_smith: oh, the react dep didn't include react? that's weird

20:54 andrewchambers: I dont think so.

20:55 justin_smith: a jar is a zip file, you can find out what's in there pretty easily

20:55 andrewchambers: where does it download them to?

20:55 justin_smith: ~/.m2/repositories

20:55 clojurebot: excusez-moi

20:55 justin_smith: or maybe repository? something like that

20:55 andrewchambers: ok ill have a look

20:56 justin_smith: and then follow the qualified name of the artifact ie. ~/.m2/repository/org/clojure/...

20:56 akhudek: the react clojar dep can be used as a resource

20:57 andrewchambers: oh

20:57 justin_smith: that's what I figured yeah, via (clojure.java.io/resource "classpath/relative/location")

20:57 andrewchambers: my server is in go

20:57 ok

20:58 akhudek: andrewchambers: look on the om github page for “Your production markup should look something like this:”

20:58 and right above it it shows how to use the react.js from the deps

20:58 leiningen will just add it as a preamble to your clojurescript source

20:58 I think you still need to manually include it for dev though, not sure

20:59 andrewchambers: :preamble ["react/react.min.js"] does not work

20:59 leiningen just throws and exception

20:59 But yeah

20:59 akhudek: hmm, that’s odd

20:59 works for me, and it’s actually quite important to use the included externs

20:59 andrewchambers: I understand now, that it downloaded the resource for use from a clojure server

20:59 akhudek: you can get funny errors if you don’t

21:00 andrewchambers: ugh

21:00 I need to manually extract this each time i want to update i guess

21:00 akhudek: I mean, you can probably just go pull them from the github too

21:00 andrewchambers: also

21:00 are :advanced optimizations possible using react?

21:00 akhudek: for sure

21:01 andrewchambers: is that what the externs is for?

21:01 akhudek: advanced optimizations

21:01 yes

21:01 andrewchambers: I've had problems with name mangling before when I tried to use clojurescript for a node application

21:01 akhudek: externs are not so hard to use once you get the hang of them

21:02 I’ve written some for a few 3rd party libraries

21:02 not sure about node though

21:02 andrewchambers: clojurescript is awesome, but its not the easiest thing to setup

21:03 lpvb: why is this recur not in tail position and how do I fix it? https://gist.github.com/anonymous/2ae999b3fd0f103e6655

21:03 akhudek: there are certainly a few pain points

21:03 andrewchambers: for example. the om documentation mentions cursors everywhere, but doesn't say how to create one

21:03 akhudek: yeah, those are automatically created for the most part

21:03 Bronsa: lpvb: it is, what exception are you getting?

21:04 lpvb: java.lang.UnsupportedOperationException: Can only recur from tail position,

21:04 and then my line number

21:04 Bronsa: lpvb: well that's not the relevant piece of code

21:04 that recur is fine

21:05 lpvb: this is the only recur in my whole program

21:06 Bronsa: maybe you have some macro that expands to a recur or something, all I can tell you is that the loop you pasted is fine and definitely isn't the cause of your exception

21:06 justin_smith: ,(loop [] (let [read-bytes (rand)] (if (< read-bytes 0.3) nil (do (print \.) (recur))))) ; yeah that recur is fine

21:06 clojurebot: nil

21:07 justin_smith: ,(loop [] (let [read-bytes (rand)] (if (< read-bytes 0.3) nil (do (print \.) (recur)))))

21:07 clojurebot: .

21:07 justin_smith: ,(loop [] (let [read-bytes (rand)] (if (< read-bytes 0.3) nil (do (print \.) (recur)))))

21:07 clojurebot: ...

21:07 andrewchambers: it could be a bug

21:07 but maybe not likely

21:07 lpvb: it's a compilerexception

21:08 let me isolate it and get back to you guys

21:08 Bronsa: it's highly unlikely that's a compiler bug

21:08 justin_smith: andrewchambers: well, it's clearly a bug, but in whose code :)

21:08 andrewchambers: :P

21:10 TimMc: amalloy_: So what does nil punning mean to you?

21:14 justin_smith: TimMc: reminds me of the song "P U N N I N G, find out what it means to me"

21:14 (just a little bit, just a little bit)

21:20 gfredericks: ,(sort '(just a little bit, just a little bit))

21:20 clojurebot: (a a bit bit just ...)

21:25 hugod: amalloy_: re my strange exception the other day - turns out it was my namespace discover code not handling .class files correctly

21:26 lpvb: https://gist.github.com/anonymous/ef919ea2b636d40b5efc

21:27 this gives me the recur not in tail position exception on 1.6.0

21:27 joshuafcole_: Hey folks. Any advice on tracking down a memory leak in a relatively small running application?

21:28 andrewchambers: work out how to dump jvm heap

21:28 justin_smith: lpvb: as I showed above, the structure is fine (I just replace .write with a print, and .read with a random number etc.)

21:28 joshuafcole_: If it's relevant, it's a play-clj app I'm throwing together to brush up on my clojure, using a really tiny CES I've thrown together.

21:28 I'll look into that, thanks.

21:29 Bronsa: lpvb: you have loop as an arg

21:29 you're not using the loop macro

21:29 it gets shadowed

21:29 justin_smith: oh shit - there it is

21:30 (inc Bronsa)

21:30 lazybot: ⇒ 39

21:30 justin_smith: I was gonna say, I saw the same error evaluating that defun

21:30 Bronsa: yeah, no way that'd throw with c.c/loop

21:32 andrewchambers: (+ 1 2)

21:32 clojurebot: 3

21:33 lpvb: okay it's really silly and I feel stupid now, but I had an argument called loop that shadowed the loop form

21:33 andrewchambers: :P

21:33 justin_smith: lpvb: yeah, as Bronsa pointed out

21:33 lpvb: which bronsa told me just now lol

21:45 is there a lint tool for clojure that would have warned me for this

21:46 Bronsa: lpvb: give me 2 minutes

21:49 lpvb: https://github.com/jonase/eastwood/commit/eddd570eb5ad7356a87de31d0a4500567f48c898

21:49 should be available in the next eastwood release

21:49 lpvb: (inc Bronsa)

21:49 lazybot: ⇒ 40

21:49 lpvb: thanks!

21:50 Bronsa: http://sprunge.us/GPcF here's the warning it produces

21:50 lpvb: np, I've wasted hours myself because of that issue

21:51 ambrosebs: (inc Bronsa)

21:51 lazybot: ⇒ 41

21:51 ambrosebs: amazing service

21:52 I was showing off tools.analyzer to a few people at International Lisp Conf

21:52 Bronsa: I'm just doing it for the incs

21:52 TEttinger: (inc Bronsa) ;; while we're at it

21:52 lazybot: ⇒ 42

21:53 Bronsa: heh

21:53 TEttinger: I don't even know what you did

21:53 ambrosebs: TEttinger: claimed to deliver a linter in 2 minutes

21:53 then did it

21:53 TEttinger: nice work

21:56 danielcompton: lpvb: we've all done it

21:57 TEttinger: the inc Bronsa?

22:02 kenrestivo: there's kibit too, but i guess eastwood is the newer one

22:02 clojurebot: In Ordnung

22:07 andrewchambers: ()

22:07 '()

22:07 justin_smith: ,()

22:07 andrewchambers: (+ 1 2 3)

22:07 clojurebot: ()

22:07 *suffusion of yellow*

22:07 andrewchambers: what the difference between clojurebot and lazy bot

22:07 brehaut: andrewchambers: everything but being written in clojure :P

22:07 justin_smith: ,"I am clojurebot" ##"I am lazybot"

22:07 clojurebot: "I am clojurebot"

22:08 justin_smith: I guess lazybot ignores things that mention clojurebot ##*clojure-version*

22:08 ,*clojure-version*

22:08 clojurebot: {:interim true, :major 1, :minor 7, :incremental 0, :qualifier "master"}

22:08 justin_smith: &*clojure-version*

22:08 lazybot: ⇒ {:major 1, :minor 4, :incremental 0, :qualifier nil}

22:08 andrewchambers: so by two different people?

22:09 justin_smith: two different clojure versions, different non-clojure command sets, run by two different owners, yeah

22:09 brehaut: yes

22:09 andrewchambers: ,(+ 1 2 3)

22:09 clojurebot: 6

22:09 andrewchambers: (+ 1 2 3)

22:09 clojurebot: *suffusion of yellow*

22:09 brehaut: https://github.com/hiredman/clojurebot https://github.com/flatland/lazybot

22:09 andrewchambers: '()

22:09 ,'()

22:09 clojurebot: ()

22:09 andrewchambers: :)

22:09 brehaut: clojurebot does a whole lot of factoid stuff

22:10 justin_smith: and lazybot does $karma

22:10 andrewchambers: '(do (println "hello") (println "world"))

22:10 ,(do (println "hello") (println "world"))

22:10 clojurebot: hello\nworld\n

22:11 andrewchambers: how do we get his factoids

22:11 >_>

22:11 brehaut: clojurebot is also implemented as a couple of services behind an IRC gateway / dispatcher

22:11 ,help

22:11 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: help in this context, compiling:(NO_SOURCE_PATH:0:0)>

22:11 brehaut: err

22:11 ~help

22:11 clojurebot: http://www.khanacademy.org/

22:11 justin_smith: lol

22:12 joshuafcole_: Hey folks, I'm trying to retrieve the arglist of a built in fn in a macro, but I'm getting the wrong meta back.

22:12 I can get it working by hand with (meta #'identity)

22:12 brehaut: you address it (~ is shorthand) and if it knows anything, it might respond

22:12 andrewchambers: ~google

22:12 clojurebot: Pardon?

22:12 andrewchambers: clojurebot: tell me something funny

22:12 clojurebot: excusez-moi

22:12 andrewchambers: cool

22:12 joshuafcole_: but when I try to pull it out in my macro (it's stored in the var ctor#) I get useless meta back since I'm referring to it wrong

22:13 brehaut: clojurebot also does inference if it doesnt know what you mean, and will sometimes respond to things not addressed to it

22:13 joshuafcole_: (:arglist (meta ctor#))

22:13 justin_smith: joshuafcole_: does ctor# point to the var, or what the var resolves to?

22:13 joshuafcole_: ctor should be holding the symbol identity at that point I _think_

22:13 I'm relatively new to macro programming

22:14 I can pastebin the whole macro if it would help

22:14 andrewchambers: ~core.async

22:14 clojurebot: core.async is not Go

22:14 andrewchambers: ~golang

22:14 justin_smith: joshuafcole_: so you want (meta #'ctor#) in that case

22:14 or maybe (meta (var ctor#)) is more readable

22:15 Clarice: andrewchambers: You should make ~golang point to #go-nuts

22:15 joshuafcole_: hmm, when I try that I get an interesting error

22:15 andrewchambers: how do we store facts in him?

22:15 Clarice: Who knows.

22:15 joshuafcole_: I've confirmed ctor# holds clojure.core/identity w/ a watch in Light Table, but I get the error:

22:16 andrewchambers: I think i killed it

22:16 not responding anymore

22:16 joshuafcole_: welp, can't copy error results in LT *files into the todo list*

22:16 justin_smith: andrewchambers: this works: (defmacro get-meta [ctor] `(meta (var ~ctor)))

22:16 andrewchambers: wrong person

22:16 justin_smith: oh, sorry

22:16 joshuafcole_: this works: (defmacro get-meta [ctor] `(meta (var ~ctor)))

22:17 joshuafcole_: I'll give that a go.

22:17 TEttinger: clojurebot: golang |is| #go-nuts

22:17 clojurebot: c'est bon!

22:17 TEttinger: ~golang

22:17 clojurebot: golang is #go-nuts

22:18 andrewchambers: awesome

22:18 ~prolog

22:18 ~haskell

22:18 he must have a rate limiter or something

22:18 or just lagging

22:18 justin_smith: yeah, rate limiting

22:18 also you can use msg

22:18 TEttinger: ~core.async

22:18 clojurebot: core.async is not Go

22:19 andrewchambers: ~haskell

22:19 justin_smith: unless it is really important that we all see what clojurebot has to say, of course

22:19 TEttinger: lazybot is un-rate-limited but has no factoids

22:19 andrewchambers: Hmm

22:20 I wonder what features could be given to him to make him more useufl

22:20 joshuafcole_: justin_smith: unfortunately, I need to resolve it at macro compile time, since I'm trying to pull out the arglist to build a new fn.

22:20 Although, introspecting into my result, I may have found the weird error from trying to do it unquoted

22:21 wrapping it in a watch in LT wrapped it in the watch cb, sot the meta was invalid

22:21 :P

22:21 alas it's still unable to resolve the var pre-compile (or whatever the appropriate term is) with the line

22:21 args# (:arglist (meta (var ctor#)))

22:22 justin_smith: can you paste the code?

22:23 joshuafcole_: Here's the whole macro http://pastebin.com/UnAeXxnE

22:23 sorry it's a bit gnarly, and thanks for all the help so far

22:23 relevant line is 9

22:24 justin_smith: do you know that ctor# is a symbol? also the usage of foo# outside ` looks really weird to me

22:25 though it is of course valid

22:25 joshuafcole_: whoops. Downgrading myself from macro novice to macro newb

22:26 didn't even consider that I'd only need gensym if I were embedding it

22:26 and according to LT's watch, it looks like a symbol. I'll wrap it in (symbol? to be sure

22:26 justin_smith: also :arglist will be nil

22:26 you want :arglists

22:27 there are multiple arglist possibilities for an fn in clojure

22:27 joshuafcole_: gotcha, thanks

22:27 justin_smith: that last one may be your actual problem

22:27 (at the very least it will be one of them :) )

22:27 joshuafcole_: alas not, the meta is the meta just file position meta

22:27 doesn't contain any fn meta

22:27 but it certainly was one

22:28 justin_smith: well remember that's not fn meta either - it's var meta

22:28 with some keys that vars for fns have

22:28 joshuafcole_: my wording was bad, I meant it as meta associated with function vars.

22:29 justin_smith: what happens if you just check the meta? you could add '_ (println (meta (var ctor#)))' to the let bindings after binding ctor#

22:31 joshuafcole_: I get an error when I try

22:31 unable to resolve var ctor#

22:31 justin_smith: ahh, because var is a macro

22:31 right

22:32 joshuafcole_: _ (println (type ctor)) does return symbol though

22:32 as hoped

22:32 (dropped the autogensym since it wasn't necessary -- thanks)

22:32 oh?

22:32 are macros in macros not possible then?

22:32 justin_smith: they are possible

22:33 but (var foo) always gets #'foo - it doesn't resolve foo locally first

22:33 since it is a macro and all

22:34 joshuafcole_: oh, so since it's not resolved

22:34 we get the literal instead of the value?

22:34 justin_smith: aha!

22:34 ,(let [foo 'identity] (resolve foo))

22:34 clojurebot: #'clojure.core/identity

22:34 justin_smith: you just uttered the magic word

22:34 sorry it took me so long to remember :)

22:34 joshuafcole_: sweet! trying now!

22:35 haha, I never would have figured it out without you

22:35 justin_smith: but you used the word, it jogged my memory

22:35 joshuafcole_: I count myself as a decent programmer, but clojure feels in many ways like another level

22:35 let alone diving into macros

22:35 and trying to keep track of what's happening when. :) It's a very fun puzzle

22:36 eeeeee!

22:36 It worked! :) Thanks a ton justin

22:36 justin_smith: np

23:08 danielcompton: Does anyone know why emacs autocomplete makes all of the other buffers pause when you type a completable word?

23:09 justin_smith: danielcompton: emacs has no concurrency whatsoever

23:10 danielcompton: justin_smith: :(

23:10 mutable state is a con's currency

23:11 kenrestivo: sshfs in emacs is barrels of fun, especially with magit. lockus-emacus for 10 minutes at at ime.

23:11 justin_smith: emacs would be so much better if elisp had threading

23:12 but it would also need the other stuff that makes threading usable too

23:12 I know, let's rewrite emacs in clojure

23:12 :P

23:12 kenrestivo: i think someone here was talking about doing that some years ago

23:12 justin_smith: "rewrite emacs in foo" is basically a running joke

23:12 attempted many times

23:12 brehaut: wasnt guile written to be a scheme for reimplementing emacs in?

23:13 Jaood: yeah, I though guilemacs was reals

23:13 justin_smith: and some day we may even see a usable guilemacs

23:13 http://www.emacswiki.org/emacs/GuileEmacs

23:13 brehaut: you’d have to convince someone to port orgmode to guileemacs before the faithful would look though ;)

23:14 kenrestivo: org mode, and 30 years worth of other cruft

23:14 * kenrestivo mutters "pipe dream"

23:15 Jaood: will never happen

23:15 brehaut: if you can figure out how to monetize it and prove it to jetbrains, it’ll be done in 6 months, otherwise never

23:16 Jaood: "Emacs for non-GNU extremists"

23:16 will that sell?

23:17 kenrestivo: i think that was called "lemacs". and see where that went.

23:18 justin_smith: some people still use xemacs

23:18 which is what lemacs become

23:18 *became

23:18 andrewchambers: rewrite emacs in clojure if you don't mind your text editor taking a few seconds to startup

23:19 >_>

23:19 brehaut: andrewchambers: thats different to emacs how?

23:19 justin_smith: and there is efuns, written in ocaml, and climacs in lisp

23:19 joshuafcole_: There is Light Table, but it needs a lot more work to be a daily driver for most people.

23:19 andrewchambers: I don't use emacs, does it take a long time to start? I just know on my laptop clojure takes 5 seconds to print hello world :P

23:19 joshuafcole_: the emacs mode is passable for a light user of emacs, but it's got a couple weird flaws and doesn't support any of the existing stuff

23:20 andrewchambers: just from the runtime init

23:20 joshuafcole_: Well, vanilla emacs doesn't, but who runs vanilla emacs?

23:20 andrewchambers: clojurescript might be ok

23:20 brehaut: andrewchambers: its well known that most people writing software close their editor after every line they type

23:20 justin_smith: andrewchambers: it's not concurrent at all, so long running elisp scripts lock up the whole app

23:20 andrewchambers: brehaut: it depends, if its your ide, or your text editor

23:20 justin_smith: andrewchambers: think back when bad js would lock up your entire browser

23:21 andrewchambers: I think clojure is an awesome language, but the startup is so painful

23:21 I would hesitate to use it for anything that isn't a server

23:21 brehaut: thats why nobody who is serious about clojure restarts their process often

23:21 joshuafcole_: a lot of things can be run in daemon mode, andrew

23:22 Emacs has that built in as well

23:22 andrewchambers: clojurescript trades startup speed for runtime speed

23:22 justin_smith: andrewchambers: our friends Bronsa and arrdem are working on the startup time issue

23:22 andrewchambers: yeah

23:22 I think background daemon is fine

23:22 it just depends on the application

23:22 joshuafcole_: When I used that primarily I had it set up to start when I logged in and then just connect clients, which was lightning fast and also had the benefit of keeping state

23:23 danielcompton: Has Lighttable been deprecated? The LT table team seem to have moved on to creating their own language and framework

23:23 joshuafcole_: but if I wanted to write a tool like ls or grep, yeah, it'd be pretty weird to need an "ls-daemon" ;P

23:23 andrewchambers: danielcompton: where did you hear that?

23:23 joshuafcole_: danielcompton: Not really, they just aren't doing a lot of dev on it now. As I understand it they intend to embed the editor for their new lang in LT

23:23 brehaut: danielcompton: if you start building a brand new editor chances are you are already at olympic grade yak shaving levels; a new language and framework is the obvious next step

23:24 andrewchambers: they dont like clojurescript anymore?

23:24 joshuafcole_: the community is taking decent care of it, though it's suffering a bit from not having a central voice on things or much (*cough* any) documentation right now

23:24 justin_smith: finally: an email client and server

23:24 joshuafcole_: I don't think it's that they don't like clojurescript, I think it's that they're trying to take it to the logical extreme

23:24 danielcompton: andrewchambers: andrewchambers http://podcasts.thoughtbot.com/giantrobots/111 talks about what they're doing

23:25 joshuafcole_: their new lang is going to be hosted, and if I had to guess the lang it was hosted on I'd bet a shiny nickel it's clojure/script

23:25 danielcompton: brehaut: I think there's a new database too

23:25 joshuafcole_: think it's plain JS

23:25 brehaut: danielcompton: i would be disappointed if there wasnt

23:25 joshuafcole_: Well, the database and the lang are one in the same :P

23:25 According to the talk anyway

23:25 danielcompton: joshuafcole_: maybe they're writing a js compiler too?

23:25 I'm interested to see where it lands

23:26 joshuafcole_: Eh, I'm sure many common lispers scoffed at clojure when it was first incubating

23:26 I have no idea if their new language will hold water

23:26 but I'm not ruling it out

23:26 They seem to be taking the sane approach of vastly limiting it's scope and hosting it in a more mature lang

23:27 Jaood: One problem with LT is that it offload all of its editor work to that web editor communitty thing

23:27 kenrestivo: i dunno about scoffing, but one of the most entertaining talks i've watched is rich defending it like a doctoral thesis at the NYC lisp meetup very early on in clojure's life.

23:27 Jaood: which is bad

23:27 joshuafcole_: CodeMirror, yeah

23:27 brehaut: codemirror

23:27 danielcompton: kenrestivo: do you have a link?

23:27 joshuafcole_: well, CodeMirror isn't bad, but them not contributing back to fix it's missing features is

23:27 Jaood: atom creating their own which I hear is still pretty slow

23:27 kenrestivo: danielcompton: long since lost track of it, bet it's up on youtube.

23:28 joshuafcole_: as far as an editor goes, CM is _shockingly_ good for being a web editor written in JS

23:28 handles giant files with ease, passable emacs and vim modes

23:28 pretty good API

23:28 danielcompton: kenrestivo: looks like this one maybe? http://lists.gnu.org/archive/html/help-gnu-emacs/2007-11/msg00213.html

23:28 joshuafcole_: and I really like the maintainer, I've worked with him to diagnose a few issues and he's been unfailingly helpful

23:29 Jaood: joshuafcole_: I guess it was the integration with LT then

23:29 joshuafcole_: that said, it hasn't had 30 years of aging to improve it the way emacs or vim has

23:29 kenrestivo: danielcompton: what i remember is the cameraperson had misframed the thing so it was like half of rich's face and half of the slide, couldn't see either very well, but you could hear the dialogue, again IIRC, it's been a while

23:29 Jaood: or web editors still can't compete

23:29 joshuafcole_: when did you last test it, Jaood? If your problem is performance, 6.0 and newer has been a huge improvement thanks to the upgrade to CM4

23:30 kenrestivo: the funniest bit was the blunt way he'd answer questions. like Q: "do you intend to implement call/cc?" A: no.

23:30 Jaood: yeah, before 0.6.0

23:30 kenrestivo: then there was laughter, uncomfortable silence, and then Q: "do you care to explain why not?"

23:30 joshuafcole_: That said, even if it's silky smooth for you now, it's probably not feature complete or documented enough to really convince most people to jump ship

23:31 haha

23:32 Jaood: joshuafcole_: I guess the concept is very cool but the implementation/making it practical was very hard

23:32 joshuafcole_: Yeah, you've got me there

23:32 I jumped in pre 5.0, before there was a plugin API

23:33 and dove in to the compiled output to write a few plugins for missing features

23:33 I'm convinced that if I didn't have a dayjob I could whip it into shape in a reasonable amount of time

23:33 but as it stands I still stumble into a lot of rough edges I don't have the time to polish away

23:33 Jaood: the sublimetext guy deserves huge credit for making it succesful alone, I wonder if that guy burn out and that's why everyone complains about updates

23:34 andrewchambers: i think he just swaps to newer version of sublime text

23:34 isnt there version 4 now? :P

23:35 joshuafcole_: yeah. The biggest reason I dropped that was that it was closed source. Not being able to see how things tick is frustrating to me when I'm trying to figure out if a bug is me or the editor or a plugin. :p

23:51 greenznc: what's the problem with this code https://gist.github.com/anonymous/4aa37273936d39e57c99

23:52 I expect three alerts but actually got six

23:52 twice for each endpoint

Logging service provided by n01se.net