#clojure log - Jul 24 2013

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

0:06 axle_512: is there something like a 'with-open' macro, but one that deletes the file instead of closing it?

0:07 I have a tmp file that I want removed by the time the function returns.

0:08 bbloom_: (defmacro with-file [f & body] `(let [x# …] (try ~@body (finally (doto x# .close .delete)))))

0:08 something like that

0:08 axle_512: bbloom_: thanks!

0:08 rishda: decomplect

0:08 I mean...

0:09 decomplecjt

0:09 bbloom_: axle_512: just use (source with-open), copy paste, and go from there :-P

0:09 axle_512: bbloom_: got it, thanks

0:10 bbloom_: I will study the macro… just didn't want to re-invent it if it was already there

0:40 tomjack: hyPiRion: just noticed your lazybot mail re (assoc weird :squared 4), makes sense :)

0:49 xpe: is the Clojure/West Pedestal video available?

0:51 chouser: xpe: not yet

0:51 watch for it here: http://www.infoq.com/clojure-west-2013/

0:52 xpe: chouser: thanks.

0:56 chouser: oh, actually, it looks like that one's not going to happen. "we had some issues in the first half of the Pedestal talk and we've decided not to release the second part as it wouldn't make much sense without part 1."

1:03 shaungilchrist: :(

1:10 rishda: technomancy: see https://groups.google.com/forum/#!topic/clojure/qs3_0eYbDE0

1:11 Because test2 was too ambitious.

1:12 Groups and nodes and such, that was a bad idea.

1:20 xeqi: xpe: have you seen the pedestal tutorial?

1:20 xpe: xeqi: yes

1:22 tomjack: rishda: "Fixtures: Nope." :)

1:22 rishda: tomjack: heh

1:22 tomjack: makes sense

1:24 rishda: tomjack: Although I'm not sure yet of an elegant way to stand the database up at the beginning of the whole test run. But I think that's a job for a shell script or something else.

1:24 (That's what I assumed once-fixtures were for.)

1:24 tomjack: ehh I dunno

1:24 callen: rishda: futile?

1:24 rishda: oh yeah

1:24 tomjack: I'm thinking you shouldn't need to do that

1:24 rishda: callen: I was hiding from you cuz ur so mean

1:24 callen: rishda: I could tell it was you from your habit of blasting random people.

1:25 tomjack: I guess maybe your code/application should take whatever it needs as arguments and you should be able to do whatever you need in each test easily

1:25 Raynes: Ya know what I'm gonna do? I'm gonna use clojure.test.

1:25 rishda: callen: http://bit.ly/13CyI53

1:25 callen: Raynes: that's what the cool kids do.

1:26 rishda: Raynes: not on refheap apparently

1:27 Raynes: Refheap doesn't have tests.

1:27 I think you mean laser or fs.

1:27 rishda: nope i meant refheap

1:27 Raynes: Then I haven't the foggiest idea what you're referring to.

1:28 rishda: tomjack: I discovered that technique yesterday for getting rspec-like "let" functionality

1:28 tomjack: I haven't used it in practice but it looks promising

1:28 callen: Raynes: what are you going to use clojure.test with?

1:28 tomjack: rspec has "let"?

1:29 Raynes: Seriously, what are you talking about rishda?

1:29 ddellacosta: tomjack: yep, I think it's a relatively recent addition though (relatively recent, in the last two years?)

1:29 rishda: tomjack: yeah, or speclj's "with" if you're more familiar with that

1:29 ddellacosta: maybe 3 years, yeah

1:29 ddellacosta: ping callen

1:29 rishda: tomjack: http://betterspecs.org/#let

1:30 tomjack: or http://speclj.com/docs/with

1:31 ddellacosta: rishda, are you the author of verily?

1:31 rishda: ddellacosta: yeah

1:31 ddellacosta: rishda: what problems are you trying to solve by releasing another testing lib?

1:31 rishda: ddellacosta: well, first of all, there arent enough Clojure testing libs

1:32 ddellacosta: rishda: I'm serious

1:32 rishda: ddellacosta: well, first of all,

1:32 Every time I go to use an existing one, some part of its API feels magical and wrong.

1:32 ddellacosta: rishda: ...like?

1:33 callen: ddellacosta: rishda is futile.

1:33 rishda: ddellacosta: well take midje for example. It's not clear how it even works in the first place. So I lose that referential transparency.

1:33 callen: ddellacosta: try not to take him *too* seriously.

1:33 rishda: ddellacosta: yeah I'm futile btw.

1:33 ddellacosta: yeah don't take me *too* seriously.

1:33 callen: does anybody here know what the deal is with nthFrom and .isArray?

1:33 I'm seeing it pop up in an instrumented profiler snapshot and I'm kinda wary I'm being fed bad data.

1:34 rishda: ddellacosta: and with both expectations and midje, I don't like that the tests are at the top level.

1:35 ddellacosta: callen, rishda: I use midje and clojure.test (and clojurescript.test) in equal amounts almost every day. I write a lot of tests. So I'm honestly interested in hearing what is wrong with the libs that are out there, and what rishda was trying to solve. But call me skeptical, at the moment, that we need a new one

1:35 rishda: ddellacosta: and the way speclj uses exceptions to implement assertions makes it impossible to test pre/post conditions

1:35 ddellacosta: rishda: at the top level, what do you mean? There are no such constraints in midje that I know of

1:35 callen: ddellacosta: I'm one of those people that is perfectly happy with clojure.test

1:35 rishda: ddellacosta: fact/facts goes at the top level

1:36 ddellacosta: rishda: what do you mean? top level? Top level of what?

1:36 rishda: the namespace.

1:36 ddellacosta: callen: I like clojure.test just fine. There is some syntactical sugar in midje I'm quite fond of though

1:36 rishda: why is that a problem?

1:37 rishda: ddellacosta: It's not clear if requiring that namespace will run those tests or not. Also there's no way to run just "some" tests.

1:37 ddellacosta: with verily's test-functions, you can tag them with metadata, and run only matching tags.

1:38 ddellacosta: I guess you could look at how i separate assertions from tests as having a similar motivation for Clojure separating symbols from vars.

1:38 ddellacosta: I can run a test which contains several of assertions, and that gives me finer granularity and control.

1:38 Okay maybe that's not the same motivation.

1:38 ddellacosta: rishda: … there are plenty of ways to filter/limit what tests you run. Many many ways. For example, in midje, there are filters: https://github.com/marick/Midje/wiki/Repl-tools#loading-facts-into-memory-and-working-with-them-details

1:39 rishda: ddellacosta: Okay, Midje may have solved that. But my main reason for not liking Midje specifically is its syntax.

1:39 ddellacosta: rishda: in clojure.test, I don't find it particularly painful to namespace tests either

1:39 callen: ddellacosta: leiningen test selectors yo.

1:40 rishda: ddellacosta: I much prefer expectations's syntax, (expect empty? coll)

1:40 callen: they're maaaaaagic.

1:40 ddellacosta: rishda: okay, I can understand that. Midje does assume you'll buy into a whole way of working, and it uses a very specific syntax.

1:41 callen: are you talking about profiles? I'm not sure I'm familiar with that!

1:41 callen: ddellacosta: nuh uh, test selectors.

1:41 ddellacosta: callen: this? https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L116

1:41 neat

1:41 dark_element: I am trying process a javascript array in clojurescript. All the things i have tried till now are not fast enough. https://www.refheap.com/16881 Is there any other way to map a function over a javascript array.

1:41 ddellacosta: didn't know about that.

1:41 callen: ddellacosta: yep.

1:41 ddellacosta: it's just functions and keywords based on deftest metadata

1:41 ddellacosta: works great.

1:43 ddellacosta: callen: that's cool…speaking of, is there a way to run (clojure.test) tests in the repl based on metadata? That would be the bees knees

1:44 rishda: Looks like "verily" was taken. Oops.

1:44 callen: ddellacosta: not that I know of. I'd rather enjoy that too.

1:45 rishda: ddellacosta: test selectors are trying to go away, btw.

1:45 ddellacosta: btw in Verily you can run tests in the repl based on metadata.

1:45 ddellacosta: rishda: I'm giving you a hard time because I think your test-lib development time would be better spent augmenting one of the libs that are out there. I think you won't get a lot of uptake from folks, as the libs that exist now seem to scratch *most* people's itches--in clojure.test we have a standard, baked-in, easy way to test, in expectations we have a really clean, simple style, and in midje we have a lot of nice bells and

1:45 whistles and sugar

1:46 rishda: I think you have some good points to make, but a lot of people are very invested in the libs that are out there.

1:46 rishda: ddellacosta: yeah I'll probably be its only user.

1:46 ddellacosta: rishda: granted, if you just want something for yourself, you know, go nuts. :-)

1:46 rishda: oh well.

1:47 ddellacosta: plus, keep in mind, it's a lot harder to modify someone else's lib, especially when they have tons of features.

1:48 ddellacosta: rishda: I think it depends on how you define "harder."

1:48 rishda: I'm not a good programmer, so I always have a hard time modifying someone else's code.

1:48 callen: rishda: learn!

1:48 ddellacosta: rishda: instead of knocking on your abilities, read and modify other people's code, and then you will get better.

1:48 callen: rishda: it'll make you a vastly better programmer dancing to somebody else's tune and learning the steps.

1:49 rishda: callen: It's not that I don't know how to code, it's that I'm not good at understanding other people's code.

1:49 ddellacosta: rishda: what callen said.

1:49 callen: rishda: okay? so do it until you get better at it.

1:49 ddellacosta: rishda: this is something that can be overcome.

1:49 callen: rishda: life is like karate kid man. Wax on, wax off.

1:49 rishda: Okay let me reword it.

1:49 Their code sucks.

1:49 ddellacosta: rishda: no, your attitude sucks

1:49 rishda: And I'm not going to dive into that crap and polish it up.

1:49 Not that I've looked at it really. I'm just assuming.

1:50 From a few lines I have seen.

1:50 ddellacosta: rishda: if that's what you really think then don't hide behind this false modesty bullshit. That is serious asshole crap.

1:50 Raynes: I'm not sure how I feel about someone who proclaims to be a bad programmer dictating what testing libraries should be like and the quality of other people's code.

1:50 $google troll

1:50 lazybot: [Troll (Internet) - Wikipedia, the free encyclopedia] https://en.wikipedia.org/wiki/Troll_(Internet)

1:50 Raynes: ddellacosta: ^ see this article.

1:51 ddellacosta: Raynes: I know what you're saying, but talking to rishda I just get the feeling they are young and naive. All of us think other people's code is crap at one time or another, but we get over it

1:51 Raynes: I'm 19, man.

1:51 rishda: I think I'm just reacting to my frustration with Joodo and Hyperion and Speclj.

1:51 aaelony: hey guys, what's a good what to grab a random subset of a collection?

1:51 ddellacosta: Raynes: age does not imply maturity. ;-)

1:51 rishda: I'm really, really frustrated with those libs.

1:51 aaelony: a good way (not a good what)

1:52 rishda: You would be too if you were using them every day.

1:52 SegFaultAX: aaelony: Can you be a little more specific about your requirements?

1:52 ddellacosta: rishda: well, like I said, if you want to write your own lib then go ahead, I'm just giving you my opinion. But I would cool it with the "I say I'm a bad programmer but I really mean I hate other people's code" crap

1:52 callen: aaelony: https://github.com/bigmlcom/sampling http://asymmetrical-view.com/2010/10/19/sampling-a-sequence-with-clojure.html

1:52 amalloy: aaelony: https://github.com/flatland/useful/blob/develop/src/flatland/useful/seq.clj#L149, although i would write it a little differently now

1:52 Raynes: Well, you're using a web framework that nobody uses for starters.

1:53 SegFaultAX: aaelony: Are you looking for a random contiguous subarray, or just a random selection of elements from anywhere at all in the input?

1:53 tomjack: I found bigmlcom a couple days ago

1:53 cool stuff

1:53 rishda: ddellacosta: I didn't even have to be honest about it, I could have just kept saying I'm not good at it and ended the conversation, so don't I get a break for at least being honest eventually? Crap, man.

1:53 Raynes: Yes. Yes I am.

1:53 tomjack: I am playing with reservoir sampling w/ cascalog now

1:53 aaelony: SegFaultAX: sure, actually using Incanter. I have an incanter dataset that I'd like to take "cuts" of. For example, if there are 1000 rows, I want to select say 50 rows in a random manner. If it's easier not as an incanter dataset, that's fine too

1:53 ddellacosta: rishda: no

1:53 rishda: oh fuck it.

1:54 i suck at open source

1:54 ddellacosta: this has nothing to do with open source

1:54 Raynes: Well, not necessarily.

1:54 tomjack: aaelony: if you only have 1000 rows, (take 50 (shuffle rows)) ?

1:54 Raynes: Your people skills leave something to be desired.

1:54 rishda: this is the same thing that happened with Zephyros

1:54 Raynes: Can't say mine are particularly good though.

1:54 SegFaultAX: aaelony: See amalloy's link. That's a good approach to what you're looking for.

1:54 rishda: I wrote it because Slate.app absolutely sucks, is full of memory leaks and bugs and copy/pasted code, and is literally 10 times longer than it needs to be.

1:54 aaelony: tomjack: that might work. I'll be doing this repeatedly though

1:55 rishda: So I wrote Zephyros to fix those problems. And nobody uses it. It just sits there on github.

1:55 Same thing here.

1:55 aaelony: SegFaultAX: cool, what is amalloy's link?

1:55 callen: would it be utterly crazy to rewrite assoc-in in terms of transients?

1:55 for an inner-loop operation?

1:55 amalloy: callen: yes. it would gain nothing

1:55 callen: amalloy: YISSSS, I needs you. I have yourkit snapshots to divine.

1:56 SegFaultAX: aaelony: Scroll up.

1:56 callen: amalloy: 81% of the application is spinning in .isArray(), from nthFrom, from nth, from assoc-in.

1:56 amalloy: for a coll that is a map.

1:56 aaelony: SegFaultAX: cool. got it. looks useful.

1:56 amalloy: why are you nthing a map? that doesn't even work

1:57 callen: amalloy: it's assoc-in. I'm not nth'ing.

1:57 amalloy: it's not the map that assoc-in is checking for array-ness, it's the &args

1:57 callen: clojure.core$assoc_in.invoke(Object, Object, Object)

1:58 amalloy: in that case, we'd be looking at the second argument, no? Is it normal for isArray to suck up so much time?

1:58 amalloy: bbloom_ has a patch to make related stuff faster, though i'm not 100% sure it applies to your code

1:58 callen: I know about the RestFn patch

1:59 this isn't RestFn I don't *think*

1:59 amalloy: yeah, i think you're right

1:59 callen: amalloy: https://github.com/yogthos/Selmer/blob/master/src/selmer/parser.clj#L65

1:59 amalloy: assoc-in there I believe.

2:01 I haven't been able to find anything about isArray being the slow part of an inner-loop before. admittedly we're probably doing a lot of assoc-in but I wouldn't have guessed isArray would be the slow part.

2:02 that or YourKit is lying to me.

2:02 amalloy: well, isArray is reflection. that's slow

2:02 callen: amalloy: is there a way to short-circuit or avoid that?

2:03 rishda: ddellacosta: it's not arrogant to say something's better when it really is

2:03 aaelony: looks like incanter.stats/sample does what I need as well. coolness

2:04 amalloy: callen: i think (map keyword (vec ...)) might help

2:04 vec on a small array is supposed to be free-ish, and then you'll sidestep the isArray checks

2:06 but i'm really just waving a dead chicken over it

2:08 callen: amalloy: I'll give it a whirl, thank you.

2:08 clojurebot: amalloy is nuts for juxt

2:08 amalloy: i don't understand the reason for the order of the clauses in RT/nthFrom or RT/seqFrom

2:08 callen: LOL

2:08 amalloy: they seem crazy to me, but i'm sure rich has a good reason

2:13 rishda: gfredericks: was it you who suggested returning list of assertions from a test-fn?

2:13 I'm starting to like that idea a lot suddenly.

2:15 well anyway, now that I've pissed off the hundredth community..

2:16 callen: rishda: talking about yourself again.

2:16 rishda: just focus on doing useful things and making things.

2:16 rishda: callen: do you believe in God?

2:16 callen: rishda: that's not relevant in a programming channel.

2:16 rishda: oh man you ruined my awesome comeback

2:17 callen: but thats ok i have a backup comeback: "dont be a jerk"

2:17 oh fuck it. fuck it all.

2:21 SegFaultAX: Well, that ended abruptly.

2:23 ddellacosta: wow, I set ignore so it seems like there was a whole conversation that happened I missed...

2:24 callen: not missing much.

2:25 ddellacosta: figured.

2:25 ;-)

2:26 callen: I feel strange "improving" upon core like this.

2:31 rishda: Is there a way to delete a project from clojars?

2:31 SegFaultAX: rishda: Why do you want to do that?

2:32 rishda: Because this project is utterly and completely pointless.

2:32 Plus it's already using the same name as another project. So I want to delete it.

2:32 SegFaultAX: rishda: Contact clojars, then.

2:34 rishda: Thanks SegFaultAX.

2:36 futile: ddellacosta: solved the problem by deleting "verily".

2:37 Thanks for pointing out how much of an arrogant, selfish, idiotic ass I am. It's really been a breath of fresh air.

2:37 And thanks to you too callen.

2:38 callen: futile: still talking about yourself.

2:39 futile: callen: you're right, totally stupid and wrong of me.

2:39 callen: stopping now.

2:39 callen: futile: how about them Browns?

2:39 futile: oh no, uhm, Bears?

2:39 ddellacosta: futile: I said no such thing. I was calling out a specific aspect of your behavior which was disingenuous and unbecoming of a programmer who is engaged in a lifelong process of learning and growth. I am not interested in making you feel bad.

2:39 futile: ddellacosta: I can't respond to you or callen will yell at me again

2:39 callen: fuck, my attempt made the code almost twice as slow.

2:39 fuckity fuck fuck.

2:39 and I don't even know why.

2:40 well I have a guess.

2:40 ddellacosta: futile: as far as the library which you hastily deleted, I think that was rash. Just because I asked you pointed questions on its value doesn't mean it was without value. You would have been better off continuing to use it, work through any issues you had with it, and then trying to gauge interest again.

2:40 futile: callen: it's probably using an internal type that isn't doing any structural sharing

2:40 callen: futile: you don't even know what code I'm working on :P

2:41 ddellacosta: futile: I'm just some random guy after all.

2:41 SegFaultAX: Lotta anger in the channel tonight. :/

2:41 callen: oh wait, that's faster now.

2:41 dafuq

2:42 futile: ddellacosta: I've been around IRC long enough to know that whenever someone else puts you on /ignore, it's because you've fucked everything up so severely that there's no going back, and that point was about 3 times earlier than you think.

2:42 callen: WHOA

2:42 futile: ddellacosta: which means the whole project was arrogant and idiotic from the beginning of its inception.

2:42 callen: it was, wasn't it?

2:42 callen: no it wasn't

2:43 it was something related to bbloom's patch

2:43 that I just worked around

2:43 and made the whole library like 3-4x faster

2:43 I'm going to go dance in my courtyard naked now, brb

2:43 amalloy: you are scary.

2:45 SegFaultAX: futile, ddellacosta: Can you two carry this on somewhere else?

2:45 futile: SegFaultAX: we are.

2:45 SegFaultAX: futile: Thanks.

2:46 ddellacosta: SegFaultAX: apologies.

2:47 callen: if this bears out in the full benchmarks this is going to be a real coup.

2:47 SegFaultAX: #clojure has almost, but not quite, as much drama as #python. And we're like, 1/20th the size.

2:47 callen: SegFaultAX: we need a dash.

2:47 futile: There's no drama except when I'm around.

2:47 Just have someone ban me, problem solved.

2:47 callen: actually, they'd need to ban me too.

2:48 ddellacosta: SegFaultAX: I actually try hard to keep drama out of my interactions, so I do sincerely apologize.

2:48 callen: but I make really good chicken pot pies, so they let me stick around.

2:48 futile: ddellacosta: stop being so dramatic

2:48 callen: guys,

2:48 jesus, I'm laughing so hard at you right now. Just chill. :)

2:48 futile: callen: stop talking about yourself

2:48 callen: so lesson of the day is, destructuring is evil, .isArray is evil, all reflection is evil, assoc-in is evil.

2:49 and don't fucking use definterface.

2:49 s/lesson/lessons/g I guess.

2:49 ddellacosta: EEVIILLL

2:49 * ddellacosta envisions callen cackling wildly

2:52 callen: hrm.

2:52 well. nuts.

2:53 normal'ish benchmark is 4x faster

2:53 weirdo benchmark suite is 10x slower.

3:02 ddellacosta: well then back to clojure

3:03 callen: ddellacosta: trying to write optimized versions of core functions. I am quickly going mad :P

3:04 ddellacosta: callen: wow. Sorry, I was half-following along…you are working on, what, assoc-in?

3:04 callen: yeah sorta.

3:04 ddellacosta: callen: mind running it by me again?

3:04 callen: ddellacosta: https://github.com/yogthos/Selmer/blob/master/src/selmer/parser.clj#L65

3:05 the assoc-in is sucking up a bunch of time.

3:05 ddellacosta: hmm,

3:05 callen: mostly nth/nthFrom/.isArray()

3:05 ddellacosta: huh

3:05 callen: yeah, I know. I had the same reaction.

3:06 so I'm trying to write a reflection-less version of assoc-in.

3:06 * ddellacosta goes to look at assoc-in source

3:07 callen: the problem, if I understand correctly, is the [k & ks]

3:08 ddellacosta: huh, so, I actually haven't seen that destructuring syntax before, neat

3:08 callen: but, it's slow?

3:08 callen: ddellacosta: hellaciously.

3:08 ddellacosta: callen: so, dumb question, what about a super-stupid version that just tests if (seq k) or something, without the destructuring?

3:09 callen: uhm, that's sorta what my version does

3:09 and my version *seems* to be faster.

3:09 ddellacosta: gotcha.

3:09 callen: in one benchmark my version makes the *entire library* 4x faster

3:09 yet in another, it's 10x slower.

3:09 ddellacosta: !?

3:09 clojurebot: CLABANGO!

3:09 ddellacosta: hahaha I loves you clojurebot

3:09 callen: actually, that's the library this will replace...

3:10 no seriously, it's a replace for Clabango.

3:10 I'm going to have to think carefully about the benchmark design.

3:10 ddellacosta: ha, really? that's funny in any case

3:10 callen: ddellacosta: https://gist.github.com/bitemyapp/6068547

3:10 ddellacosta: Good help on that one

3:10 callen: ddellacosta: it's horrendous.

3:11 I feel bad for having written it.

3:11 but it (seems?) faster.

3:12 ddellacosta: huh, trying to figure out how you'd get rid of that let/if thing without breaking it

3:13 callen: yeah, it's consistently slower with huge inner loops.

3:13 frick.

3:13 ddellacosta: you mean compared to the standard version?

3:14 well, I'm sorry, I'm not going to be a lot of help on this one. :-(

3:15 callen: ddellacosta: it's fine

3:15 ddellacosta: uhm, no it's scoped to the library, not between assoc-in and assoc-in*.

3:15 ddellacosta: I'm not micro-benchmarking them directly.

3:15 ddellacosta: callen: ah, okay

3:15 callen: maybe I should?

3:17 ddellacosta: callen: I suppose it depends on your goals. I guess I can imagine it having pretty different behavior when run recursive like in the first if clause, where your if/let combo may have a performance penalty different from the restructuring…but that's all just speculation

3:23 tsdh: Is there something to keep a dynamic binding intact when realizing a lazy seq other than wrapping the computation with a doall?

3:24 E.g., I don't want to realize everything with (binding [*foo* true] (doall (my-lazy-seq))), but instead it should be realized lazily but still with *foo* bound to true.

3:26 hyPiRion: not using a dynamic var should solve the problem there. Otherwise you'd have to make a lazy-seq which takes a snapshot of the bindings it uses and rebinds them during realization, which isn't exactly pretty.

3:45 anildigital: I don't get what is the issue with this factorial function

3:45 https://gist.github.com/anonymous/8ef81eaad0b22f3a8429

3:45 it doesn't work for factorial(2) and ..

3:45 SegFaultAX: anildigital: It isn't valid.

3:46 anildigital: SegFaultAX: what's the error there

3:46 tomjack: anildigital: http://tomjack.co/image/54583598271

3:46 SegFaultAX: anildigital: You've mixed fun() style calling with prefix notation.

3:46 hyPiRion: anildigital: (factorial (- n 1)) instead of factorial((- n 1))

3:47 anildigital: tomjack, SegFaultAX thanks

3:48 SegFaultAX: anildigital: You'll get used to it. Then you'll wish every language used prefix notation. :)

3:48 I regularly start out writing Clojure in my Ruby/Python code. I'll get a few lines in before I realize the syntax highlighter isn't just being finicky. :)

3:49 djcoin: I know clojure (well the jvm) can't return multiple arg from a function, and that you can circumvent this by return a vector an destructuring it

3:50 What is the cost of doing that (which low level operations are performed ?) and what would be the most efficient destructuring structure that you could use (like some basic tuple) ?

3:50 Thanks :)

3:50 anildigital: https://gist.github.com/anonymous/95456e1cc9c390877a52 doesnt compute (factorial 100003N)

3:51 SegFaultAX: anildigital: 2 things: 1) Deep stack is deep, 2) auto-promoting multiplication using *'

3:52 anildigital: SegFaultAX: no simple solution?

3:52 SegFaultAX: djcoin: Depends on the nature of the destructuring. It's very common to see (let [[a b c] (fn-that-returns-2-values)] ...)

3:53 anildigital: Clojure has a recur macro that makes explicit tail calls possible.

3:56 djcoin: Well, I was just being curious about how you could mimic the classic tuple-destructuring you may find in other languages. I was wondering if there was an even more basic datastructure than the vector, if your only goal is to destructure it

3:57 SegFaultAX: djcoin: The let form above is a destructuring form that is similar to simple list destructuring (or multiple assignment) in other languages, except it's more general and more powerful.

3:57 djcoin: What other languages are you used to?

3:59 djcoin: SegFaultAX: don't know, ocaml, python, etc. ? Disclaimer: i'm fairly new to clojure

4:01 SegFaultAX: djcoin: Ocaml supports patterns matching and destructuing which Clojure has (check out core.match for pattern matching in clojure)

4:01 djcoin: Python doesn't really have general purpose destructuring. Its multiple assignment form can pull apart lists and tuples, but that's about it.

4:07 djcoin: SegFaultAX: and in your (fn-that-returns-2-values), you need to return a datastructure, what would be the most efficient if you only wish to destruct it in a tuple-destructuring way ?

4:07 A vector ?

4:08 SegFaultAX: djcoin: What do you mean a tuple-destructuring way?

4:08 morphling: djcoin: probably a java object array

4:08 SegFaultAX: djcoin: Note that Clojure doesn't have a tuple data type.

4:11 djcoin: alright, wouldn't a completely immutable (I don't mean functional datastructure) and destructuring tuple be a good fit for this ?

4:12 SegFaultAX: djcoin: All of Clojure's built in datastructures are fully immutable, so yes.

4:13 djcoin: Vectors are common where you might otherwise be using tuples.

4:15 djcoin: Yup, but my question was WHY are we not using the simplest datastructure for this, some "tuple". But it does not matter, thanks SegFaultAX :)

4:17 morphling: djcoin: there is no tuple in the JVM

4:17 SegFaultAX: djcoin: Your question is nonsense. How is a tuple /more/ simple than an immutable vector?

4:18 hyPiRion: SegFaultAX: because tuples aren't persistent?

4:20 SegFaultAX: hyPiRion: Huh?

4:21 djcoin: Thanks hyPiRion =) Even if this is about nitpicking, just wanted to understand this

4:22 SegFaultAX: Except that's an implementation detail and has nothing to do with tuples in particular. So, no.

4:22 amalloy: SegFaultAX: i think hyPiRion's point is that it's wasteful (in theory) to use vectors as a tuple type, because they have to waste space and time on structural sharing

4:23 djcoin: Yeah, that's my point

4:23 SegFaultAX: Implementation details. There is nothing inherently /more/ simple about them.

4:24 djcoin: morphling: could not you create some "tuple" type with a simple class taking up to ten args and implenting the destructuration thing ?

4:25 hyPiRion: SegFaultAX: Simple as in "not compound", right?

4:25 SegFaultAX: hyPiRion: The issue isn't persistence. It's structural sharing (which are orthogonal at an implementation level)

4:25 You could have a vector implementation that was COW and still persistent.

4:31 hyPiRion: SegFaultAX: Right, whether it's structural sharing or persistence we call it, the question is still there: Is "not compound" the definition we go by?

4:33 yati: Hi. I'm starting out with Clojure. Where does lein keep the clojure jar? Also, from within emacs, spawning nrepl-jack-in magically uses some Clojure implementation. Where do these tools keep their stuff?

4:34 SegFaultAX: yati: ls -laF inside your project root after running lein deps.

4:34 hyPiRion: The thing is, a tuple is a constant-sized "vector", you can't conjoin to the end, you can't use it as a stack, you can only create a tuple and get an element at a position in a tuple.

4:35 SegFaultAX: hyPiRion: You could create a function that takes an n-tuple and a value, and returns an n+1-tuple, though.

4:35 hyPiRion: yati: Leiningen keeps them in a .m2 (maven) directory, which it'll place in your local home directory

4:36 tomjack: SegFaultAX: how could you have COW and persistence?

4:36 yati: SegFaultAX, that does not show anything interesting: http://paste.lisp.org/display/138177

4:37 Ah

4:37 hyPiRion: SegFaultAX: sure, but that's not a polymorphic function on the tuple itself. That's what I meant. I think we're way too nitpicky about it though, I should probably go back t owork

4:37 yati: ~/.m2 it is

4:37 clojurebot: No entiendo

4:37 SegFaultAX: tomjack: Persistence just means that previous version remain available for read/write. There is no requirement that it also uses structural sharing.

4:37 hyPiRion: (Or at least I am)

4:38 tomjack: oh, hmm

4:38 I guess rich's definition requires you to get up to a log32 multiplier away from what you'd expect from a non-persistent data structure :)

4:38 down to

4:39 I don't understand how to live with only guava and no clojure collections :O

4:43 SegFaultAX: hyPiRion: Haha. I understand the point you're trying to make. But from a practical standpoint, I don't think it makes that much of a difference.

4:43 And since we don't have tuples in Clojure [by default] anyway, then it's an entirely moot point.

4:43 (inc hyPiRion)

4:43 lazybot: ⇒ 16

4:44 djcoin: hm

4:46 hyPiRion: SegFaultAX: yeah, it's kind of a useless discussion :p

4:46 oh, I wondered if Raynes has fixed that bug yet

4:46 (inc HYPIRION)

4:46 lazybot: ⇒ 17

4:46 hyPiRion: lol, oh well.

4:46 llasram: hiredman made a go at creating tuples for Clojure at one point: https://github.com/hiredman/tuples

4:47 Raynes: hyPiRion: Alan fixed it.

4:47 djcoin: Why would not having tuple by default prevent make it irrelevant

4:47 s/prevent//

4:47 hyPiRion: Raynes: yeah, but it's not deployed

4:47 you need to restart lazybot or something

4:48 djcoin: "Elapsed time: 7870.339 msecs" vs "Elapsed time: 130419.589 msecs" - not bad!

4:48 almost half

4:49 llasram: Yeah, but that's just for access, and IIRC I couldn't replicate anything like that difference under criterium

4:49 Raynes: hyPiRion: I don't know what you're talking about.

4:49 (inc HYPERION)

4:49 llasram: djcoin: When I included construction time under benchmarking, they provided no statistically significant benefit over vectors

4:49 lazybot: ⇒ 1

4:49 Raynes: It works fine, hyPiRion.

4:49 hyPiRion: (inc HYPIRION)

4:50 lazybot: ⇒ 18

4:50 hyPiRion: :(

4:50 total702: hi

4:50 hyPiRion: Raynes: oh right

4:50 djcoin: llasram: oh, alright :d

4:50 hyPiRion: nevermind

4:50 Raynes: hyPiRion: ?

4:51 hyPiRion: Raynes: I am trying to make it look like it works fine.

4:51 Raynes: (inc HYPIRION) ; Honestly sir, I think you're seeing things.

4:51 lazybot: ⇒ 19

4:51 llasram: jdoliner: (where for future reference, criterium is https://github.com/hugoduncan/criterium )

4:51 total702: can I make a web app with clojure?

4:51 Raynes: hyPiRion: Try again.

4:51 llasram: er, that was supposed to be ^^ djcoin

4:52 hyPiRion: (inc HYPIRION)

4:52 lazybot: You can't adjust your own karma.

4:52 hyPiRion: wehee

4:52 (identity hyPiRion)

4:52 lazybot: hyPiRion has karma 19.

4:52 Raynes: I was messing with you. Trying to keep you occupied while I restarted the bot and made you think you were crazy.

4:52 Unfortunately after I did that I forgot to actually pull before restarting.

4:52 hyPiRion: yeah, I figured

4:53 Raynes: So plan foiled.

4:53 hyPiRion: no matter, works fine now

4:53 llasram: total702: Yes

6:27 ddellacosta: huh, jdbc insert! returns the record that was inserted? I thought it was going to return the ID...

6:34 patrkris: would anyone happen to know, how I can "stream" responses with compojure/ring? that is, I want to serve a response that prints a string, then waits a while and prints another string

6:37 Somelauw: When using lein repl, the "home" key does not work. ctrl+a does work, but I'm already using that key for tmux.

6:47 ro_st: is there some nifty way to invoke a function in a running jvm process from the cli?

6:48 instead of restarting my datomic peer jvms, i instead want to tell them to dispose of their datomic connections. the idea is to get a much quicker turnaround time when restoring production datomic databases on our testing servers

6:48 this is not for use on production servers.

6:49 i guess i could expose something on the web and curl in

6:55 noncom: is there a best practize to realize interfaces in clojure? like i want to have a namespace with known functions that i call, but the namespace itself can be configured to bind different execution code to the functions, like if a want to have a common interface to multiple DB drivers... how do you usually go about that/

6:57 ro_st: sounds like a job for defprotocol :-)

6:58 noncom: ro_st: oh, a good point!

6:58 forgot about them...

6:58 ro_st: i'm envious. this is a great learning opportunity for you

6:58 we've not yet had a need for this.

6:59 noncom: what is strange, i almost do not use protocols or multimethods, i just use very basic clojure...

6:59 so far it suffuced :)

6:59 s/suffuced/sufficed

7:00 ro_st: that's exactly why we haven't used it yet. haven't needed to :-)

7:00 just a matter of time, though.

7:00 noncom: yeah, and scale. the current project is of a bigger scale than i ever did, esp with clojure

7:03 ro_st: noncom: there's a nice use of protocols in the Pedestal tutorial when dealing with real and mock services

7:04 https://github.com/pedestal/app-tutorial/wiki/Simulating-Service-Push#simulated-service-input and https://github.com/pedestal/app-tutorial/wiki/Connecting-to-the-Service#implementing-the-connection-to-the-service

7:07 noncom: ro_st: nice! i will have a look!

7:07 jonasen: Has anyone built a clojurescript pretty printer yet?

7:08 ro_st: jonasen: does pprint not work?

7:09 jonasen: ro_st: not ported to clojurescript AFAICT

7:09 Guest__: hello i have a question. what exactly happens in this case?

7:09 ,(select-keys [1 2 3 4 5] [1])

7:09 clojurebot: {1 2}

7:10 noncom: jonasen: i think that since cljs generates js, pretty-print is only possible for uncompiled cljs code ... ?

7:10 Guest__: when i look at the documentation i see it can only be used on maps. thanks.

7:10 noncom: ,(select-keys [1 2 3 4 5 6] [1 2])

7:10 clojurebot: {2 3, 1 2}

7:10 noncom: Guest__: so it first conerts the vector to map

7:10 jonasen: noncom: I don't see why that would be the case

7:10 noncom: jonasen: well, idk then

7:11 Guest__: (into {} [1 2 3 4 5 6])

7:11 ,(into {} [1 2 3 4 5 6])

7:11 clojurebot: #<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>

7:11 ro_st: what happens when you try pprint in cljs?

7:11 noncom: (into {} (partition 2 [1 2 3 4 5 6]))

7:11 ,(into {} (partition 2 [1 2 3 4 5 6]))

7:11 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.Map$Entry>

7:12 jonasen: I wonder how much work it would be to port brandonbloom/fipp to clojurescript

7:12 bbloom_: ^

7:12 noncom: ,(into {} (mapv #(into [] %) (partition 2 [1 2 3 4 5 6])))

7:12 clojurebot: {1 2, 3 4, 5 6}

7:12 noncom: hmmm..

7:13 ,(select-keys [1 2 3 4 5 6] [1 2 3 4])

7:13 clojurebot: {4 5, 3 4, 2 3, 1 2}

7:14 noncom: oh, so it takes the element with index N and creates a pair {N element-N} and then makes a map of the pairs

7:14 ,(select-keys [1 2 3 4 5 6] [0 1 2 3 4 5])

7:14 clojurebot: {5 6, 4 5, 3 4, 2 3, 1 2, ...}

7:16 noncom: technomancy: is all work in leiningen with file system done through clojure.java.io? i want to change filesystem-related behavior a little for my project.. that's why im asking

7:20 so far, as i look into sources, i see it is, but just to confirm that...

8:28 Somelauw: When using lein repl, the "home" key does not work. ctrl+a does work, but I'm already using that key for tmux.

8:29 Also, trying emacs. I remember from previous time that I need clojure-jack-in, but I don't know what happened to that package.

8:29 noncom: you mean repl-jack-in?

8:30 emacs live has it in the package

8:30 (for example)

8:31 my knowledge on emacs reaches its limit at this point

8:32 Somelauw: noncom: eh, yeah, whatever it's called. Just that I can ctrl-c, ctrl-c a paragraph of code

8:35 It used to be called clojure-jack-in

8:37 maio: nrepl-jack-in in nrepl.el

8:39 Somelauw: maio: nope, doesn't work

8:40 maio: do you have nrepl package installed?

8:41 Somelauw: http://clojure-doc.org/articles/tutorials/emacs.html

8:48 Somelauw: maio: thanks

8:52 jvc: http://vimeo.com/22798433

8:52 emacs-live

9:01 instilled: hey! does anyone have a working ritz-nrepl on osx? i can not seem to get things working here. I always get the VMStartException when running 'lein ritz-nrepl'. Any help is greatly appreciated

9:32 futile: What do you guys think of forcing assertions to be in tail-position in a test?

9:33 djcoin: Is there any map librairy à la googlemap/leaflet etc. in clojurescript ?

9:33 marianoguerra: hi, I'm about to publish a new lib to clojars that depends on google jars that are not published anywhere, I install them locally with lein localrepo, how is the best strategy to publish it? as a jar or as a standalone jar?

9:36 faust45: hi guys

9:36 which tool i can using for deployment on AWS ?

9:37 futile: faust45: we use boucher

9:37 https://github.com/8thlight/boucher

9:38 faust45: futile: its ruby gem, is it work well with clojure apps ?

9:39 jkkramer: marianoguerra: you could put the google libs on clojars, under your group id

9:39 gfredericks: $mail rishda I don't remember suggesting anything like that

9:39 lazybot: Message saved.

9:40 jkkramer: marianoguerra: i've done that for a couple java libs before that weren't on maven

9:40 futile: faust45: we use it to deploy a Clojure app

9:40 faust45: can't say I have the faintest idea how to set it up though. But I didn't have to, it was set up when I got here, and now it Just Works™

9:40 gfredericks: oh it was probably tsomething

9:40 marianoguerra: jkkramer: I don't want google knocking on my door :)

9:41 I guess if they are not there is for a reason

9:41 jkkramer: marianoguerra: if they're open source, it think it's ok (IANAL)

9:42 futile: gfredericks: oh sorry I think it was tbaldridge

9:48 tolitius: yesterday was looking for a way to back pressure on task submit with executor service whenever the queue capacity is reached.. not built in, so https://github.com/tolitius/lasync in case someone else needs it.

9:48 futile: gfredericks: also rishda was me, sorry for the confusion

10:32 dnolen: jonasen: fresh cljs + tests seems to work for me.

10:37 jonasen: dnolen: weird. I'll have to try again (later)

10:57 gfredericks: futile: np

11:12 futile: Figured out a way to do flexible fixtures with a flat test suite (i.e. no grouping/nesting)!

11:12 https://github.com/evanescence/verily/issues/1

11:13 That only works for around-each though. I'm not sure around-all is necessary, is it?

11:13 I suppose the same principle can be used for around-all.

11:23 `cbp: yogthos: hi

11:25 bbloom_: $mail jonasen Fipp would be pretty easy to port to CLJS, since it's pretty much pure clj. Somebody needs to port finger tress first

11:25 lazybot: Message saved.

11:25 futile: $mail bbloom_ hi.

11:25 lazybot: Message saved.

11:25 bbloom_: futile: hi

11:26 futile: bbloom_: how did you know? you didn't check your messages...

11:26 bbloom_: lol

11:26 futile: Is there any legitimate use for around-all? It seems to just complicate things badly. https://github.com/evanescence/verily/issues/1

11:26 bbloom_: oh, i didn't realize that's how it works

11:26 sooo that guy will never see that message, huh?

11:26 $mail

11:26 futile: bbloom_: happens to the best of us

11:26 bbloom_: boo.

11:26 i was hoping it was on channel join

11:27 futile: bbloom_: it does.

11:27 bbloom_: but you didn't part and rejoin.

11:27 bbloom_: ah, ok. well then that guy will get it when he shows up

11:31 egghead: async testing in cljs D:

11:34 arrdem: is there a reasonable Clojure assembler DSL already?

11:34 egghead: arrdem: something like https://github.com/halgari/mjolnir ?

11:36 arrdem: egghead: eh, mjolnir is higher level than I'd like, but I really do need to sit down and get a handle on it.

11:47 faust45: is it possible some how change folder and reload namespaces ?

11:48 i want deploy with capistrano

11:48 and fast reload

11:48 technomancy: faust45: that's not going to work

11:48 faust45: capistrano create new folders for each release

11:49 technomancy: but which way you can suggest ?

11:49 technomancy: deploying your whole source directory for clojure apps is a pretty bad idea

11:49 chuck an uberjar out there

11:49 arrdem: technomancy: really? that's now the compojure stuff I've seen works... how do you hot reload an uberjar?

11:49 technomancy: ideally an uberjar built in a neutral environment like a CI server

11:50 faust45: technomancy: but is it possible fast restart using uberjar ?

11:50 technomancy: arrdem: you can't hot-reload in the general case anyway; it only works if you don't change any of your java dependencies and don't use defrecord/protocols, etc

11:51 faust45: bring up the new version on another port and redirect traffic at your load balancer

11:51 arrdem: technomancy: ah right. til.

11:51 futile: What do you guys think of the names "verify" and "verity" instead of "verily" for a testing lib?

11:52 ChongLi: too similar

11:52 arrdem: futile: unless you do theorem proving don't use verify.

11:52 futile: arrdem: good point

11:52 ChongLi: that's the fun of it though

11:52 TimMc: Call it "guardrails".

11:52 faust45: technomancy: ok thanks

11:52 ChongLi: haha

11:52 futile: I think "verity" is the correct-est. It's about documenting the "truth" of your application.

11:53 ChongLi: I thought static types were guard rails?

11:53 TimMc: There's some video where rhickey says that relying on TDD for correctness is like steering by bouncing off of guardrails.

11:54 arrdem: ChongLi: they are guard rails, but they can prove out entire classes of errors.

11:54 ChongLi: perhaps my memory is fuzzy, but I thought he said that exact thing about static types

11:54 TimMc: (This made some people mad, but his point about *relying* is a good one.)

11:54 xeqi: I like my guard rails

11:54 arrdem: guard rails are better than no rails...

11:54 jagaj: people get 'mad' over that?

11:54 futile: I'm not a fan of the dogmatic approach to TDD. I've found that when applied religiously, it just creates bad tests that do more harm than good.

11:55 But this lib isn't about TDD, it's just about writing tests.

11:55 TimMc: jagaj: TDD fans who were looking for a fight did.

11:55 jagaj: that's insane :|

11:55 ChongLi: some people get mad whenever they hear an opinion that conflicts with their own

11:55 futile: And those tests really just tell you what's true about your program.

11:55 arrdem: proof by being bloody obvious backed by a type system and some tests is my approach :D

11:55 technomancy: jagaj: he was intentionally needling people

11:55 TimMc: jagaj: And people conveniently forgot the "relying on" bit.

11:55 Or it hit too close to home. :-P

11:56 So I'd support the name "guardrails", because it's both funny and a good reminder that tests are just one part of a complete breakfast.^Wquality assurance process.

11:57 arrdem: futile: gh link? I'm curious now.

11:57 futile: arrdem: https://github.com/evanescence/verily

11:58 arrdem: futile: and the use case over core.test is...

11:59 technomancy: arrdem: clojure.test is abandoned

11:59 TimMc: and not composable

11:59 arrdem: that's a good reason!

11:59 s/reason/use case/g

12:17 TimMc: Fuck, I'm practically tearing up over here.

12:17 A friend's rather larger-than-life cat just died.

12:20 http://abbie.blogspot.com/

12:24 h0bbit: as a fellow cat-lover, my condolences.

12:33 TimMc: (Bah, just realized I posted in the wrong channel. Ah well.)

12:35 futile: TimMc: I can't see how this or any channel is the wrong channel for it.

12:36 TimMc: Well, the one I meant to post in is more geographically focused; Abbie was kind of a local celebrity.

12:39 futile: Okay. Renamed project to verity. Changed from a side-effecty way of making assertions to a functional way. Next stop is to add around-each fixtures.

12:42 technomancy: http://tardis.wikia.com/wiki/Verity_Lambert

12:43 futile: technomancy: ah! you figured out who I named the project after! well done.

12:43 technomancy: heh

12:43 futile: Kinda sucks that verity is also a popular name.

12:45 bbloom_: technomancy: so worth on the street is you're the new sherif around these parts

12:46 futile: Oh I know. I'll pull a technomancy and name it Deathwater.

12:47 jkkramer: futile: there's also already a clojure lib named verily ;) https://github.com/jkk/verily

12:48 futile: jkkramer: yep, see my mailing list apology to you from last night

12:48 jkkramer: and verity is admittedly too similar to verily

12:48 jkkramer: ah, haven't checked the ML today

12:48 meh

12:48 verity seems fine

12:50 futile: No, too many problems.

12:51 Well the name will have to wait then.

12:52 I don't like any name so far.

12:52 egghead: yay I finally got lein cljsbuild test to run jasmine specs :)

12:53 technomancy: bbloom_: looks like it. you better behave. =)

12:53 * bbloom_ stands up straight

12:55 dnolen: pretty sweet Carin Meier at OSCON talking robots & Clojure http://www.oscon.com/oscon2013/public/content/video

13:10 arrdem: What would the "right" way be to structure a single api which could dispatch between several backend implementations? Define the implementations in terms of a map from keys to fns and then define the api to be retreval and application of functions from an argument api structure?

13:15 llasram: arrdem: What determines which backing implementation gets invoke?

13:16 futile: I'm wondering when the day will be that someone makes a Leiningen competitor.

13:16 Every tool has at least one competitor, no exceptions.

13:16 llasram: It's called maven

13:16 futile: Maven isn't Clojure-specific though.

13:16 llasram: Was meant to me a joke

13:16 futile: oh

13:16 llasram: There used to be cake, but it got merged-precated

13:16 futile: oh

13:17 llasram: Leiningen is just too awesome to compete with

13:17 technomancy: https://bitbucket.org/clojuresque/clojuresque <- actually predates lein

13:17 I think

13:17 futile: llasram: I agree, but I'm betting someone's eventually gonna create an rbenv to leiningen's rvm.

13:17 arrdem: llasram: clients will choose an imp'l explicitly, arguably as a top of ns item even.

13:18 futile: not that I think leiningen is like rvm in terms of badness, just in size.

13:18 technomancy: huh, initial commit predates lein by a just a couple weeks

13:19 llasram: futile: I'm skeptical, just because there isn't any friction to making leiningen do what you want to do.

13:19 futile: true

13:20 anyway not worth giving too much thought to

13:20 dobry-den: also, clojure community is just so small.

13:20 llasram: arrdem: But without explicitly requiring separate namespaces for the separate implementations?

13:21 futile: dobry-den: are we really?

13:21 People say that, but I don't believe we're really much smaller than Python or Ruby communities were just 5 years ago.

13:22 arrdem: llasram: so I'm trying to provide an "abstract assembler" dsl that can target dcpu16/x86/arm. most of the code (byte alignment and such) is the same and can be shared, but instruction encoding is arch specific so I need some way to express those differences while preserving as much of an API as possible across targets.

13:23 dobry-den: futile: yeah, i mean less saturated

13:24 * futile googles what saturated means in terms of communities

13:24 llasram: arrdem: Oh, interesting. What about just having your DSL expand into an IL data form? Then your backends just be functions you pass the IL data to

13:24 No magic backend-selection necessary

13:24 arrdem: IL?

13:25 llasram: Intermediate language

13:25 arrdem: Intermediate Language?

13:25 llasram: :-)

13:25 arrdem: :P

13:26 I guess I'm just struggling with what abstraction level to provide... because on the one hand I can write "assemblers" which will take 2/3 argument vector ops and build em to a byte seq. That isn't hard.

13:26 and at that level you (being a user) know what you are targeting and code is likely to be arch specific.

13:27 dobry-den: futile: i guess a key difference between looking at ruby gem coverage vs clojure solutions is that we can trivially bring in any java library. so introducing a clojure solution is either writing a clojure wrapper or writing a possibly superfluous clojure implementation

13:27 arrdem: so really a (require '[cljasm.x86 :refer assemble]) should be all that is needed there

13:27 futile: hmm

13:27 yeah

13:29 llasram: arrdem: That seems sane. The one assembler I've written I used Antlr to parse a "traditional" assembler syntax into an AST, but I've thought that if I did it again, I'd have the assembler input be Clojure programs which macro-expanded into the AST

13:29 Either way, get an AST or IL and give to your `assemble` function

13:29 dobry-den: futile: dunno what my point is or how it relates to lein tho

13:29 futile: :)

13:30 dobry-den: all I know is, I'm glad the Clojure community doesn't follow the Ruby's community's pattern of naming things after rough analogies, and sticking to those analogies like there's no tomorrow

13:31 dobry-den: i learned ruby and rubyonrails by sitting in those channels attempting to answer newbie questions (googling for them). yet i'm often comically lost in the discourse that happens on this channel.

13:31 callen: dobry-den: need deeper knowledge. That said, it's not out of the question to learn some Clojure that way.

13:32 arrdem: llasram: thanks for the advice.

13:32 callen: dobry-den: I answer peoples' questions in here through mere googling far more often than you might suspect.

13:32 arrdem: llasram: having an IL even simplifies the compiler I'm building atop this! yay!

13:32 llasram: glad to help :-)

13:33 futile: dobry-den: hmm. most of what I see in this channel is about core.async and core.match, and other similar stuff, and it makes me feel like im in #haskell

13:33 dobry-den: is that what you're talking about?

13:34 * technomancy wishes there were more about core.match =)

13:34 technomancy: has there actually been a release that fixes the AOT bustedness?

13:34 llasram: core.match's exception-based flow control is quite interesting

13:35 (not in the core.match code -- in the macroexpansions)

13:36 technomancy: It's still in RC

13:36 dobry-den: the biggest difference between clojure and ruby/python/node/framework circles i consume is that the average developer experience-level is significantly higher than those, understandably. i think clojure's most enticing features are things that i certainly couldn't appreciate until i had 3 years of ruby experience

13:37 futile: yeah. some of the things I love most about Clojure, I wouldn't appreciate unless I was tortured by Ruby first.

13:37 technomancy: llasram: gotcha

13:37 futile: I guess what I love about Clojure is its anti-features.

13:37 And it's hard to appreciate something that's not there until you've seen why it's painful for it to be there.

13:37 dobry-den: futile: not to mention those features are also obstacles for newbies. i love sexpressions now and paredit makes me edit clojure faster than i can edit ruby. yet i started ruby in notepad.exe

13:38 futile: oh yeah, thats true.

13:38 I was debating to teach my brother Ruby or Clojure, and I went with Ruby, partially because the syntax.

13:38 llasram: technomancy: But at least moving again! Once there's a 0.2.0 I won't look embarrassed my Scala-using friends mention pattern-matching

13:38 arrdem: ,(doc mapcat0

13:38 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

13:38 arrdem: ,(doc mapcat)

13:38 clojurebot: "([f & colls]); Returns the result of applying concat to the result of applying map to f and colls. Thus function f should return a collection."

13:38 technomancy: llasram: encouraging, yeah

13:38 futile: Granted, I had to explain to him several (several) times that << is not similar to =, it's just that Matz is weird.

13:39 technomancy: futile: did you consider racket?

13:39 dobry-den: futile: lighttable is what let me convert some of my python friends.

13:39 futile: technomancy: nope. I also chose Ruby because it's got lots of entry-level jobs now.

13:39 technomancy: a lot less newbie-hostile than clojure without throwing out the part about actually being thoughtfully-designed

13:40 futile: dobry-den: ah, hmm

13:40 technomancy: oh yeah, but if he's looking for work that's different

13:40 futile: Seriously though, why << ... sigh

13:40 dobry-den: like [] << 1?

13:40 futile: I had to write it array.<<(obj) for a while just to sink the point in that it's a method with a special name.

13:40 yes

13:41 He kept thinking it was some kind of assignment.

13:41 dobry-den: i could see if he's used to bitwise operators but ruby as my first language just made me think << meant "push"

13:41 futile: that's one of the places I think Clojure would probably have been easier

13:41 technomancy: futile: everyone gets pass-by-reference vs pass-by-value at first; it's such a headache

13:42 futile: Ah! "attest"!

13:42 that seems better than verity.

13:42 TimMc: "aver"

13:42 futile: technomancy: you mean, conflates them?

13:43 TimMc: oh man, oh man oh man

13:43 dnolen: good list of things to make faster in ClojureScript if anyone is interested http://wagjo.github.io/benchmark-cljs/ ;)

13:44 arrdem: god pass by reference had me confused for a solid three weeks when I was getting started :/

13:44 futile: TimMc: I tried to use technomancy's technique by recalling something from Narnia that involved a test. And I thought it would be easy since we just read all 7 books as a family this month. Plus Narnia is all about testing. But man is his technique tricky in practice!

13:45 arrdem: futile: do we have a library "sphynx" yet?

13:45 futile: clever!

13:45 arrdem: but I'd never be able to spell it right.

13:45 TimMc: I tend to use names from scientific nomenclature, e.g. "chelydra" for a bookmarking app.

13:46 s/scientific/biological/

13:46 futile: the last thing I named was Zephyros based on someone's suggestion to have to do with "wind", since it's a "window" manager that moves windows around (like wind)

13:46 arrdem: futile: I just thought it's cute because it implies questioning (tests) without any hint of proof.

13:46 futile: And Zephyros was some ancient mythical god having to do with wind.

13:46 arrdem: ha

13:47 hyPiRion: arrdem: if we're going to imply questioning you're better off with CIA or Police or something

13:47 * arrdem is open to suggestions for a better name than cljasm

13:47 arrdem: hyPiRion: I'm trying to decide whether I can manipulate my NSA threat score with this conversation.

13:48 ystael: the world totally needs public NSA threat leaderboards

13:48 TimMc: arrdem: For what kind of project?

13:48 arrdem: ystael: lol that'd be awesome

13:48 * TimMc sets up a cron job to request his own FBI file every 2 weeks

13:49 arrdem: TimMc: the naming thing or the nsa thing?

13:49 TimMc: naming

13:50 arrdem: the clojure assembly DSL llasram and I were talking about 50 lines back

13:51 ystael: arrdem: call it "lda clojure,x" :)

13:53 futile: I could name it "olive" after the test Penelope gave Odysseus. But that's a stupid name.

13:53 All names are stupid.

13:54 TimMc: "leiningen" is a damn good name

13:54 and I'm not just saying that because technomancy has op :-P

13:54 futile: yeah, technomancy's names are fine.

13:54 I don't like bultitude at all, but that's the only one that makes no sense.

13:54 technomancy: in my defense I was given no context for that one

13:54 just "I need a name, stat"

13:55 futile: ha

13:55 technomancy: futile: but you've read That Hideous Strength, right?

13:55 futile: technomancy: I've only read Alice in Wonderland (and Through the Looking Glass) and the Chronicles of Narnia.

13:55 Oh, and A Tree Grows in Brooklyn once, in college.

13:55 (for literature class)

13:56 Apparently I don't much care for grown-up stories, I guess.

13:57 Well, also the New Testament. I guess I could name it "neighbor", because "'and who is my neighbor?' he replied. This he said to test him."

13:58 arrdem: well tbaldridge already took mjolinr for his llvm toolkit so since he's the hammer I'll take the anvil. geirr it is.

13:58 jonasen: bbloom_: are you using finger-trees for fast concat? If that's the case it might be possible to use core.rrb-vector instead (already ported to cljs AFAIK)

13:58 ystael: futile: "ordeal" ?

13:58 technomancy: futile: That Hideous Strength is Lewis's best fiction IMO

13:58 futile: Traditional naming schemes are super boring and just as hard to find. This naming scheme is more fun, but still hard.

13:58 technomancy: oh. didn't know he wrote other stuff (besides astounding christian apologetics)

13:59 technomancy: futile: it's the third in a trilogy, but the first are more philosophical and less approachable

13:59 first two

13:59 futile: technomancy: do you bring it up because it contains a good testing lib name?

13:59 technomancy: futile: oh, no it's because Bultitude is from that book

13:59 futile: ooh

13:59 technomancy: but you should read it anyway

14:00 futile: i might now

14:02 technomancy: heh, nice.

14:02 hyPiRion: arrdem: what. You must use Gungnir for that

14:03 arrdem: hyPiRion: appologies. I guess my english->norse dictionary is a lying waste of dead trees.

14:04 futile: okay im torn between "aver" and "attest", leaning towards attest. can you guys choose for me?

14:04 i hate naming libs.

14:04 arrdem: hyPiRion: spear of odin? oh thor's hammer... cute!

14:04 futile: i always get it wrong.

14:05 bbloom_: jonasen: i'm using finger trees for left pop and right push/pop

14:05 jonasen: will rbb trees cover that?

14:05 arrdem: hyPiRion: I really want to go with toothpick so I can quote http://www.songworm.com/lyrics/songworm-parody/EternalFlame.html

14:06 futile: arrdem: i so would

14:06 thats perfect

14:06 ystael: futile: aver is IMO less preferable because more likely to appear as a subword of other words you want to use

14:06 hyPiRion: arrdem: hehe

14:06 futile: ystael: very good point

14:06 ystael: whereas 'fattest' rarely appears in programs

14:06 :)

14:06 futile: true but attest barely looks like a full word in itself

14:07 arrdem: ok two other people thought it was funny too. toothpick it is. the compiler will be Gungnir.

14:07 jonasen: bbloom_: I haven't tried it but I thing both subvec and concat is fast for rrb-vector. so that should cover it

14:07 *think

14:07 bbloom_: jonasen: i don't need subvec or concat

14:07 hyPiRion: \o/

14:07 MrRacoon: /win 6

14:08 jonasen: but if they are fast enough it's trivial to implement left/right push/pop ?

14:09 bbloom_: jonasen: maybe. i dunno. why don't you fork it and try to switch to rbb?

14:09 jonasen: the operations you need to grep for are: first, peek, conjl, and conjr

14:09 i'm curious what the perf is that way too

14:10 jonasen: i've already forked it :)

14:10 justin_smith: futile: the obvious new testament based name for a testing lib is Thomas

14:10 futile: hmm, guys what about "certainty" or "certitude"?

14:10 justin_smith: ha, he needed proof. heh.

14:10 bbloom_: jonasen: glorious. let me know how it goes :-)

14:11 futile: justin_smith: but I don't think it's appropriate to name a lib after something in the bible

14:11 oh!

14:11 Bacon.

14:11 that's it.

14:11 technomancy: bacon is a ruby testing lib

14:11 bbloom_: isn't bacon like unslow rspec?

14:11 justin_smith: pudding - the proof is in it

14:11 futile: http://en.wikipedia.org/wiki/Roger_Bacon

14:11 hyPiRion: France is Bacon.

14:11 futile: oh fff, did they use that name for the same reason?

14:12 technomancy: futile: also, read https://en.wikipedia.org/wiki/The_Name_of_the_Rose

14:12 justin_smith: crucible - it is where things are proven

14:12 technomancy: the protagonist is a disciple of Bacon

14:12 futile: justin_smith: (1) heh, (2) heh

14:13 stuartsierra: Here's a novel idea: name your library for what it does, with a domain-name-based groupId to avoid clashes.

14:13 justin_smith: just generate a uuid, and done

14:14 bbloom_: stuartsierra: bah. where's the fun in that? plus who likes all those extra src/org/whatever/folders?

14:14 futile: stuartsierra: so kinda like test2

14:14 hiredman: if people would just use uuids for function names we wouldn't need namespaces

14:14 justin_smith: seriously

14:14 stuartsierra: Bah, I give up. :P

14:14 futile: you gave up way easy

14:14 stuartsierra: I knew it was a hopeless goal. Just couldn't stop myself.

14:14 futile: but yeah, in all seriousness, this is both the most fun and the most hard part of writing a lib.

14:14 hiredman: bbloom_: group-id/artifact-id in maven is orthogonal to namespace names and file structure in clojure

14:15 futile: but either way, it cant be cheated.

14:15 bbloom_: hiredman: i'm aware, i was making a joke

14:15 TimMc: stuartsierra: I do both.

14:15 stuartsierra: org.timmc/chelydra (org/timmc/chelydra.clj)

14:15 stuartsierra: I'll tolerate lots/of/extra/directories if I get descriptive names that don't clash.

14:15 futile: Rusticus

14:16 thats the best one so far.

14:16 stuartsierra: TimMc: That still gives me no inkling what "chelydra" means.

14:16 TimMc: Who *doesn't* know that Chelydra is the snapping turtle genus?

14:16 Sheesh.

14:16 stuartsierra: :)

14:16 TimMc: And obviously snapping turtles hold onto things.

14:17 stuartsierra: Oh, so it's a memory leak generator?

14:17 * futile gives up

14:17 TimMc: Obviousl... no, a bookmarking thingy. :-{

14:17 stuartsierra: :)

14:17 hyPiRion: oh, no turtle graphics for me.

14:18 TimMc: I really do prefer mnemonic-style names, though -- it gives me freedom to adjust the scope of a project later while not being completely irrelevant.

14:18 ystael: TimMc: see, that makes me think that chelydra is "a good way to lose fingers"

14:18 not "a good way to keep bookmarks"

14:18 TimMc: "a friendly companion who will never leave you"

14:19 futile: maybe "empirical" if it werent so hard to spell

14:19 hyPiRion: TimMc: that's a good argument though. Imagine if Leiningen was named Clojure-Maven or Project-Manager

14:19 technomancy: my project names are chosen with the specific goal of getting people to read literature

14:19 futile: technomancy: that almost worked for me.

14:19 hyPiRion: Now it's not obvious that leiningen would be bundled with a repl, for instance.

14:19 mavbozo: leiningen vs the ants <= brilliant and cultured

14:19 futile: technomancy: i read your *whole* section about Leiningen in your readme

14:20 but then i stopped caring.

14:20 oh no wait, that's not true!

14:20 i read the wikipedia about Leiningen and the Ants.

14:20 and got the plot summary and was satisfied.

14:20 technomancy: so it kinda worked

14:20 technomancy: futile: it's public domain even; no excuses

14:20 TimMc: I totally went and read it.

14:20 Fun story.

14:20 technomancy: well, maybe only in Canada and NZ

14:20 futile: technomancy: grown-up stories just seem not worth the time

14:21 oh wait.. one more idea up my sleeve

14:21 TimMc: futile: I think you're about to get assigned a reading list.

14:21 mavbozo: technomancy: technology + necromancy?

14:21 technomancy: mavbozo: -mancy is a general suffix

14:21 futile: mavbozo: i thought so, but i looked up technomancy in the dictionary and its a legit word.

14:21 wait, did i? i cant find it now. maybe i imagined it.

14:21 technomancy: originally a play off neuromancer

14:22 (which if you haven't read please don't tell me and we can still be friends)

14:22 futile: rosebud!

14:22 jk

14:23 ok i was thinking of something from LotR, but i havent actually read any of it. so that wont work.

14:23 this is roughly around the point where i would just name the library "ihatenamingthings" and just be done with it

14:24 TimMc: futile: Just use gfredericks' approach.

14:24 mavbozo: reminds me of gell-mann vs feynman

14:24 TimMc: &(format "lib-%04d" (rand-int 1e4))

14:24 lazybot: ⇒ "lib-2858"

14:24 mavbozo: gell-man : quark <= from literature

14:24 feynman : parton <= completely made up

14:25 ystael: TimMc: "i am not a number! i am free software!"

14:28 daydreamt: Is there any way to unzip files in clojure that doesn't involve writing java?

14:28 I mean, library. I'm searching for a library.

14:30 tolitius: daydreamt: http://stackoverflow.com/a/10188601/211277

14:31 daydreamt: Yes, I saw that. It triggered my java allergy. I was trying to avoid it if possible.

14:31 tolitius: it's just one tiny import..

14:32 amalloy: that's not even writing java

14:32 ThatOneGuy: time to write a clojure wrapper around ZipInputStream :P

14:32 amalloy: you'll know you're writing java when you have semicolons everywhere

14:32 $google raynes fs compress

14:32 lazybot: [fs.compression documentation] http://raynes.github.io/fs/fs.compression.html

14:32 tolitius: you can wrap it yourself and release a library if you want.. 5 mins?

14:33 gfredericks: people say pmap be slow/bad -- why should I expect that a j.u.c thread pool feeding into a j.u.c queue would be significantly faster/better?

14:33 (or is that not the correct way to achieve faster/better?)

14:34 amalloy: gfredericks: mostly because pmap tempts you to give each thread trivially small tasks; giving those same tasks to different threads won't help

14:34 daydreamt: thanks amalloy, this is what I was looking for.

14:34 technomancy: gfredericks: it will definitely be better if your work units vary widely in the amount of time they take to process

14:34 hiredman: gfredericks: using an executor directly gives you much better control

14:34 amalloy: true

14:34 gfredericks: so the overhead for pmap is worse? or just harder to control as hiredman says?

14:35 hiredman: pmap isn't slow/bad it just abstracts away way too much

14:35 so it ends up being slow/bad unless you use it in a way that exactly fits it

14:35 gfredericks: got it

14:35 thanks technomancy amalloy hiredman

14:36 hiredman: and pmap's whole intended consequence interaction with chunked seqs

14:36 unintended

14:36 a disaster

14:37 gfredericks: oh right

14:37 hiredman: if you really want "pmap" use fold and reducers

14:38 gfredericks: I probably should try reducers

14:38 well do they do anything useful with lazy seqs yet?

14:38 hiredman: no, and never will

14:38 gfredericks: okay maybe not appropriate then

14:39 unless it's worth orchestrating via chunking into vectors or something

14:39 hiredman: the parallel bit in reducers is about parallel processing tree like structures, which clojure's vectors and maps are

14:40 gfredericks: have you seen, uh, I think it was guy steele's talk about cons considered harmful?

14:40 gfredericks: mmmmaybe not?

14:41 aaelony: sorry for a silly question… Never worked with hiccup radio-buttons before but have a a hiccup form-to wrapping a table with columns for the question and a set of radio-buttons done like this. (defn radio-set [n name] (map #(hf/radio-button (keyword name) false %) (range (dec n)))) and the table entries look akin to this [:td (radio-set 5 "acb123")]. I click my submit button and it renders my posting page fine, but I'm wondering

14:41 to access the chosen values from the radio buttons? Ideally, I'd like to see all the radio buttons in a collection and dump the answers to a file. any tips welcome.. thanks

14:41 hiredman: cons builds a linked list, which is a linearly accessable structure

14:41 which is bad for parallism

14:41 gfredericks: hiredman: oh sure; I understand why there's no direct reducers impl for seqs

14:42 it's not hard to (map vec (partition-all n coll)), but not an obviously useful thing for reducers to do for you

14:42 or to do at all

14:42 but seemed worth asking about at least

14:43 hiredman: I dunno why you would do that? just vec the seq, why partition it?

14:43 gfredericks: if too big for memory

14:43 which it is in my case

14:43 hiredman: ah, well write a custom CollReduce :)

14:44 gfredericks: reducers is expected to work better for small tasks than other approaches?

14:44 mmarczyk: dnolen: ping

14:45 aaelony: hey nevermind… just discovered {params :params}… duh. thanks anyways.. :)

14:46 amalloy: gfredericks: if it's too big to fit in memory all at once, you have to be careful how you parallelize it too

14:46 jkkramer: gfredericks: there's this thing: https://github.com/paulbutcher/foldable-seq (never used it)

14:46 dnolen: mmarczyk: pong

14:46 gfredericks: jkkramer: hah, I read "never use it" first

14:47 hiredman: gfredericks: yes, they use a fancy fork/join threadpool with work stealing and etc

14:56 futile: I've started liking the idea of mixing markdown with hiccup.

14:57 ok, think im going to just go with "attest"

14:57 ill sit on it for a day

15:00 seangrove: What's up with the furor over deprecating :use in the ns declaration - I might be missing something, but isn't the end-effect of (:require :refer) exactly the same?

15:02 supersym: seangrove: It seems not? I had this today with Tower and couldn't for the better part of it :refer while :use worked... beats me why exactly though

15:03 99/100 times it would seem though that :use :only = :require :refer?

15:03 seangrove: Seems like it, yes

15:04 edbond_: what function can do this: (f [1 2 3] [:a :b :c]) ;; => [ [1 :a] [2 :b] [3 :c] ] ?

15:04 stuartsierra: edbond_: (map vector [1 2 3] [:a :b :c])

15:05 edbond_: stuartsierra, nice, thanks. I knew map takes several collections.

15:06 futile: ,(map + [1 2 3] [4 5 6])

15:06 clojurebot: (5 7 9)

15:06 futile: neat

15:06 edbond_: have a clean csv output vectors now.

15:10 futile: edbond_: woo

15:17 jouiswalker: is there a nice way to keep the ui from freezing in clojurescript when you have to do a lot of work?

15:17 Raynes: Invent multithreaded javascript.

15:17 mmarczyk: jouiswalker: https://github.com/pedestal/app-tutorial/wiki/Parallel-Processing

15:17 (web workers for processing, main thread for rendering only w/ pedestal-app)

15:18 futile: our solution has been to avoid using javascript.

15:18 Raynes: Smooth mmarczyk.

15:18 futile: it's worked well so far.

15:18 mmarczyk: :-)

15:18 Raynes: "You can solve this problem by using this web framework."

15:18 jouiswalker: nice

15:18 lol

15:18 mmarczyk: ;-)

15:18 jouiswalker: maybe i can steal the pedestal web worker

15:19 i had looked at the shoreleave implementation, but in the marginalia docs it said "DONT USE THIS"

15:19 Raynes: I've had that disease before.

15:19 IIRC, irclj said DON'T USE THIS for the better part of a year while I was using it. :p

15:20 jouiswalker: did it ever come back to bite you?

15:20 Raynes: People complained about it and made other, worse libraries that were even less usable than mine was at the time. :p

15:20 I hope I finally changed the readme...

15:21 amalloy: I just went to https://github.com/fratland. We were almost party animals for a moment.

15:22 jouiswalker: that should be an organization on github

15:23 arrdem: Raynes: and then the improbability drive converged. we know how this goes.

15:23 Raynes: lol

15:24 arrdem: anyone ever heard of a four operand machine?

15:24 Raynes: Wow, what happened to ohpauleez?

15:25 It looks like he vanished off the face of the planet about 3 months ago.

15:25 egghead: how can I print the value of something that is nil as a the string "nil" ?

15:25 arrdem: ,(prn nil)

15:25 clojurebot: nil\n

15:25 egghead: for instance, (str [:foo :bar]) is "[:foo :bar]" -- I'd like something that takes in nil and returns "nil"

15:25 and similarly takes in [:foo :bar] and returns "[:foo :bar]"

15:25 arrdem: ,(pr-str nil)

15:25 clojurebot: "nil"

15:26 seangrove: Raynes: I hear tutorspree is workin' him good

15:26 arrdem: ,(pr-str [:shut :up :and :use :this])

15:26 clojurebot: "[:shut :up :and :use :this]"

15:26 egghead: thanks arrdem

15:26 arrdem: egghead: :P no problem

15:30 chrisrossi: (dumb-noob-question

15:30 I used 'lein new app' to create a Hello World app, then ran lein compile.

15:30 My expectation was I would see a .class file in target/classes

15:30 Yet I see no such thing.

15:31 technomancy: chrisrossi: maybe you want `lein compile :all`?

15:31 chrisrossi: Where am I wrong in my thinking?)

15:31 technomancy: `lein compile` will only compile the namespaces you've asked for in defproject

15:31 chrisrossi: yep, that looks better.

15:31 thanks!

15:32 technomancy: np

15:33 futile: ok, deploying. more time to think of a name.

15:36 Somelauw: I'm using nrepl, but how to send code directly to the repl to execute?

15:36 arrdem: futile: I'm thinking this is an exercise in futility...

15:37 futile: HA

15:37 yes, maybe futile will be the name

15:37 (deployed. waiting for people to complain about bugs.)

15:37 arrdem: futility wouldn't be a half bad name either... indicates lack of proof :P

15:43 kmicu: Somelauw: This is for sure in nrepl's README.

15:45 Somelauw: kmicu: I found ctrl+x, ctrl+e so far, but that prints in the minibuffer instead.

15:45 Also, I want to parse the whole file at once preferably.

15:45 kmicu: Somelauw: all this is in README :)

15:46 Somelauw: also, not familiar with that crazy emacs terminology. What is a region?

15:46 kmicu: The name of file is very important here. You should * README * before you use it. ;]

15:47 nDuff: Somelauw: an area within a buffer, with distinct start and end points

15:47 Somelauw: if you select some text, for instance, that text can be described as a region.

15:48 ndp: Somelauw: Check out the nrepl-eval-* functions.

15:48 Somelauw: I really can't find a command to send a single x-expression to the repl. It's not lisp-eval-last-sexp

15:49 futile: i ned to read more i guess

15:49 Somelauw: Yes, I'm reading them.

15:49 futile: whats a story involving sanity/insanity?

15:49 technomancy: futile: anything by Philip K Dick

15:49 futile: the tell-tale heart

15:49 futile: oh yeah

15:50 hyPiRion: futile: anything poe

15:50 futile: (inc poe)

15:50 lazybot: ⇒ 1

15:50 hyPiRion: Well, not anything, but most of it

15:50 chrisrossi: pretty much all pynchon novels are about schizophrenia.

15:50 Somelauw: ndp: so i need to select text first? I just want to send the x-expression my cursor is currently on?

15:51 technomancy: http://p.hagelb.org/csp.jpg

15:51 kmicu: X-expressions FTW

15:51 futile: ha!

15:51 technomancy: thought I might never get a chance to use that one

15:51 duck11231: Somelauw: C-M-x isn't doing it for you?

15:52 hyPiRion: If you want something newer, The Prefect by Alastair Reynolds is a good one. Alastair Reynolds is good in general if you like sci-fi

15:52 Somelauw: duck11231: undefined

15:52 I'm using nrepl + clojure-mode

15:52 ndp: Somelauw: nrepl-eval-expression-at-point may be what you're looking for

15:52 duck11231: You might need to run M-x nrepl-enable-on-existing-clojure-buffers first

15:52 chrisrossi: there's a lot of exploration of human mind in "Blindsight" by Peter Watts, too. Terrifying hard sci-fi.

15:52 ndp: Somelauw: or nrepl-eval-last-expression

15:53 kmicu: Maybe you are aware of some Lem like/style sci-fi writer?

15:53 ndp: Somelauw: duck11231's suggestion is a good idea as well

15:55 futile: ha. "poe: helps you test your code's sanity"

15:55 mmarczyk: would you guys happen to be able to recommend a jvm-based numeric solver of recurrences?

15:55 arrdem: futile: nevermore would be a badass name...

15:55 futile: hmm nevermore

15:56 yes.

15:56 arrdem: \o/

15:56 futile: i think i like it

15:56 cemerick: Hugely OT: does anyone have recommended autoconf and .deb-package-buliding tutorials that a blind monkey could follow? My random googling has led me to what I suspect are some dark corners.

15:56 technomancy: (ns never.more)

15:56 hyPiRion: Or Quoth, but that's possibly used up because of Discworld.

15:56 mmarczyk: B(x) = 1 + B(x)^2, say

15:57 Somelauw: duck1123: that does the same as ctrl+x, ctrl+e. It shows the output in the minibuffer, but can I show the output in the repl as well?

15:57 futile: either way, not raven, it rhymes with maven too much

15:57 llasram: mmarczyk: I don't know if it's there or not, but Apache commons-math probably wouldn't be a bad place to start looking

15:58 mmarczyk: llasram: thanks, didn't occur to me to look -- will do

15:58 look there

15:58 technomancy: futile: http://timberglund.com/blog/2012/08/03/the-maven/

16:00 chrisrossi: cemerick: i let fpm figure it out for me: https://github.com/jordansissel/fpm

16:02 amalloy: mmarczyk: well, that particular "recurrence" is easy, because B(x) can't depend on x the way you wrote it

16:02 llasram: cemerick: If your goal is just to build debian packages for internal/personal use, I second the vote for FPM. If you want to Do It Right (tm), I honestly don't think it gets much better than the official Debian manuals

16:02 technomancy: debian packaging manuals =\

16:02 mmarczyk: amalloy: x is a real variable here

16:03 Somelauw: ctrl+c, ctrl+l works for loading files. Copy-pasting code also works so far.

16:03 cemerick: llasram: yeah, this is totally internal. Thanks for the recommendation, chrisrossi :-)

16:03 technomancy: ...are OK if you already know the C toolchain well

16:03 mmarczyk: real-valued

16:03 amalloy: mmarczyk: my point is that there's no B(x-1) term or similar

16:03 you can solve that for B(x) and get a constant

16:04 seangrove: mmarczyk: Have you used pedestal at all?

16:04 technomancy: really opaque if you want to build debs for not-C without learning the C tools inside and out

16:04 cemerick: technomancy: I have a .sh that works for me, locally, right now. I was hoping there'd be something easy so I could get some `make install` action going, which lots of other tools appear to rely upon.

16:06 mmarczyk: amalloy: eh, recurrence in the sense of a function being defined in terms of itself

16:06 technomancy: cemerick: I got just far enough in debian packaging to realize doing it right would involve learning a bunch of stuff I have explicit life goals of not learning.

16:06 amalloy: specifically you end up with B(x)=(1 +/- sqrt(-3))/2

16:07 mmarczyk: amalloy: this particular case is the counting ordinary generating function of complete planar binary trees

16:07 amalloy: so I'm interested in transforming this to 1-sqrt(1-4x^2)/2x

16:07 well actually I'm not really interested in the symbolic transformation

16:08 because I only really need to evaluate it for arbitrary values of x

16:08 but I'd like to do it given a specification in the original form, without needing to provide a closed form

16:09 so there's a fix point search

16:09 brianwong: in the repl, im using require to reload my name space

16:09 futile: technomancy: man, i think that ruins the name "nevermore"

16:09 brianwong: but it seems like new symbold definitions dont come into the namespace after a reload

16:10 that is expected behavior?

16:10 wait nevermind

16:10 hyPiRion: mmarczyk: It's impossible to do that without more knowledge about B. What kind of function may B be?

16:10 brianwong: please disregard

16:10 mmarczyk: hyPiRion: analytic

16:12 hyPiRion: normally OGFs are considered as complex-valued in these contexts, but I'm not actually going to want to get values at complex arguments

16:13 amalloy: not saying "recurrence" was the best choice of term :-(

16:14 amalloy: mmarczyk: i don't especially mind the word "recurrence" (wrong though it is, as you point out), i'm just saying that the function you defined is a constant function, whose value does not depend on x

16:15 futile: ok. i think that settles it. i think im going to pick "nevermore".

16:16 * futile is so tired of this uncertainty

16:16 mmarczyk: amalloy: "recursive specification" would be fine though, I guess, should have gone with that; or should it be inductive

16:16 seangrove: Cedric trolling datomic again

16:16 futile: shall i change it? nevermore.

16:16 * futile snickers

16:16 seangrove: tbaldridge has saintly patience

16:16 mmarczyk: ah, not at my most expressive right now :-/

16:17 amalloy: however, solving this type of equation for the generating function -- treating B(x) as an atomic variable term, as it were -- makes perfect sense and is in fact very useful

16:19 amalloy: for example, that 1-sqrt(1-4x^2)/2x function has the property that the coefficients of its power series expansion happen to be precisely the counts of distinct complete planar binary trees of sizes 0, 1, 2, ... (with size defined as number of inner nodes)

16:19 and solving the original equation in this manner is the most convenient way of arriving at this final OGF

16:20 `cbp: callen: ping

16:20 mmarczyk: seangrove: pedestal -- played with it a bit, planning to use it now

16:21 callen: `cbp: da comrade?

16:25 futile: technomancy: does leiningen have something like :aliases that lets you run a straight-up clojure function?

16:26 Might be nicer to have ":clj-aliases {"autotest" (nevermore.run/run :runner nevermore.runners/auto-runner)}"

16:27 llasram: futile: But you can already run an arbitrary Clojure function in your project with `lein run`, and create `lein run` alias with :alieses

16:27 :aliases even

16:28 futile: llasram: maybe.

16:28 i mean, yeah

16:28 maybe i dont need what im asking for

16:29 yedi: anyone have any experience using friend for user auth?

16:30 futile: yedi: some people have reported good experience doing that. i found it confusing and hard to get started, so i just directly integrated with openid4java, which is what friend uses under the hood anyway.

16:31 yedi: futile: did you find it hard becuase you're newish to clojure? or are you decently experienced and the api just isn't the greatest?

16:31 futile: yedi: i couldnt figure out how to use his api for just openid

16:31 yedi: not new to clojure.

16:32 yedi: Friend seems like something you'd want when you want to be able to do lots of complex things. i only wanted to do one simple thing, and couldnt quite figure out how.

16:32 but like i said, many people reported finding it very easy. maybe i missed something.

16:36 mmitchell: anyone have ideas on how to get lein-ring server running on https?

16:37 hiredman: mmitchell: https for dev?

16:37 mmitchell: hiredman: yes

16:37 hiredman: dunno, just making sure you're not using lein-ring to run an app in production

16:37 mmitchell: ha yeah, we're not doing that :)

16:38 i have a feeling i'll have to build the war, and deploy it into jetty or tomcat by hand

16:39 hiredman: mmitchell: my guess is lein ring doesn't expose that because most people don't need https at dev time

16:39 xpe: i'm hoping to find an enlive example on how to map (?) a seq into a selector

16:39 mmitchell: hiredman: i bet you're right

16:40 hiredman: mmitchell: if you launch jetty yourself using the functions from the ring jetty adapter stuff you can pass in the various ssl bits (truststores,keystores,etc)

16:41 ystael: have a dumb question about string matching and splitting: https://www.refheap.com/16890

16:43 xpe: [:a] (h/set-attr …) adapted to use a seq

16:50 TimMc: &(require '[clojure.string :as str])

16:50 lazybot: ⇒ nil

16:51 gfredericks: &str/split

16:51 lazybot: ⇒ #<string$split clojure.string$split@8b5c5f>

16:52 arrdem: TimMc: since when is require not sandbox denied...

16:52 TimMc: O:-)

16:52 arrdem: ,(do (require '[clojure.string :as str]) (str/split #" " "foo bar baz"))

16:52 clojurebot: #<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.util.regex.Pattern>

16:52 TimMc: Both bots allow it, I think.

16:53 arrdem: ,(do (in-ns 'arrdems-sanxbox) (require '[clojure.string :as str]) (str/split #" " "foo bar

16:53 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading string>

16:53 arrdem: baz"))

16:53 TimMc: &(map #(str/split % #"(?=[A-Z])") ["Foo" "FooBar"])

16:53 lazybot: ⇒ (["Foo"] ["" "Foo" "Bar"])

16:53 xeqi: fun in the sanxbox

16:54 TimMc: ,(in-ns 'SANBOX)

16:54 clojurebot: #<Namespace SANBOX>

16:54 arrdem: ,(do (in-ns 'arrdems-sanxbox)

16:54 clojurebot: #<RuntimeException java.lang.RuntimeException: EOF while reading>

16:54 arrdem: (require '[clojure.string :as str])

16:54 (str/split "foo bar baz" #" "))

16:54 futile: Do any of you guys ever use once-fixtures?

16:54 arrdem: arse

16:54 ,(do (in-ns 'arrdems-sanxbox) (require '[clojure.string :as str]) (str/split "foo bar baz" #" "))

16:54 clojurebot: #<CompilerException java.lang.RuntimeException: Unable to resolve symbol: require in this context, compiling:(NO_SOURCE_PATH:0:0)>

16:54 TimMc: arrdem: No need for that, the require persists.

16:55 arrdem: TimMc: it would if I had remembered to refer-clojure :P

16:55 xeqi: for about ~20 minutes on clojurebot I think

16:55 gtrak: I've stopped using fixtures entirely

16:56 arrdem: why is def denied in sandbox?

16:57 futile: gtrak: hasn't that been tedious, to do common setup in every test?

16:57 llasram: This looks like a bug in java regular expression, or at least a really weird edge case.

16:57 futile: hmm, I guess the only fixture I use is (with-memory-datastore)...

16:57 gtrak: futile: I don't have to teardown really, since we're using datomic. I just return all the 'services' as a tuple or map

16:57 llasram: &(mapv #(seq (.split "Foo" %)) ["(?=[A-Z])" "(?=[A-Z])."])

16:57 lazybot: ⇒ [("Foo") ("" "oo")]

16:58 gtrak: it's not super tedious.. much more maintainable

16:58 futile: gtrak: hmm, how do you like datomic?

16:59 arrdem: llasram: er... something isn't right there.

16:59 futile: I'm tired of using MongoDB for relational data.

16:59 gtrak: we're not really using the parts that make it special, but it's been fine so far

16:59 futile: gtrak: performs fine then?

17:00 ystael: llasram: #"(?=[A-Z])." is strictly equivalent to #"[A-Z]" isn't it?

17:00 arrdem: ystael: yes I believe so

17:00 ystael: &(seq (.split "Foo" "[A-Z]"))

17:00 lazybot: ⇒ ("" "oo")

17:00 gtrak: futile: yea, it's not to the point where we have to worry about that

17:01 llasram: arrdem, ystael: I was just showing that having anything else in the pattern causes it to actually split

17:01 clojurebot: arrdem is jeremy

17:01 llasram: Thanks, good to know, clojurebot

17:01 arrdem: ~arrdem

17:01 clojurebot: arrdem is awesome

17:01 futile: gtrak: ah. our cart takes about 5 seconds to load in production, 2 on localhost, and its all in mongo-land. so im thinking datomic might be a nice jump for performance.

17:01 arrdem: arrdem, foo bar baz

17:02 ystael: llasram: yeah. but the rationale for this behavior is not clear to me

17:02 anyway, the correct workaround for me seems to be to use qerub/camel-snake-kebab instead of rolling my own :)

17:02 llasram: There you go!

17:08 &(mapv #(seq (.split #"(?=[A-Z])" "FooBar" %)) (range 1 4))

17:08 lazybot: ⇒ [("FooBar") ("" "FooBar") ("" "Foo" "Bar")]

17:09 llasram: Oh, "the array's length will be no greater than <n>"

17:09 futile: gtrak: did you guys install it from http://downloads.datomic.com/free.html or clojars?

17:09 llasram: Ugh. I never remember which regex-split APIs take the max number of results vs the max number of splits

17:10 gtrak: futile: clojars I believe

17:10 ystael: that makes even less sense - i'd expect the size-1 result to be ("")

17:10 but from the openjdk source it looks like if you ask for a limit then it drops the entire rest of the string into the final entry

17:11 futile: thx gtrak

17:11 TimMc: ystael: Well, that one is explainable -- if you can only have one entry, there have to be zero splits.

17:11 gtrak: futile: the peer client is all you need to play around with the in-memory db

17:11 ystael: yeah, i just want a behavior different from what the doc says :)

17:12 futile: gtrak: im not up to date with datomic terminology yet, dunno what peer client is

17:12 TimMc: &(str/split "foo" #"o" 3)

17:12 lazybot: ⇒ ["f" "" ""]

17:12 TimMc: &(str/split "foo" #"o")

17:12 lazybot: ⇒ ["f"]

17:12 futile: gtrak: if you mean [com.datomic/datomic-free "0.8.4020.26"] then ok

17:12 gtrak: futile: yea

17:12 futile: gtrak: you guys use the paid version?

17:12 gtrak: nah

17:13 futile: cool

17:13 (inc gtrak) you've been a real pal

17:13 ohh i see lazybot is sleepin on the job, eh?

17:13 hyPiRion: (inc gtrak) ; like this

17:13 lazybot: ⇒ 6

17:14 futile: hmm, i didnt see the semicolon in the regex

17:14 then again, how can anyone? those things are dense

17:14 gtrak: heh, thanks

17:14 TimMc: (inc lazybot) ; if the non-greedy quantifier was used ;-)

17:14 lazybot: ⇒ 1

17:15 TimMc: Crud, forgot to check karma first.

17:15 (inc lazybot) ; if the non-greedy quantifier was used ;-)

17:15 lazybot: ⇒ 2

17:15 TimMc: Oh good.

17:16 * futile googles for a Clojure wrapper

17:17 tbaldridge: futile: What are you trying to wrap for Clojure?

17:17 futile: oh sorry, datomic

17:18 tbaldridge: btw was it you who suggested test assertions being in the tail position?

17:18 tbaldridge: futile: datomic comes with a super nice Clojure API, why a wrapper?

17:18 futile: http://docs.datomic.com/clojure/

17:18 futile: tbaldridge: i meant a clojure api, so i didnt have to touch java. thanks for that link :)

17:19 tbaldridge: futile: btw, one of the things I love about Datomic's clojure API is that it's really built for Clojure, so you can transverse entities like this:

17:19 llasram: &(mapv #(str/split % #"(?m)^") ["FooBar" "Foo\nBar"])

17:19 lazybot: ⇒ [["FooBar"] ["" "Foo\n" "Bar"]]

17:20 tbaldridge: futile: (-> (d/enttity db db-id) :child :child :child)

17:20 *entity

17:21 futile: tbaldridge: oh that looks super handy

17:22 tbaldridge: futile: as well, as Datomic supports reverse attributes (work like keywords but for a backwards relationship) so you can do this: (-> (d/entity db child-id) :_child :_child)

17:22 that will get a node's grandparent

17:22 futile: tbaldridge: huh, neat

17:22 tbaldridge: ok im sold on datomic from an api standpoint

17:22 now all i need is to find some entry point i can start messing with in my tests

17:24 gfredericks: (defn chunkily-pmap [n func coll] (->> coll (partition-all n) (pmap #(doall (map func %))) (apply concat)))

17:27 futile: gtrak: so you just use (create-database static-test-uri) in all your tests, without ever worrying about deleting it?

17:27 gtrak: yea

17:27 futile: gtrak: where static-test-uri is probably "datomic:mem://test"

17:27 gtrak: yea

17:27 futile: (always)

17:28 and that just works?

17:28 oh man thats awesome.

17:28 gtrak: wrapped in about 20 layers of abstraction

17:28 but yes

17:28 futile: right

17:28 yeah we'd probably have to store this thing in a var somewhere so we dont have to pass it everywhere.

17:28 gtrak: right, I explicitly don't store it in a var :-)

17:28 futile: why not?

17:29 gtrak: lifecycles just get nasty if stuff is big enough.

17:29 maybe I'd consider putting all the app state in a single var.

17:29 Somelauw: how to make lein refresh dependencies?

17:30 hyPiRion: Somelauw: lein -U $TASK

17:30 (see `lein help deps`)

17:31 futile: gtrak: what do you mean about the lifecycle comment?

17:32 gtrak: futile: so.. we got session-stores, a registry, other services that close over the registry, a ring request handler that closes over all the services. it's hard to keep it all together when you start adding vars.

17:32 futile: gtrak: ah touche

17:33 TimMc: ystael: Almost certainly a bug: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/regex/Pattern.java#1031

17:33 That line assumes that if the index is still at 0, then no matches were found.

17:33 Somelauw: hyPiRion: I already tried 'lein deps', but it doesn't download anything.

17:34 I added org.clojure/tools.trace "0.7.5" to project.clj. So 'lein deps' should now download the jar needed, right?

17:34 hyPiRion: Somelauw: yes, unless you already have it downloaded

17:35 Somelauw: hyPiRion: but tryping the following in a repl: (require 'clojure.tools.trace) throws a FileNotFound exception.

17:38 hyPiRion: Somelauw: You added [org.clojure/tools.trace "0.7.5"] to the :dependencies-vector, right? Just remember that you have to be in the same project directory as the project.clj is in

17:38 futile: thanks everyone (esp arrdem) for name ideas.

17:38 i went with Nevermore.

17:38 hyPiRion: that should be it, really.

17:38 futile: https://github.com/evanescence/nevermore

17:42 Somelauw: hyPiRion: Oh, I found the problem. I had it like [dep 1 version dep 2 version] instead of [[dep1 version] [dep2 version]].

17:42 hyPiRion: Somelauw: ah, good to know you found the issue :)

17:42 ystael: TimMc: you got it. i was staring at that for a few minutes, but didn't catch that.

17:45 ThatOneGuy: ,(nil {nil 3})

17:45 clojurebot: #<CompilerException java.lang.IllegalArgumentException: Can't call nil, compiling:(NO_SOURCE_PATH:0:0)>

17:45 ThatOneGuy: ,({nil 3} nil)

17:45 clojurebot: 3

17:45 TimMc: ystael: I just started imitating the code with my own Matcher instance. :-P

17:45 ThatOneGuy: ,(#{nil 3} nil)

17:45 clojurebot: nil

17:45 ThatOneGuy: me gusta nil

17:46 TimMc: &(mapv #(str/split % #"(?=[A-Z]|$)") ["Foo" "FooBar"])

17:46 lazybot: ⇒ [["" "Foo"] ["" "Foo" "Bar"]]

17:47 TimMc: Ugly workaround.

17:47 #"(?=[A-Z])|$" even

17:47 Somelauw: Does ctrl+c, ctrl+l automatically apply all changes made to my source file as well in nrepl?

17:47 I have the feeling it is having problems with 'old errors'.

17:59 Hmm, it does not update when using multimethods. Even manually copy-pasting the multimethod does not work.

18:00 there must be a way to refresh this multimethod without having to restart the repl

18:02 TimMc: Somelauw: I don't have experience with this (known) problem, but what happens if you re-execute the defmethod as well?

18:02 Err, the defmulti.

18:02 bbloom_: jergason: heh, i just ran into the RRB thread. reading it, it seems like it would be a great thing to try in place of finger trees!

18:04 futile: Can anyone recommend a Datomic tutorial that's easier to follow than http://docs.datomic.com/tutorial.html ?

18:04 I think a computer wrote this one.

18:07 Somelauw: TimMc: I did re-execute both. The only hack so far I found is to rename the multimethod before executing it again, but that might become a problem if there are more than 2 multimethods to test.

18:08 some way to undefine multimethods might work

18:08 since I can't override them

18:11 seangrove: Clojure is great, but any time I interact with Java I want to cry

18:13 Well, I'll save implementing a custom IMAP command/protocol implementation/class for javamail for after lunch

18:14 futile: gtrak: did you use http://docs.datomic.com/tutorial.html to learn it, or something else?

18:14 I'm having a really hard time understanding the query language, this author isn't making it very clear.

18:15 gtrak: futile: I didn't really work on that part of the code, but this came out recently: http://blog.datomic.com/2013/07/datomic-musicbrainz-sample-database.html

18:18 futile: thanks

18:20 clojurenewb: Raynes: hi, I've got a laser question… can I add a selector clause using descendant-of to ignore elements that are a descendant of 'x' ?

18:33 Derander: Is there a way to (with lein) add code that will be eval'd in the user namespace across all repl sessions?

18:33 Namely I have a debugging macro that I'd like available everywhere

18:34 Somelauw: Is it by the way possible to interactively undefine symbols or multimethods?

18:34 to solve my problem?

18:34 futile: Derander: maybe you can def it in clojure.core and it'll just be available everywhere?

18:34 wait that makes no sense

18:34 justin_smith: Derander: maybe put it in a leiningen plugin that you load in the :user profile in .lein/profiles.clj?

18:34 technomancy: Derander: check under :repl-opts in `lein help sample`

18:35 Derander: ah! thank you for all of the answers. I will read and experiment

18:35 egghead: if clojure.edn has read-string, how to I 'write-string' ?

18:35 justin_smith: egghead: prn mostly prints readably

18:35 this fails by design for certain things

18:36 that should not be re-readable

18:36 dnolen: Somelauw: you can probably unmap the var from the namespace

18:36 egghead: so if I wanted to ship edn over the wire I'd just use pr-str ?

18:36 Derander: technomancy: I see -- that'll work. Thanks!

18:36 futile: egghead: I think there's a lib for reading edn

18:37 egghead: clojure.edn can read it, I'm interested in how to write it

18:37 nDuff: egghead: yes, pr-str

18:37 egghead: thanks nDuff

18:37 futile: oh

18:37 sorry

18:37 man im off a roll today

18:40 egghead: :)

18:40 Writing my first cljs app consuming edn, it's fun

18:43 futile: ,`(foo bar)

18:43 clojurebot: (sandbox/foo sandbox/bar)

18:43 futile: ,(let [baz 4] `(foo bar ~baz))

18:43 clojurebot: (sandbox/foo sandbox/bar 4)

18:43 futile: oh!

18:43 Somelauw: dnolen: how? It's about a multimethod that won't automatically be overwritten in the repl when copy-pasting its definition again.

18:44 futile: neat.

18:45 egghead: what should I be using in cljs to read edn?

18:46 cljs.reader/read-string ?

18:46 ThatOneGuy: ,(defn ^String foo [^String bar] (str "foo" bar))

18:46 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

18:47 ThatOneGuy: ,((fn ^String foo [^String bar] (str "foo" bar)) "lol")

18:47 clojurebot: "foolol"

18:47 dnolen: Somelauw: multimethods have defonce semantics, the only want to redef is to unmap

18:47 s/want/way

18:47 ThatOneGuy: ,((fn ^String foo [^String bar] (foo (str "foo " bar))) "lol")

18:47 clojurebot: #<StackOverflowError java.lang.StackOverflowError>

18:48 ThatOneGuy: ,((fn ^String foo [^String bar] (recur (str "foo " bar))) "lol")

18:48 lol

18:48 clojurebot: Execution Timed Out

18:50 amalloy: ThatOneGuy: if you need a private repl to play with, you can /msg clojurebot or lazybot

18:50 Somelauw: dnolen: So how to unmap?

18:51 dnolen: ,(doc ns-unmap)

18:51 clojurebot: "([ns sym]); Removes the mappings for the symbol from the namespace."

18:51 ThatOneGuy: amalloy: just seeing if it had any easy holes

18:51 Somelauw: dnolen: thanks

18:52 amalloy: feel free to do that in private; otherwise you're just wasting space

18:52 Somelauw: Also, I'm not sure why, but the doc commands seems to stop working for me in a repl after having used the repl for a while.

18:52 In a fresh repl it always works.

18:52 ThatOneGuy: I read through the majority of "The Joy of Clojure" but I haven't started any clojure projects recently :'( I wanted to convert some of the C# code at my work to clojure but ClojureCLR doesn't have any good tooling

18:53 amalloy: ok I'll do that in the future

18:54 hiredman: because doc is by default only available in the user namespace

18:54 so when you switch the repl to another namespace if you want to keep using doc unqualified you have to require/use it

18:54 it is in the clojure.repl

18:54 namespace

18:55 Somelauw: hiredman: thanks, that works

18:56 I might some day fall in love with clojure

18:58 bbloom_: instaparse is pretty fucking sweet

18:59 futile: bbloom_: what success have you?

18:59 bbloom_: just got up and running mega fast & every time i said "i wish it…" …. it did :-P

19:00 pmonks: instaparse blows my tiny little mind too

19:00 It's amazeballs

19:03 futile: bbloom_: sweet

19:04 bbloom_: sounds like that guy deserves *mad* props. not just props. *mad* props.

19:04 bbloom_: true story.

19:12 egghead: async jasmine specs in cljs :) -- https://www.refheap.com/16892 wahooo

19:15 dnolen: egghead: heh nice. side note: there is no wat over + in CLJS. In JS it is *defined* behavior - it's undefined in CLJS :)

19:15 futile: ,(doc only)

19:15 clojurebot: Gabh mo leithscéal?

19:16 egghead: nice dnolen :p

19:17 hiredman: dnolen: I don't think you get to handwave over that

19:18 the fact that there is no error for that is a wat

19:33 Derander: I am trying to write a program to "reshape" a very large file. I was using awk to do most of this work previously but it was getting unwieldy. I'm working on data that is around 2.2mil lines @ approx. 1000 characters/line -- around 2gb of data. Every operation that I am performing is purely line-level -- things like removing some columns from each line, applying simple transformations to others, etc. Am I insane to use clojure for this? I am

19:33 getting substantially slower performance than when I was using awk.

19:35 * brehaut squints

19:35 brehaut: surely that answers your question then?

19:36 Derander: yeah, I guess. I was hoping that someone had done this before and would say "no! you must be doing something wrong! I've done this before and it was fast!"

19:36 callen: Derander: right tool for the right job.

19:37 technomancy: Derander: massive simple text processing is gonna suck in UTF-16

19:37 Derander: is there a simple way to force ascii?

19:37 technomancy: no

19:37 * Derander weps

19:37 * Derander weeps also.

19:37 technomancy: well, you could work directly on byte arrays

19:37 callen: lol ^^

19:37 Derander: hah. okay. maybe I should drop down to java.

19:38 technomancy: no

19:38 brehaut: you didnt need that most significant bit anyway

19:38 technomancy: Java has the same problem

19:38 all JVM strings are UTF-16

19:38 http://meshy.org/2009/12/13/widefinder-2-with-clojure.html

19:38 ^ possibly relevant

19:39 Derander: technomancy: thanks, reading.

19:40 technomancy: technically jruby has non-utf-16 strings, but that is probably not the path towards improved performance in this case =)

19:40 Derander: hah, right

19:40 I started w/ ruby 2.0

19:40 I switched to awk b/c that was taking like an hour to process the data. AWK can do it in under a minute.

19:40 unfortunately awk is really painful to maintain when people switch the column ordering around or add new fields

19:41 technomancy: write clojure code that compiles to awk =)

19:41 Derander: that is actually not absurd

19:41 I'm not sure anyone else would want to maintain *that* though :-)

19:42 brehaut: Derander: those ancient unix tools have been super optimized for certain ascii cases too, http://ridiculousfish.com/blog/posts/old-age-and-treachery.html is a deep dive into why grep is still the business

19:42 Derander: brehaut: yeah, I'm vaguely aware of the insanity that goes into making the unix tools fast. That's why I reached for awk initially

19:43 callen: Derander: so continue to use awk?

19:43 technomancy: the wide finder post is really eye opening about how you can still go really low-level if you need to

19:43 but it can get ugly

19:44 brehaut: technomancy: likewise that grep one.

19:44 Derander: technomancy: (obviously) haven't had a chance to fully read that yet but I'm interested to see how gnarly it gets.

19:44 brehaut: spoilers: extremely

19:44 Derander: haha.

19:44 callen: I will resort to that if I have to. I'm trying to figure out if this actually needs to be fast.

19:44 technomancy: brehaut: right, but grep is C; you expect it to be ugly

19:45 brehaut: technomancy: its ugly _even for c_

19:45 callen: technomancy: I've seen nice BSD C.

19:45 brehaut: ~guards

19:45 clojurebot: SEIZE HIM!

19:45 ThatOneGuy: I've seen nice ANSI C

19:45 Derander: this is part of a pipeline in a machine learning project -- I have analysts dumping data to me from hadoop and I'm writing an intermediate stage right now that takes the raw output and massages it into a form that our classifiers will accept -- namely I have to split all of the categorical features into several boolean features.

19:46 I am beginning to suspect that if it runs in less than 25 minutes it's probably acceptable because the model training process really only needs to shuffle the data which gshuf is very good at.

19:46 callen: Derander: ...why is this on hadoop?

19:46 Derander: how much data is involved?

19:46 Derander: callen: many terabytes of raw data

19:46 callen: Derander: exactly how many is many?

19:46 Derander: not certain

19:46 callen: I wouldn't use Hadoop until at least 10TB per batch.

19:46 Derander: all of the logs from every request ever made to airbnb.com, basically

19:46 which is a lot

19:46 callen: Derander: you work for airbnb?

19:46 Derander: yessir!

19:47 callen: Derander: do they use Clojure?

19:47 Derander: a little bit in some places

19:47 mostly ruby and java

19:47 callen: curious.

19:47 Derander: we rewrote our only haskell service awhile ago :-P

19:47 callen: Derander: into?

19:47 Derander: java -- other people took over maintenance and weren't comfortable enough w/ haskell.

19:48 futile: phfraw

19:48 callen: I don't blame them.

19:48 nDuff: Heh.

19:48 Derander: but yeah I work on the machine learning pipeline that goes into our fraud detection shit

19:48 callen: Derander: very nifty.

19:48 * nDuff (as a happy customer) gives Derander a high five.

19:48 Derander: nDuff: :-) glad you've enjoyed it

19:50 futile: Looks like migrating an existing database to Datomic might not be feasible. What do you think gtrak and tbaldridge?

19:50 gtrak: mongodb doesn't have schemas, right?

19:51 callen: gtrak: it does

19:51 gtrak: just not enforced ones.

19:51 futile: Right, it's an implicit schema.

19:51 Whereas Datomic schemas are.. well, goo.

19:51 gtrak: not so implicit

19:51 callen: gtrak: the schematic patterns are relevant for indexing, ordering, and other things. What do you need?

19:51 futile: I guess you can make Datomic schemas look rigid like a Mongo schema, it just won't look right.

19:51 gtrak: callen: futile's got a mongo thing

19:52 callen: gtrak: oh I thought I was helping you with something

19:52 n/m then.

19:53 miwa: okay, I'm trying to use "ganelon" the web microframework.. but how do I make it actually start a web server? I'm kind of confused here and there doesn't seem to be alot of documentation lying around..

19:54 callen: miwa: don't use ganelon.

19:54 futile: This is fun: http://www.flyingmachinestudios.com/programming/the-unofficial-guide-to-rich-hickeys-brain/

19:54 callen: miwa: if you expect documentation, ganelon isn't a good fit for you.

19:55 miwa: callen: then what should I use? :)

19:55 callen: miwa: generally, Luminus. If you have specific needs it doesn't suit, ping me.

19:56 miwa: try to avoid the fancy bullshit until you're comfortable reading and harnessing Clojure code without the benefit of documentation.

19:57 TimMc: And bullshit it is if it isn't documented.

19:57 callen: precise terminology right thurrr

19:58 futile: (inc TimMc)

19:58 lazybot: ⇒ 43

19:58 miwa: thank you callen, I'll try Luminus out of a while :)

19:58 futile: (dotimes 3 [i] (inc TimMc))

19:58 haha

19:58 callen: did you write luminous?

19:59 callen: futile: *Luminus, and no. But I did irritate the shit out of the creator in what libraries to use.

19:59 I use Luminus a lot.

19:59 futile: it seems like a competitor to Joodo

19:59 gtrak: Luminus is cool

19:59 callen: futile: except useful.

20:00 futile: like, it has the same feature set as Joodo

20:00 callen: joking aside, joodo and luminus are similar.

20:00 hiccup is a bad idea for Clojure newbies.

20:00 futile: is it?

20:00 seangrove: ,(str "(inc TimMc)")

20:00 clojurebot: "(inc TimMc)"

20:00 futile: i grokked it right away, before i knew any real clojure

20:00 seangrove: hrm...

20:00 TimMc: futile: I think you mean (swap! karma update-in ["TimMc"] (apply comp (repeat 3 (fnil inc 0))))

20:00 callen: futile: how many web apps have you made in Clojure?

20:00 futile: ,(print "(inc TimMc)")

20:00 clojurebot: (inc TimMc)

20:01 callen: ,'(inc TimcMc)

20:01 clojurebot: (inc TimcMc)

20:01 callen: ,'(inc TimMc)

20:01 clojurebot: (inc TimMc)

20:01 TimMc: lazybot ignores clojurebot these days.

20:01 futile: awww

20:01 seangrove: ~'(inc TimMc)

20:01 callen: seangrove: nice try.

20:01 clojurebot: oinc is octo-inc: (apply comp (take 8 (repeat inc)))

20:01 futile: (inc TimMc)

20:01 lazybot: ⇒ 44

20:01 seangrove: Heh, bummer

20:01 The bots have grown apart

20:01 TimMc: ...although I appreciate the sentiments. ;-)

20:01 futile: hahaha

20:01 TimMc: seangrove: It's all Raynes' fault. Or hyPiRion's, depending on how you look at it.

20:01 callen: futile: so how many web apps have you written in Clojure?

20:02 futile: i dunno, a handful

20:02 callen: futile: github?

20:02 futile: no, private

20:02 callen: thought so.

20:02 futile: why?

20:02 clojurebot: why not?

20:02 futile: and how?

20:02 TimMc: seangrove: hyPiRion achieved a marvelous two-bot quine using $timer and Raynes put a permanent stop to it.

20:02 callen: TimMc: that's hilarious.

20:02 futile: TimMc: oh what day?

20:03 TimMc: Ah, the date is burned in my... logs.

20:03 futile: TimMc: can you remember any words from it?

20:04 brehaut: how about 'hyPiRion'

20:04 TimMc: "well done hyPiRion. many have tried for the multi-bot quine"

20:05 Dec 17 2012

20:05 $echo testing

20:05 futile: http://logs.lazybot.org/irc.freenode.net/%23clojure/2012-12-17.txt

20:05 TimMc: $timer 0 0 1 testing

20:17 callen: The Scala guys are going to think we have Akka envy. https://github.com/lantiga/exoref

20:21 futile: What I mean is, to use Datomic properly and get the most out of it, you might end up restructuring your schema significantly from what it was in either SQL or NoSQL.

20:38 Oooh, core.logic is basically just prolog (datomic queries)?

20:46 tomjack: core.logic/prolog are not datalog

20:49 muhoo: i'm getting weird errors from clj-http

20:49 org.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 11209; received: 6680

20:50 callen: muhoo: catch and harvest what you can. They're not going to fix it.

20:50 muhoo: nothing to fix.

20:50 muhoo: "they're"?

20:50 callen: muhoo: apache

20:50 muhoo: well, i'm not sure it's an apache problem.

20:50 it could be a me problem.

20:50 callen: muhoo: well it's actually whoever sent you the response.

20:51 muhoo: or the site i'm hitting

20:51 callen: muhoo: contentlength didn't match the response body. you can catch it and process anyway.

20:51 muhoo: oh, well, bleah. will abort/retry/ignore

20:52 callen: muhoo: well, check to make certain it's right. Compare the response to the content length header. If it's a valid exception you simply have to opt to ignore it.

21:13 aphyr: Yo, if anyone figures out a good way to use annotations with (proxy), I will mail you cookies

21:13 Like the second API this week that requires them, and I am getting really worried about my abuse of javac at runtime

21:18 callen: aphyr: do you want runtime annotation?

21:18 aphyr: Or at compile time

21:19 Being able to annotate an arbitrary class would work. Considering learning enough ASM to do it.

21:19 Right now I actually generate big ol strings of java and pass it to the compiler, register a new class, and use that

21:19 then bind functions into static instance fields on the class

21:19 pretty disgusting

21:20 callen: aphyr: you and ztellman worry me sometimes. I wish you were in here often but your twitter has to suffice.

21:20 here more often*

21:20 aphyr: one problem is I can't tell where you want the arbitrary annotation to work from.

21:20 aphyr: Haha, believe me, I don't *want* to do this

21:20 callen: do you want it as part of your weird compiler toolchain, from Clojure, from Java itself?

21:20 aphyr: Naw, I want to write clojure that uses Java APIs

21:20 callen: right, okay.

21:20 aphyr: So Netty 4, for instance, requires an @Sharable annotation on any Handlers which can be re-used between channels

21:21 I can proxy a handler

21:21 but it doesn't have the annotation, so I have to new() a new one for every single conn

21:21 For UDP, it's a pretty significant overhead

21:21 Be great if I could use the same syntax that gen-class or reify uses to specify annotations for proxy

21:22 hiredman: aphyr: have you looked at using asm to generate bytecode to do whatever you want?

21:23 onr: JVM ecosystem is damn fat

21:23 callen: aphyr: (:gen-class :methods [^#{:annotations [SomeAnnotation]} [aMethod [T] S]]

21:24 aphyr: you're AOT'ing right?

21:24 aphyr: callen: nope, not AOT'ing

21:24 Need to generate this at macroexpand time

21:24 so proxy/reify semantics would be most useful

21:25 callen: aphyr: you're killing me man.

21:26 aphyr: don't look at me, it's not my library, haha

21:26 callen: aphyr: also are you into Star Trek? I noticed Janeway.

21:26 aphyr: haha, yeah, though I count myself more a TNG guy

21:27 callen: aphyr: me too. So have you used clojure.asm much?

21:29 aphyr: Naw, I haven't used it yet

21:29 Don't know enough about bytecode generation

21:29 When I'm not in full-on sprint mode on a project I'll take a look

21:29 just... I have 20 days to build a database, haha, can't spare the time

21:30 callen: aphyr: sure. you almost definitely know more than I do though.

21:33 aphyr: well core_proxy.clj leans on clojure/asm/*.java, and there's an AnnotationWriter.java.

21:33 aphyr: nothing shake-n-bake ready-to-use but it's not out of the question.

22:07 dnolen: core.match 0.2.0-rc5 going out

22:07 futile: woo

23:17 tbaldridge: futile: I've transfered some SQL datasets to Datomic, and I didn't really have many problems. FK/PKs transfer fairly well to Datomic refs. However the full power of Datomic is really seen from a from-scratch schema, imo

23:18 futile: Yeah that's the impression I'm getting.

23:18 For example we have an entire collection called "payment_transaction" but that would be obsolete in a proper Datomic schema as you could just look through the history of that Payment entity.

23:19 tbaldridge: futile: yeah, history stuff is completely different in Datomic

23:19 futile: Crap.

23:20 tbaldridge: futile: that being said, after developing fairly large SQL databases that tracked history (or attempted to, and failed utterly), I'd never go back to SQL after Datomic.

23:20 futile: That means, even if we did port our db to Datomic, we couldn't take full advantage of it, unless we were able to migrate the existing history schema into Datomic's actual history stuff.

23:20 tbaldridge: heh, that resonates loud and clear over here

23:20 tbaldridge: futile: perhaps, but that doesn't stop you from scanning your SQL database and "updating" an entity to simulate history

23:21 futile: That's what I had in mind. Wasn't sure how evil it really is though.

23:22 tbaldridge: time in Datomic is specified off of a integer, so each transaction is (inc T). This means that as long as you order your transactions according to history, there's really not much evil

23:23 futile: tbaldridge: see #datomic

23:23 didn't wanna clutter this with OT

23:43 egghead: core.async feels like a building block for a really cool event lib

23:44 futile: write that lib :)

23:44 egghead: I'm using it for a silly little cljs app, just wrote my first jasmine spec with it :) https://www.refheap.com/16897

23:45 futile: pfft, thats not even 30 lines of code

23:45 i mean.. whoa! thats not even 30 lines of code!

23:45 tbaldridge: egghead: I agree, I feel like it's going to enable some really awesome stuff. What that stuff is, I haven't a clue yet.

23:46 futile: is it like go's channels?

23:46 (and goroutines)

23:46 zRecursive: morning

23:46 futile: zRecursive: morning

23:46 tbaldridge: pretty much

23:46 callen: zRecursive: howdy

23:46 egghead: I have never published a clj lib but I might for some of this cljs stuff

23:51 futile: egghead: i still cant understand that code

23:51 but never mind, i think thats really just a function of how late it is plus how little sleep i got plus how much datomic i absorbed today

23:51 Raynes: can you make refheap more flat?

23:52 that round help icon in the bottom is too 3d

23:52 Raynes: flat is the new 3d

23:52 until 2015 when 3d will be the new 3d

23:52 egghead: :3

23:54 it just tests a thing that listens for xhr events and renders their response text to the dom, so instead of doing an xhr call I just pass it an event I own and spy on it

23:54 s/event/channel

23:56 also I have no idea what i'm doing :)

23:56 futile: :D

23:56 more than i

23:59 egghead: the whole rendezvous thing in core.async is so weird coming from js events

23:59 the notion that a message can only be read once

Logging service provided by n01se.net