#clojure logs

2013-07-24

00:06axle_512is there something like a 'with-open' macro, but one that deletes the file instead of closing it?
00:07axle_512I have a tmp file that I want removed by the time the function returns.
00:08bbloom_(defmacro with-file [f & body] `(let [x# …] (try ~@body (finally (doto x# .close .delete)))))
00:08bbloom_something like that
00:08axle_512bbloom_: thanks!
00:08rishdadecomplect
00:08rishdaI mean...
00:09rishdadecomplecjt
00:09bbloom_axle_512: just use (source with-open), copy paste, and go from there :-P
00:09axle_512bbloom_: got it, thanks
00:10axle_512bbloom_: I will study the macro… just didn't want to re-invent it if it was already there
00:40tomjackhyPiRion: just noticed your lazybot mail re (assoc weird :squared 4), makes sense :)
00:49xpeis the Clojure/West Pedestal video available?
00:51chouserxpe: not yet
00:51chouserwatch for it here: http://www.infoq.com/clojure-west-2013/
00:52xpechouser: thanks.
00:56chouseroh, 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."
01:03shaungilchrist:(
01:10rishdatechnomancy: see https://groups.google.com/forum/#!topic/clojure/qs3_0eYbDE0
01:11rishdaBecause test2 was too ambitious.
01:12rishdaGroups and nodes and such, that was a bad idea.
01:20xeqixpe: have you seen the pedestal tutorial?
01:20xpexeqi: yes
01:22tomjackrishda: "Fixtures: Nope." :)
01:22rishdatomjack: heh
01:22tomjackmakes sense
01:24rishdatomjack: 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.
01:24rishda(That's what I assumed once-fixtures were for.)
01:24tomjackehh I dunno
01:24callenrishda: futile?
01:24rishdaoh yeah
01:24tomjackI'm thinking you shouldn't need to do that
01:24rishdacallen: I was hiding from you cuz ur so mean
01:24callenrishda: I could tell it was you from your habit of blasting random people.
01:25tomjackI 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
01:25RaynesYa know what I'm gonna do? I'm gonna use clojure.test.
01:25rishdacallen: http://bit.ly/13CyI53
01:25callenRaynes: that's what the cool kids do.
01:26rishdaRaynes: not on refheap apparently
01:27RaynesRefheap doesn't have tests.
01:27RaynesI think you mean laser or fs.
01:27rishdanope i meant refheap
01:27RaynesThen I haven't the foggiest idea what you're referring to.
01:28rishdatomjack: I discovered that technique yesterday for getting rspec-like "let" functionality
01:28rishdatomjack: I haven't used it in practice but it looks promising
01:28callenRaynes: what are you going to use clojure.test with?
01:28tomjackrspec has "let"?
01:29RaynesSeriously, what are you talking about rishda?
01:29ddellacostatomjack: yep, I think it's a relatively recent addition though (relatively recent, in the last two years?)
01:29rishdatomjack: yeah, or speclj's "with" if you're more familiar with that
01:29rishdaddellacosta: maybe 3 years, yeah
01:29ddellacostaping callen
01:29rishdatomjack: http://betterspecs.org/#let
01:30rishdatomjack: or http://speclj.com/docs/with
01:31ddellacostarishda, are you the author of verily?
01:31rishdaddellacosta: yeah
01:31ddellacostarishda: what problems are you trying to solve by releasing another testing lib?
01:31rishdaddellacosta: well, first of all, there arent enough Clojure testing libs
01:32ddellacostarishda: I'm serious
01:32rishdaddellacosta: well, first of all,
01:32rishdaEvery time I go to use an existing one, some part of its API feels magical and wrong.
01:32ddellacostarishda: ...like?
01:33callenddellacosta: rishda is futile.
01:33rishdaddellacosta: well take midje for example. It's not clear how it even works in the first place. So I lose that referential transparency.
01:33callenddellacosta: try not to take him *too* seriously.
01:33rishdaddellacosta: yeah I'm futile btw.
01:33rishdaddellacosta: yeah don't take me *too* seriously.
01:33callendoes anybody here know what the deal is with nthFrom and .isArray?
01:33callenI'm seeing it pop up in an instrumented profiler snapshot and I'm kinda wary I'm being fed bad data.
01:34rishdaddellacosta: and with both expectations and midje, I don't like that the tests are at the top level.
01:35ddellacostacallen, 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
01:35rishdaddellacosta: and the way speclj uses exceptions to implement assertions makes it impossible to test pre/post conditions
01:35ddellacostarishda: at the top level, what do you mean? There are no such constraints in midje that I know of
01:35callenddellacosta: I'm one of those people that is perfectly happy with clojure.test
01:35rishdaddellacosta: fact/facts goes at the top level
01:36ddellacostarishda: what do you mean? top level? Top level of what?
01:36rishdathe namespace.
01:36ddellacostacallen: I like clojure.test just fine. There is some syntactical sugar in midje I'm quite fond of though
01:36ddellacostarishda: why is that a problem?
01:37rishdaddellacosta: It's not clear if requiring that namespace will run those tests or not. Also there's no way to run just "some" tests.
01:37rishdaddellacosta: with verily's test-functions, you can tag them with metadata, and run only matching tags.
01:38rishdaddellacosta: I guess you could look at how i separate assertions from tests as having a similar motivation for Clojure separating symbols from vars.
01:38rishdaddellacosta: I can run a test which contains several of assertions, and that gives me finer granularity and control.
01:38rishdaOkay maybe that's not the same motivation.
01:38ddellacostarishda: … 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
01:39rishdaddellacosta: Okay, Midje may have solved that. But my main reason for not liking Midje specifically is its syntax.
01:39ddellacostarishda: in clojure.test, I don't find it particularly painful to namespace tests either
01:39callenddellacosta: leiningen test selectors yo.
01:40rishdaddellacosta: I much prefer expectations's syntax, (expect empty? coll)
01:40callenthey're maaaaaagic.
01:40ddellacostarishda: okay, I can understand that. Midje does assume you'll buy into a whole way of working, and it uses a very specific syntax.
01:41ddellacostacallen: are you talking about profiles? I'm not sure I'm familiar with that!
01:41callenddellacosta: nuh uh, test selectors.
01:41ddellacostacallen: this? https://github.com/technomancy/leiningen/blob/master/sample.project.clj#L116
01:41ddellacostaneat
01:41dark_elementI 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.
01:41ddellacostadidn't know about that.
01:41callenddellacosta: yep.
01:41callenddellacosta: it's just functions and keywords based on deftest metadata
01:41callenddellacosta: works great.
01:43ddellacostacallen: 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
01:44rishdaLooks like "verily" was taken. Oops.
01:44callenddellacosta: not that I know of. I'd rather enjoy that too.
01:45rishdaddellacosta: test selectors are trying to go away, btw.
01:45rishdaddellacosta: btw in Verily you can run tests in the repl based on metadata.
01:45ddellacostarishda: 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
01:45ddellacostawhistles and sugar
01:46ddellacostarishda: I think you have some good points to make, but a lot of people are very invested in the libs that are out there.
01:46rishdaddellacosta: yeah I'll probably be its only user.
01:46ddellacostarishda: granted, if you just want something for yourself, you know, go nuts. :-)
01:46rishdaoh well.
01:47rishdaddellacosta: plus, keep in mind, it's a lot harder to modify someone else's lib, especially when they have tons of features.
01:48ddellacostarishda: I think it depends on how you define "harder."
01:48rishdaI'm not a good programmer, so I always have a hard time modifying someone else's code.
01:48callenrishda: learn!
01:48ddellacostarishda: instead of knocking on your abilities, read and modify other people's code, and then you will get better.
01:48callenrishda: it'll make you a vastly better programmer dancing to somebody else's tune and learning the steps.
01:49rishdacallen: It's not that I don't know how to code, it's that I'm not good at understanding other people's code.
01:49ddellacostarishda: what callen said.
01:49callenrishda: okay? so do it until you get better at it.
01:49ddellacostarishda: this is something that can be overcome.
01:49callenrishda: life is like karate kid man. Wax on, wax off.
01:49rishdaOkay let me reword it.
01:49rishdaTheir code sucks.
01:49ddellacostarishda: no, your attitude sucks
01:49rishdaAnd I'm not going to dive into that crap and polish it up.
01:49rishdaNot that I've looked at it really. I'm just assuming.
01:50rishdaFrom a few lines I have seen.
01:50ddellacostarishda: if that's what you really think then don't hide behind this false modesty bullshit. That is serious asshole crap.
01:50RaynesI'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.
01:50Raynes$google troll
01:50lazybot[Troll (Internet) - Wikipedia, the free encyclopedia] https://en.wikipedia.org/wiki/Troll_(Internet)
01:50Raynesddellacosta: ^ see this article.
01:51ddellacostaRaynes: 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
01:51RaynesI'm 19, man.
01:51rishdaI think I'm just reacting to my frustration with Joodo and Hyperion and Speclj.
01:51aaelonyhey guys, what's a good what to grab a random subset of a collection?
01:51ddellacostaRaynes: age does not imply maturity. ;-)
01:51rishdaI'm really, really frustrated with those libs.
01:51aaelonya good way (not a good what)
01:52rishdaYou would be too if you were using them every day.
01:52SegFaultAXaaelony: Can you be a little more specific about your requirements?
01:52ddellacostarishda: 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
01:52callenaaelony: https://github.com/bigmlcom/sampling http://asymmetrical-view.com/2010/10/19/sampling-a-sequence-with-clojure.html
01:52amalloyaaelony: https://github.com/flatland/useful/blob/develop/src/flatland/useful/seq.clj#L149, although i would write it a little differently now
01:52RaynesWell, you're using a web framework that nobody uses for starters.
01:53SegFaultAXaaelony: Are you looking for a random contiguous subarray, or just a random selection of elements from anywhere at all in the input?
01:53tomjackI found bigmlcom a couple days ago
01:53tomjackcool stuff
01:53rishdaddellacosta: 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.
01:53rishdaRaynes: Yes. Yes I am.
01:53tomjackI am playing with reservoir sampling w/ cascalog now
01:53aaelonySegFaultAX: 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
01:53ddellacostarishda: no
01:53rishdaoh fuck it.
01:54rishdai suck at open source
01:54ddellacostathis has nothing to do with open source
01:54RaynesWell, not necessarily.
01:54tomjackaaelony: if you only have 1000 rows, (take 50 (shuffle rows)) ?
01:54RaynesYour people skills leave something to be desired.
01:54rishdathis is the same thing that happened with Zephyros
01:54RaynesCan't say mine are particularly good though.
01:54SegFaultAXaaelony: See amalloy's link. That's a good approach to what you're looking for.
01:54rishdaI 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.
01:54aaelonytomjack: that might work. I'll be doing this repeatedly though
01:55rishdaSo I wrote Zephyros to fix those problems. And nobody uses it. It just sits there on github.
01:55rishdaSame thing here.
01:55aaelonySegFaultAX: cool, what is amalloy's link?
01:55callenwould it be utterly crazy to rewrite assoc-in in terms of transients?
01:55callenfor an inner-loop operation?
01:55amalloycallen: yes. it would gain nothing
01:55callenamalloy: YISSSS, I needs you. I have yourkit snapshots to divine.
01:56SegFaultAXaaelony: Scroll up.
01:56callenamalloy: 81% of the application is spinning in .isArray(), from nthFrom, from nth, from assoc-in.
01:56callenamalloy: for a coll that is a map.
01:56aaelonySegFaultAX: cool. got it. looks useful.
01:56amalloywhy are you nthing a map? that doesn't even work
01:57callenamalloy: it's assoc-in. I'm not nth'ing.
01:57amalloyit's not the map that assoc-in is checking for array-ness, it's the &args
01:57callenclojure.core$assoc_in.invoke(Object, Object, Object)
01:58callenamalloy: in that case, we'd be looking at the second argument, no? Is it normal for isArray to suck up so much time?
01:58amalloybbloom_ has a patch to make related stuff faster, though i'm not 100% sure it applies to your code
01:58callenI know about the RestFn patch
01:59callenthis isn't RestFn I don't *think*
01:59amalloyyeah, i think you're right
01:59callenamalloy: https://github.com/yogthos/Selmer/blob/master/src/selmer/parser.clj#L65
01:59callenamalloy: assoc-in there I believe.
02:01callenI 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.
02:02callenthat or YourKit is lying to me.
02:02amalloywell, isArray is reflection. that's slow
02:02callenamalloy: is there a way to short-circuit or avoid that?
02:03rishdaddellacosta: it's not arrogant to say something's better when it really is
02:03aaelonylooks like incanter.stats/sample does what I need as well. coolness
02:04amalloycallen: i think (map keyword (vec ...)) might help
02:04amalloyvec on a small array is supposed to be free-ish, and then you'll sidestep the isArray checks
02:06amalloybut i'm really just waving a dead chicken over it
02:08callenamalloy: I'll give it a whirl, thank you.
02:08clojurebotamalloy is nuts for juxt
02:08amalloyi don't understand the reason for the order of the clauses in RT/nthFrom or RT/seqFrom
02:08callenLOL
02:08amalloythey seem crazy to me, but i'm sure rich has a good reason
02:13rishdagfredericks: was it you who suggested returning list of assertions from a test-fn?
02:13rishdaI'm starting to like that idea a lot suddenly.
02:15rishdawell anyway, now that I've pissed off the hundredth community..
02:16callenrishda: talking about yourself again.
02:16callenrishda: just focus on doing useful things and making things.
02:16rishdacallen: do you believe in God?
02:16callenrishda: that's not relevant in a programming channel.
02:16rishdaoh man you ruined my awesome comeback
02:17rishdacallen: but thats ok i have a backup comeback: "dont be a jerk"
02:17rishdaoh fuck it. fuck it all.
02:21SegFaultAXWell, that ended abruptly.
02:23ddellacostawow, I set ignore so it seems like there was a whole conversation that happened I missed...
02:24callennot missing much.
02:25ddellacostafigured.
02:25ddellacosta;-)
02:26callenI feel strange "improving" upon core like this.
02:31rishdaIs there a way to delete a project from clojars?
02:31SegFaultAXrishda: Why do you want to do that?
02:32rishdaBecause this project is utterly and completely pointless.
02:32rishdaPlus it's already using the same name as another project. So I want to delete it.
02:32SegFaultAXrishda: Contact clojars, then.
02:34rishdaThanks SegFaultAX.
02:36futileddellacosta: solved the problem by deleting "verily".
02:37futileThanks for pointing out how much of an arrogant, selfish, idiotic ass I am. It's really been a breath of fresh air.
02:37futileAnd thanks to you too callen.
02:38callenfutile: still talking about yourself.
02:39futilecallen: you're right, totally stupid and wrong of me.
02:39futilecallen: stopping now.
02:39callenfutile: how about them Browns?
02:39callenfutile: oh no, uhm, Bears?
02:39ddellacostafutile: 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.
02:39futileddellacosta: I can't respond to you or callen will yell at me again
02:39callenfuck, my attempt made the code almost twice as slow.
02:39callenfuckity fuck fuck.
02:39callenand I don't even know why.
02:40callenwell I have a guess.
02:40ddellacostafutile: 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.
02:40futilecallen: it's probably using an internal type that isn't doing any structural sharing
02:40callenfutile: you don't even know what code I'm working on :P
02:41ddellacostafutile: I'm just some random guy after all.
02:41SegFaultAXLotta anger in the channel tonight. :/
02:41callenoh wait, that's faster now.
02:41callendafuq
02:42futileddellacosta: 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.
02:42callenWHOA
02:42futileddellacosta: which means the whole project was arrogant and idiotic from the beginning of its inception.
02:42futilecallen: it was, wasn't it?
02:42callenno it wasn't
02:43callenit was something related to bbloom's patch
02:43callenthat I just worked around
02:43callenand made the whole library like 3-4x faster
02:43callenI'm going to go dance in my courtyard naked now, brb
02:43callenamalloy: you are scary.
02:45SegFaultAXfutile, ddellacosta: Can you two carry this on somewhere else?
02:45futileSegFaultAX: we are.
02:45SegFaultAXfutile: Thanks.
02:46ddellacostaSegFaultAX: apologies.
02:47callenif this bears out in the full benchmarks this is going to be a real coup.
02:47SegFaultAX#clojure has almost, but not quite, as much drama as #python. And we're like, 1/20th the size.
02:47callenSegFaultAX: we need a dash.
02:47futileThere's no drama except when I'm around.
02:47futileJust have someone ban me, problem solved.
02:47callenactually, they'd need to ban me too.
02:48ddellacostaSegFaultAX: I actually try hard to keep drama out of my interactions, so I do sincerely apologize.
02:48callenbut I make really good chicken pot pies, so they let me stick around.
02:48futileddellacosta: stop being so dramatic
02:48callenguys,
02:48callenjesus, I'm laughing so hard at you right now. Just chill. :)
02:48futilecallen: stop talking about yourself
02:48callenso lesson of the day is, destructuring is evil, .isArray is evil, all reflection is evil, assoc-in is evil.
02:49callenand don't fucking use definterface.
02:49callens/lesson/lessons/g I guess.
02:49ddellacostaEEVIILLL
02:52callenhrm.
02:52callenwell. nuts.
02:53callennormal'ish benchmark is 4x faster
02:53callenweirdo benchmark suite is 10x slower.
03:02ddellacostawell then back to clojure
03:03callenddellacosta: trying to write optimized versions of core functions. I am quickly going mad :P
03:04ddellacostacallen: wow. Sorry, I was half-following along…you are working on, what, assoc-in?
03:04callenyeah sorta.
03:04ddellacostacallen: mind running it by me again?
03:04callenddellacosta: https://github.com/yogthos/Selmer/blob/master/src/selmer/parser.clj#L65
03:05callenthe assoc-in is sucking up a bunch of time.
03:05ddellacostahmm,
03:05callenmostly nth/nthFrom/.isArray()
03:05ddellacostahuh
03:05callenyeah, I know. I had the same reaction.
03:06callenso I'm trying to write a reflection-less version of assoc-in.
03:07callenthe problem, if I understand correctly, is the [k & ks]
03:08ddellacostahuh, so, I actually haven't seen that destructuring syntax before, neat
03:08ddellacostacallen: but, it's slow?
03:08callenddellacosta: hellaciously.
03:08ddellacostacallen: so, dumb question, what about a super-stupid version that just tests if (seq k) or something, without the destructuring?
03:09callenuhm, that's sorta what my version does
03:09callenand my version *seems* to be faster.
03:09ddellacostagotcha.
03:09callenin one benchmark my version makes the *entire library* 4x faster
03:09callenyet in another, it's 10x slower.
03:09ddellacosta!?
03:09clojurebotCLABANGO!
03:09ddellacostahahaha I loves you clojurebot
03:09callenactually, that's the library this will replace...
03:10callenno seriously, it's a replace for Clabango.
03:10callenI'm going to have to think carefully about the benchmark design.
03:10ddellacostaha, really? that's funny in any case
03:10callenddellacosta: https://gist.github.com/bitemyapp/6068547
03:10ddellacostaGood help on that one
03:10callenddellacosta: it's horrendous.
03:11callenI feel bad for having written it.
03:11callenbut it (seems?) faster.
03:12ddellacostahuh, trying to figure out how you'd get rid of that let/if thing without breaking it
03:13callenyeah, it's consistently slower with huge inner loops.
03:13callenfrick.
03:13ddellacostayou mean compared to the standard version?
03:14ddellacostawell, I'm sorry, I'm not going to be a lot of help on this one. :-(
03:15callenddellacosta: it's fine
03:15callenddellacosta: uhm, no it's scoped to the library, not between assoc-in and assoc-in*.
03:15callenddellacosta: I'm not micro-benchmarking them directly.
03:15ddellacostacallen: ah, okay
03:15callenmaybe I should?
03:17ddellacostacallen: 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
03:23tsdhIs there something to keep a dynamic binding intact when realizing a lazy seq other than wrapping the computation with a doall?
03:24tsdhE.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.
03:26hyPiRionnot 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.
03:45anildigitalI don't get what is the issue with this factorial function
03:45anildigitalhttps://gist.github.com/anonymous/8ef81eaad0b22f3a8429
03:45anildigitalit doesn't work for factorial(2) and ..
03:45SegFaultAXanildigital: It isn't valid.
03:46anildigitalSegFaultAX: what's the error there
03:46tomjackanildigital: http://tomjack.co/image/54583598271
03:46SegFaultAXanildigital: You've mixed fun() style calling with prefix notation.
03:46hyPiRionanildigital: (factorial (- n 1)) instead of factorial((- n 1))
03:47anildigitaltomjack, SegFaultAX thanks
03:48SegFaultAXanildigital: You'll get used to it. Then you'll wish every language used prefix notation. :)
03:48SegFaultAXI 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. :)
03:49djcoinI 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
03:50djcoinWhat 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) ?
03:50djcoinThanks :)
03:50anildigitalhttps://gist.github.com/anonymous/95456e1cc9c390877a52 doesnt compute (factorial 100003N)
03:51SegFaultAXanildigital: 2 things: 1) Deep stack is deep, 2) auto-promoting multiplication using *'
03:52anildigitalSegFaultAX: no simple solution?
03:52SegFaultAXdjcoin: Depends on the nature of the destructuring. It's very common to see (let [[a b c] (fn-that-returns-2-values)] ...)
03:53SegFaultAXanildigital: Clojure has a recur macro that makes explicit tail calls possible.
03:56djcoinWell, 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
03:57SegFaultAXdjcoin: 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.
03:57SegFaultAXdjcoin: What other languages are you used to?
03:59djcoinSegFaultAX: don't know, ocaml, python, etc. ? Disclaimer: i'm fairly new to clojure
04:01SegFaultAXdjcoin: Ocaml supports patterns matching and destructuing which Clojure has (check out core.match for pattern matching in clojure)
04:01SegFaultAXdjcoin: Python doesn't really have general purpose destructuring. Its multiple assignment form can pull apart lists and tuples, but that's about it.
04:07djcoinSegFaultAX: 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 ?
04:07djcoinA vector ?
04:08SegFaultAXdjcoin: What do you mean a tuple-destructuring way?
04:08morphlingdjcoin: probably a java object array
04:08SegFaultAXdjcoin: Note that Clojure doesn't have a tuple data type.
04:11djcoinalright, wouldn't a completely immutable (I don't mean functional datastructure) and destructuring tuple be a good fit for this ?
04:12SegFaultAXdjcoin: All of Clojure's built in datastructures are fully immutable, so yes.
04:13SegFaultAXdjcoin: Vectors are common where you might otherwise be using tuples.
04:15djcoinYup, but my question was WHY are we not using the simplest datastructure for this, some "tuple". But it does not matter, thanks SegFaultAX :)
04:17morphlingdjcoin: there is no tuple in the JVM
04:17SegFaultAXdjcoin: Your question is nonsense. How is a tuple /more/ simple than an immutable vector?
04:18hyPiRionSegFaultAX: because tuples aren't persistent?
04:20SegFaultAXhyPiRion: Huh?
04:21djcoinThanks hyPiRion =) Even if this is about nitpicking, just wanted to understand this
04:22SegFaultAXExcept that's an implementation detail and has nothing to do with tuples in particular. So, no.
04:22amalloySegFaultAX: 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
04:23djcoinYeah, that's my point
04:23SegFaultAXImplementation details. There is nothing inherently /more/ simple about them.
04:24djcoinmorphling: could not you create some "tuple" type with a simple class taking up to ten args and implenting the destructuration thing ?
04:25hyPiRionSegFaultAX: Simple as in "not compound", right?
04:25SegFaultAXhyPiRion: The issue isn't persistence. It's structural sharing (which are orthogonal at an implementation level)
04:25SegFaultAXYou could have a vector implementation that was COW and still persistent.
04:31hyPiRionSegFaultAX: Right, whether it's structural sharing or persistence we call it, the question is still there: Is "not compound" the definition we go by?
04:33yatiHi. 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?
04:34SegFaultAXyati: ls -laF inside your project root after running lein deps.
04:34hyPiRionThe 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.
04:35SegFaultAXhyPiRion: You could create a function that takes an n-tuple and a value, and returns an n+1-tuple, though.
04:35hyPiRionyati: Leiningen keeps them in a .m2 (maven) directory, which it'll place in your local home directory
04:36tomjackSegFaultAX: how could you have COW and persistence?
04:36yatiSegFaultAX, that does not show anything interesting: http://paste.lisp.org/display/138177
04:37yatiAh
04:37hyPiRionSegFaultAX: 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
04:37yati~/.m2 it is
04:37clojurebotNo entiendo
04:37SegFaultAXtomjack: Persistence just means that previous version remain available for read/write. There is no requirement that it also uses structural sharing.
04:37hyPiRion(Or at least I am)
04:38tomjackoh, hmm
04:38tomjackI 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 :)
04:38tomjackdown to
04:39tomjackI don't understand how to live with only guava and no clojure collections :O
04:43SegFaultAXhyPiRion: 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.
04:43SegFaultAXAnd since we don't have tuples in Clojure [by default] anyway, then it's an entirely moot point.
04:43SegFaultAX(inc hyPiRion)
04:43lazybot⇒ 16
04:44djcoinhm
04:46hyPiRionSegFaultAX: yeah, it's kind of a useless discussion :p
04:46hyPiRionoh, I wondered if Raynes has fixed that bug yet
04:46hyPiRion(inc HYPIRION)
04:46lazybot⇒ 17
04:46hyPiRionlol, oh well.
04:46llasramhiredman made a go at creating tuples for Clojure at one point: https://github.com/hiredman/tuples
04:47RayneshyPiRion: Alan fixed it.
04:47djcoinWhy would not having tuple by default prevent make it irrelevant
04:47djcoins/prevent//
04:47hyPiRionRaynes: yeah, but it's not deployed
04:47hyPiRionyou need to restart lazybot or something
04:48djcoin"Elapsed time: 7870.339 msecs" vs "Elapsed time: 130419.589 msecs" - not bad!
04:48djcoinalmost half
04:49llasramYeah, but that's just for access, and IIRC I couldn't replicate anything like that difference under criterium
04:49RayneshyPiRion: I don't know what you're talking about.
04:49Raynes(inc HYPERION)
04:49llasramdjcoin: When I included construction time under benchmarking, they provided no statistically significant benefit over vectors
04:49lazybot⇒ 1
04:49RaynesIt works fine, hyPiRion.
04:49hyPiRion(inc HYPIRION)
04:50lazybot⇒ 18
04:50hyPiRion:(
04:50total702hi
04:50hyPiRionRaynes: oh right
04:50djcoinllasram: oh, alright :d
04:50hyPiRionnevermind
04:50RayneshyPiRion: ?
04:51hyPiRionRaynes: I am trying to make it look like it works fine.
04:51Raynes(inc HYPIRION) ; Honestly sir, I think you're seeing things.
04:51lazybot⇒ 19
04:51llasramjdoliner: (where for future reference, criterium is https://github.com/hugoduncan/criterium )
04:51total702can I make a web app with clojure?
04:51RayneshyPiRion: Try again.
04:51llasramer, that was supposed to be ^^ djcoin
04:52hyPiRion(inc HYPIRION)
04:52lazybotYou can't adjust your own karma.
04:52hyPiRionwehee
04:52hyPiRion(identity hyPiRion)
04:52lazybothyPiRion has karma 19.
04:52RaynesI was messing with you. Trying to keep you occupied while I restarted the bot and made you think you were crazy.
04:52RaynesUnfortunately after I did that I forgot to actually pull before restarting.
04:52hyPiRionyeah, I figured
04:53RaynesSo plan foiled.
04:53hyPiRionno matter, works fine now
04:53llasramtotal702: Yes
06:27ddellacostahuh, jdbc insert! returns the record that was inserted? I thought it was going to return the ID...
06:34patrkriswould 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
06:37SomelauwWhen using lein repl, the "home" key does not work. ctrl+a does work, but I'm already using that key for tmux.
06:47ro_stis there some nifty way to invoke a function in a running jvm process from the cli?
06:48ro_stinstead 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
06:48ro_stthis is not for use on production servers.
06:49ro_sti guess i could expose something on the web and curl in
06:55noncomis 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/
06:57ro_stsounds like a job for defprotocol :-)
06:58noncomro_st: oh, a good point!
06:58noncomforgot about them...
06:58ro_sti'm envious. this is a great learning opportunity for you
06:58ro_stwe've not yet had a need for this.
06:59noncomwhat is strange, i almost do not use protocols or multimethods, i just use very basic clojure...
06:59noncomso far it suffuced :)
06:59noncoms/suffuced/sufficed
07:00ro_stthat's exactly why we haven't used it yet. haven't needed to :-)
07:00ro_stjust a matter of time, though.
07:00noncomyeah, and scale. the current project is of a bigger scale than i ever did, esp with clojure
07:03ro_stnoncom: there's a nice use of protocols in the Pedestal tutorial when dealing with real and mock services
07:04ro_sthttps://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
07:07noncomro_st: nice! i will have a look!
07:07jonasenHas anyone built a clojurescript pretty printer yet?
07:08ro_stjonasen: does pprint not work?
07:09jonasenro_st: not ported to clojurescript AFAICT
07:09Guest__hello i have a question. what exactly happens in this case?
07:09Guest__,(select-keys [1 2 3 4 5] [1])
07:09clojurebot{1 2}
07:10noncomjonasen: i think that since cljs generates js, pretty-print is only possible for uncompiled cljs code ... ?
07:10Guest__when i look at the documentation i see it can only be used on maps. thanks.
07:10noncom,(select-keys [1 2 3 4 5 6] [1 2])
07:10clojurebot{2 3, 1 2}
07:10noncomGuest__: so it first conerts the vector to map
07:10jonasennoncom: I don't see why that would be the case
07:10noncomjonasen: well, idk then
07:11noncomGuest__: (into {} [1 2 3 4 5 6])
07:11noncom,(into {} [1 2 3 4 5 6])
07:11clojurebot#<IllegalArgumentException java.lang.IllegalArgumentException: Don't know how to create ISeq from: java.lang.Long>
07:11ro_stwhat happens when you try pprint in cljs?
07:11noncom(into {} (partition 2 [1 2 3 4 5 6]))
07:11noncom,(into {} (partition 2 [1 2 3 4 5 6]))
07:11clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.Long cannot be cast to java.util.Map$Entry>
07:12jonasenI wonder how much work it would be to port brandonbloom/fipp to clojurescript
07:12jonasenbbloom_: ^
07:12noncom,(into {} (mapv #(into [] %) (partition 2 [1 2 3 4 5 6])))
07:12clojurebot{1 2, 3 4, 5 6}
07:12noncomhmmm..
07:13noncom,(select-keys [1 2 3 4 5 6] [1 2 3 4])
07:13clojurebot{4 5, 3 4, 2 3, 1 2}
07:14noncomoh, so it takes the element with index N and creates a pair {N element-N} and then makes a map of the pairs
07:14noncom,(select-keys [1 2 3 4 5 6] [0 1 2 3 4 5])
07:14clojurebot{5 6, 4 5, 3 4, 2 3, 1 2, ...}
07:16noncomtechnomancy: 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
07:20noncomso far, as i look into sources, i see it is, but just to confirm that...
08:28SomelauwWhen using lein repl, the "home" key does not work. ctrl+a does work, but I'm already using that key for tmux.
08:29SomelauwAlso, trying emacs. I remember from previous time that I need clojure-jack-in, but I don't know what happened to that package.
08:29noncomyou mean repl-jack-in?
08:30noncomemacs live has it in the package
08:30noncom(for example)
08:31noncommy knowledge on emacs reaches its limit at this point
08:32Somelauwnoncom: eh, yeah, whatever it's called. Just that I can ctrl-c, ctrl-c a paragraph of code
08:35SomelauwIt used to be called clojure-jack-in
08:37maionrepl-jack-in in nrepl.el
08:39Somelauwmaio: nope, doesn't work
08:40maiodo you have nrepl package installed?
08:41maioSomelauw: http://clojure-doc.org/articles/tutorials/emacs.html
08:48Somelauwmaio: thanks
08:52jvchttp://vimeo.com/22798433
08:52jvcemacs-live
09:01instilledhey! 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
09:32futileWhat do you guys think of forcing assertions to be in tail-position in a test?
09:33djcoinIs there any map librairy à la googlemap/leaflet etc. in clojurescript ?
09:33marianoguerrahi, 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?
09:36faust45hi guys
09:36faust45which tool i can using for deployment on AWS ?
09:37futilefaust45: we use boucher
09:37futilehttps://github.com/8thlight/boucher
09:38faust45futile: its ruby gem, is it work well with clojure apps ?
09:39jkkramermarianoguerra: you could put the google libs on clojars, under your group id
09:39gfredericks$mail rishda I don't remember suggesting anything like that
09:39lazybotMessage saved.
09:40jkkramermarianoguerra: i've done that for a couple java libs before that weren't on maven
09:40futilefaust45: we use it to deploy a Clojure app
09:40futilefaust45: 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™
09:40futilegfredericks: oh it was probably tsomething
09:40marianoguerrajkkramer: I don't want google knocking on my door :)
09:41marianoguerraI guess if they are not there is for a reason
09:41jkkramermarianoguerra: if they're open source, it think it's ok (IANAL)
09:42futilegfredericks: oh sorry I think it was tbaldridge
09:48tolitiusyesterday 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.
09:48futilegfredericks: also rishda was me, sorry for the confusion
10:32dnolenjonasen: fresh cljs + tests seems to work for me.
10:37jonasendnolen: weird. I'll have to try again (later)
10:57gfredericksfutile: np
11:12futileFigured out a way to do flexible fixtures with a flat test suite (i.e. no grouping/nesting)!
11:12futilehttps://github.com/evanescence/verily/issues/1
11:13futileThat only works for around-each though. I'm not sure around-all is necessary, is it?
11:13futileI suppose the same principle can be used for around-all.
11:23`cbpyogthos: hi
11:25bbloom_$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:25lazybotMessage saved.
11:25futile$mail bbloom_ hi.
11:25lazybotMessage saved.
11:25bbloom_futile: hi
11:26futilebbloom_: how did you know? you didn't check your messages...
11:26bbloom_lol
11:26futileIs there any legitimate use for around-all? It seems to just complicate things badly. https://github.com/evanescence/verily/issues/1
11:26bbloom_oh, i didn't realize that's how it works
11:26bbloom_sooo that guy will never see that message, huh?
11:26bbloom_$mail
11:26futilebbloom_: happens to the best of us
11:26bbloom_boo.
11:26bbloom_i was hoping it was on channel join
11:27futilebbloom_: it does.
11:27futilebbloom_: but you didn't part and rejoin.
11:27bbloom_ah, ok. well then that guy will get it when he shows up
11:31eggheadasync testing in cljs D:
11:34arrdemis there a reasonable Clojure assembler DSL already?
11:34eggheadarrdem: something like https://github.com/halgari/mjolnir ?
11:36arrdemegghead: eh, mjolnir is higher level than I'd like, but I really do need to sit down and get a handle on it.
11:47faust45is it possible some how change folder and reload namespaces ?
11:48faust45i want deploy with capistrano
11:48faust45and fast reload
11:48technomancyfaust45: that's not going to work
11:48faust45capistrano create new folders for each release
11:49faust45technomancy: but which way you can suggest ?
11:49technomancydeploying your whole source directory for clojure apps is a pretty bad idea
11:49technomancychuck an uberjar out there
11:49arrdemtechnomancy: really? that's now the compojure stuff I've seen works... how do you hot reload an uberjar?
11:49technomancyideally an uberjar built in a neutral environment like a CI server
11:50faust45technomancy: but is it possible fast restart using uberjar ?
11:50technomancyarrdem: 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:51technomancyfaust45: bring up the new version on another port and redirect traffic at your load balancer
11:51arrdemtechnomancy: ah right. til.
11:51futileWhat do you guys think of the names "verify" and "verity" instead of "verily" for a testing lib?
11:52ChongLitoo similar
11:52arrdemfutile: unless you do theorem proving don't use verify.
11:52futilearrdem: good point
11:52futileChongLi: that's the fun of it though
11:52TimMcCall it "guardrails".
11:52faust45technomancy: ok thanks
11:52ChongLihaha
11:52futileI think "verity" is the correct-est. It's about documenting the "truth" of your application.
11:53ChongLiI thought static types were guard rails?
11:53TimMcThere's some video where rhickey says that relying on TDD for correctness is like steering by bouncing off of guardrails.
11:54arrdemChongLi: they are guard rails, but they can prove out entire classes of errors.
11:54ChongLiperhaps my memory is fuzzy, but I thought he said that exact thing about static types
11:54TimMc(This made some people mad, but his point about *relying* is a good one.)
11:54xeqiI like my guard rails
11:54arrdemguard rails are better than no rails...
11:54jagajpeople get 'mad' over that?
11:54futileI'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:55futileBut this lib isn't about TDD, it's just about writing tests.
11:55TimMcjagaj: TDD fans who were looking for a fight did.
11:55jagajthat's insane :|
11:55ChongLisome people get mad whenever they hear an opinion that conflicts with their own
11:55futileAnd those tests really just tell you what's true about your program.
11:55arrdemproof by being bloody obvious backed by a type system and some tests is my approach :D
11:55technomancyjagaj: he was intentionally needling people
11:55TimMcjagaj: And people conveniently forgot the "relying on" bit.
11:55TimMcOr it hit too close to home. :-P
11:56TimMcSo 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:57arrdemfutile: gh link? I'm curious now.
11:57futilearrdem: https://github.com/evanescence/verily
11:58arrdemfutile: and the use case over core.test is...
11:59technomancyarrdem: clojure.test is abandoned
11:59TimMcand not composable
11:59arrdemthat's a good reason!
11:59arrdems/reason/use case/g
12:17TimMcFuck, I'm practically tearing up over here.
12:17TimMcA friend's rather larger-than-life cat just died.
12:20TimMchttp://abbie.blogspot.com/
12:24h0bbitas a fellow cat-lover, my condolences.
12:33TimMc(Bah, just realized I posted in the wrong channel. Ah well.)
12:35futileTimMc: I can't see how this or any channel is the wrong channel for it.
12:36TimMcWell, the one I meant to post in is more geographically focused; Abbie was kind of a local celebrity.
12:39futileOkay. 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:42technomancyhttp://tardis.wikia.com/wiki/Verity_Lambert
12:43futiletechnomancy: ah! you figured out who I named the project after! well done.
12:43technomancyheh
12:43futileKinda sucks that verity is also a popular name.
12:45bbloom_technomancy: so worth on the street is you're the new sherif around these parts
12:46futileOh I know. I'll pull a technomancy and name it Deathwater.
12:47jkkramerfutile: there's also already a clojure lib named verily ;) https://github.com/jkk/verily
12:48futilejkkramer: yep, see my mailing list apology to you from last night
12:48futilejkkramer: and verity is admittedly too similar to verily
12:48jkkramerah, haven't checked the ML today
12:48jkkramermeh
12:48jkkramerverity seems fine
12:50futileNo, too many problems.
12:51futileWell the name will have to wait then.
12:52futileI don't like any name so far.
12:52eggheadyay I finally got lein cljsbuild test to run jasmine specs :)
12:53technomancybbloom_: looks like it. you better behave. =)
12:55dnolenpretty sweet Carin Meier at OSCON talking robots & Clojure http://www.oscon.com/oscon2013/public/content/video
13:10arrdemWhat 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:15llasramarrdem: What determines which backing implementation gets invoke?
13:16futileI'm wondering when the day will be that someone makes a Leiningen competitor.
13:16futileEvery tool has at least one competitor, no exceptions.
13:16llasramIt's called maven
13:16futileMaven isn't Clojure-specific though.
13:16llasramWas meant to me a joke
13:16futileoh
13:16llasramThere used to be cake, but it got merged-precated
13:16futileoh
13:17llasramLeiningen is just too awesome to compete with
13:17technomancyhttps://bitbucket.org/clojuresque/clojuresque <- actually predates lein
13:17technomancyI think
13:17futilellasram: I agree, but I'm betting someone's eventually gonna create an rbenv to leiningen's rvm.
13:17arrdemllasram: clients will choose an imp'l explicitly, arguably as a top of ns item even.
13:18futilenot that I think leiningen is like rvm in terms of badness, just in size.
13:18technomancyhuh, initial commit predates lein by a just a couple weeks
13:19llasramfutile: I'm skeptical, just because there isn't any friction to making leiningen do what you want to do.
13:19futiletrue
13:20futileanyway not worth giving too much thought to
13:20dobry-denalso, clojure community is just so small.
13:20llasramarrdem: But without explicitly requiring separate namespaces for the separate implementations?
13:21futiledobry-den: are we really?
13:21futilePeople say that, but I don't believe we're really much smaller than Python or Ruby communities were just 5 years ago.
13:22arrdemllasram: 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:23dobry-denfutile: yeah, i mean less saturated
13:24llasramarrdem: 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:24llasramNo magic backend-selection necessary
13:24arrdemIL?
13:25llasramIntermediate language
13:25arrdemIntermediate Language?
13:25llasram:-)
13:25arrdem:P
13:26arrdemI 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:26arrdemand at that level you (being a user) know what you are targeting and code is likely to be arch specific.
13:27dobry-denfutile: 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:27arrdemso really a (require '[cljasm.x86 :refer assemble]) should be all that is needed there
13:27futilehmm
13:27futileyeah
13:29llasramarrdem: 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:29llasramEither way, get an AST or IL and give to your `assemble` function
13:29dobry-denfutile: dunno what my point is or how it relates to lein tho
13:29futile:)
13:30futiledobry-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:31dobry-deni 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:31callendobry-den: need deeper knowledge. That said, it's not out of the question to learn some Clojure that way.
13:32arrdemllasram: thanks for the advice.
13:32callendobry-den: I answer peoples' questions in here through mere googling far more often than you might suspect.
13:32arrdemllasram: having an IL even simplifies the compiler I'm building atop this! yay!
13:32llasramglad to help :-)
13:33futiledobry-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:33futiledobry-den: is that what you're talking about?
13:34technomancyhas there actually been a release that fixes the AOT bustedness?
13:34llasramcore.match's exception-based flow control is quite interesting
13:35llasram(not in the core.match code -- in the macroexpansions)
13:36llasramtechnomancy: It's still in RC
13:36dobry-denthe 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:37futileyeah. some of the things I love most about Clojure, I wouldn't appreciate unless I was tortured by Ruby first.
13:37technomancyllasram: gotcha
13:37futileI guess what I love about Clojure is its anti-features.
13:37futileAnd it's hard to appreciate something that's not there until you've seen why it's painful for it to be there.
13:37dobry-denfutile: 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:38futileoh yeah, thats true.
13:38futileI was debating to teach my brother Ruby or Clojure, and I went with Ruby, partially because the syntax.
13:38llasramtechnomancy: 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:38arrdem,(doc mapcat0
13:38clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
13:38arrdem,(doc mapcat)
13:38clojurebot"([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:38technomancyllasram: encouraging, yeah
13:38futileGranted, I had to explain to him several (several) times that << is not similar to =, it's just that Matz is weird.
13:39technomancyfutile: did you consider racket?
13:39dobry-denfutile: lighttable is what let me convert some of my python friends.
13:39futiletechnomancy: nope. I also chose Ruby because it's got lots of entry-level jobs now.
13:39technomancya lot less newbie-hostile than clojure without throwing out the part about actually being thoughtfully-designed
13:40futiledobry-den: ah, hmm
13:40technomancyoh yeah, but if he's looking for work that's different
13:40futileSeriously though, why << ... sigh
13:40dobry-denlike [] << 1?
13:40futileI 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:40futileyes
13:41futileHe kept thinking it was some kind of assignment.
13:41dobry-deni could see if he's used to bitwise operators but ruby as my first language just made me think << meant "push"
13:41futilethat's one of the places I think Clojure would probably have been easier
13:41technomancyfutile: everyone gets pass-by-reference vs pass-by-value at first; it's such a headache
13:42futileAh! "attest"!
13:42futilethat seems better than verity.
13:42TimMc"aver"
13:42futiletechnomancy: you mean, conflates them?
13:43futileTimMc: oh man, oh man oh man
13:43dnolengood list of things to make faster in ClojureScript if anyone is interested http://wagjo.github.io/benchmark-cljs/ ;)
13:44arrdemgod pass by reference had me confused for a solid three weeks when I was getting started :/
13:44futileTimMc: 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:45arrdemfutile: do we have a library "sphynx" yet?
13:45futileclever!
13:45futilearrdem: but I'd never be able to spell it right.
13:45TimMcI tend to use names from scientific nomenclature, e.g. "chelydra" for a bookmarking app.
13:46TimMcs/scientific/biological/
13:46futilethe 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:46arrdemfutile: I just thought it's cute because it implies questioning (tests) without any hint of proof.
13:46futileAnd Zephyros was some ancient mythical god having to do with wind.
13:46futilearrdem: ha
13:47hyPiRionarrdem: if we're going to imply questioning you're better off with CIA or Police or something
13:47arrdemhyPiRion: I'm trying to decide whether I can manipulate my NSA threat score with this conversation.
13:48ystaelthe world totally needs public NSA threat leaderboards
13:48TimMcarrdem: For what kind of project?
13:48arrdemystael: lol that'd be awesome
13:49arrdemTimMc: the naming thing or the nsa thing?
13:49TimMcnaming
13:50arrdemthe clojure assembly DSL llasram and I were talking about 50 lines back
13:51ystaelarrdem: call it "lda clojure,x" :)
13:53futileI could name it "olive" after the test Penelope gave Odysseus. But that's a stupid name.
13:53futileAll names are stupid.
13:54TimMc"leiningen" is a damn good name
13:54TimMcand I'm not just saying that because technomancy has op :-P
13:54futileyeah, technomancy's names are fine.
13:54futileI don't like bultitude at all, but that's the only one that makes no sense.
13:54technomancyin my defense I was given no context for that one
13:54technomancyjust "I need a name, stat"
13:55futileha
13:55technomancyfutile: but you've read That Hideous Strength, right?
13:55futiletechnomancy: I've only read Alice in Wonderland (and Through the Looking Glass) and the Chronicles of Narnia.
13:55futileOh, and A Tree Grows in Brooklyn once, in college.
13:55futile(for literature class)
13:56futileApparently I don't much care for grown-up stories, I guess.
13:57futileWell, 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:58arrdemwell tbaldridge already took mjolinr for his llvm toolkit so since he's the hammer I'll take the anvil. geirr it is.
13:58jonasenbbloom_: 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:58ystaelfutile: "ordeal" ?
13:58technomancyfutile: That Hideous Strength is Lewis's best fiction IMO
13:58futileTraditional naming schemes are super boring and just as hard to find. This naming scheme is more fun, but still hard.
13:58futiletechnomancy: oh. didn't know he wrote other stuff (besides astounding christian apologetics)
13:59technomancyfutile: it's the third in a trilogy, but the first are more philosophical and less approachable
13:59technomancyfirst two
13:59futiletechnomancy: do you bring it up because it contains a good testing lib name?
13:59technomancyfutile: oh, no it's because Bultitude is from that book
13:59futileooh
13:59technomancybut you should read it anyway
14:00futilei might now
14:02futiletechnomancy: heh, nice.
14:02hyPiRionarrdem: what. You must use Gungnir for that
14:03arrdemhyPiRion: appologies. I guess my english->norse dictionary is a lying waste of dead trees.
14:04futileokay im torn between "aver" and "attest", leaning towards attest. can you guys choose for me?
14:04futilei hate naming libs.
14:04arrdemhyPiRion: spear of odin? oh thor's hammer... cute!
14:04futilei always get it wrong.
14:05bbloom_jonasen: i'm using finger trees for left pop and right push/pop
14:05bbloom_jonasen: will rbb trees cover that?
14:05arrdemhyPiRion: I really want to go with toothpick so I can quote http://www.songworm.com/lyrics/songworm-parody/EternalFlame.html
14:06futilearrdem: i so would
14:06futilethats perfect
14:06ystaelfutile: aver is IMO less preferable because more likely to appear as a subword of other words you want to use
14:06hyPiRionarrdem: hehe
14:06futileystael: very good point
14:06ystaelwhereas 'fattest' rarely appears in programs
14:06ystael:)
14:06futiletrue but attest barely looks like a full word in itself
14:07arrdemok two other people thought it was funny too. toothpick it is. the compiler will be Gungnir.
14:07jonasenbbloom_: I haven't tried it but I thing both subvec and concat is fast for rrb-vector. so that should cover it
14:07jonasen*think
14:07bbloom_jonasen: i don't need subvec or concat
14:07hyPiRion\o/
14:07MrRacoon /win 6
14:08jonasenbut if they are fast enough it's trivial to implement left/right push/pop ?
14:09bbloom_jonasen: maybe. i dunno. why don't you fork it and try to switch to rbb?
14:09bbloom_jonasen: the operations you need to grep for are: first, peek, conjl, and conjr
14:09bbloom_i'm curious what the perf is that way too
14:10jonaseni've already forked it :)
14:10justin_smithfutile: the obvious new testament based name for a testing lib is Thomas
14:10futilehmm, guys what about "certainty" or "certitude"?
14:10futilejustin_smith: ha, he needed proof. heh.
14:10bbloom_jonasen: glorious. let me know how it goes :-)
14:11futilejustin_smith: but I don't think it's appropriate to name a lib after something in the bible
14:11futileoh!
14:11futileBacon.
14:11futilethat's it.
14:11technomancybacon is a ruby testing lib
14:11bbloom_isn't bacon like unslow rspec?
14:11justin_smithpudding - the proof is in it
14:11futilehttp://en.wikipedia.org/wiki/Roger_Bacon
14:11hyPiRionFrance is Bacon.
14:11futileoh fff, did they use that name for the same reason?
14:12technomancyfutile: also, read https://en.wikipedia.org/wiki/The_Name_of_the_Rose
14:12justin_smithcrucible - it is where things are proven
14:12technomancythe protagonist is a disciple of Bacon
14:12futilejustin_smith: (1) heh, (2) heh
14:13stuartsierraHere's a novel idea: name your library for what it does, with a domain-name-based groupId to avoid clashes.
14:13justin_smithjust generate a uuid, and done
14:14bbloom_stuartsierra: bah. where's the fun in that? plus who likes all those extra src/org/whatever/folders?
14:14futilestuartsierra: so kinda like test2
14:14hiredmanif people would just use uuids for function names we wouldn't need namespaces
14:14justin_smithseriously
14:14stuartsierraBah, I give up. :P
14:14futileyou gave up way easy
14:14stuartsierraI knew it was a hopeless goal. Just couldn't stop myself.
14:14futilebut yeah, in all seriousness, this is both the most fun and the most hard part of writing a lib.
14:14hiredmanbbloom_: group-id/artifact-id in maven is orthogonal to namespace names and file structure in clojure
14:15futilebut either way, it cant be cheated.
14:15bbloom_hiredman: i'm aware, i was making a joke
14:15TimMcstuartsierra: I do both.
14:15TimMcstuartsierra: org.timmc/chelydra (org/timmc/chelydra.clj)
14:15stuartsierraI'll tolerate lots/of/extra/directories if I get descriptive names that don't clash.
14:15futileRusticus
14:16futilethats the best one so far.
14:16stuartsierraTimMc: That still gives me no inkling what "chelydra" means.
14:16TimMcWho *doesn't* know that Chelydra is the snapping turtle genus?
14:16TimMcSheesh.
14:16stuartsierra:)
14:16TimMcAnd obviously snapping turtles hold onto things.
14:17stuartsierraOh, so it's a memory leak generator?
14:17TimMcObviousl... no, a bookmarking thingy. :-{
14:17stuartsierra:)
14:17hyPiRionoh, no turtle graphics for me.
14:18TimMcI 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:18ystaelTimMc: see, that makes me think that chelydra is "a good way to lose fingers"
14:18ystaelnot "a good way to keep bookmarks"
14:18TimMc"a friendly companion who will never leave you"
14:19futilemaybe "empirical" if it werent so hard to spell
14:19hyPiRionTimMc: that's a good argument though. Imagine if Leiningen was named Clojure-Maven or Project-Manager
14:19technomancymy project names are chosen with the specific goal of getting people to read literature
14:19futiletechnomancy: that almost worked for me.
14:19hyPiRionNow it's not obvious that leiningen would be bundled with a repl, for instance.
14:19mavbozoleiningen vs the ants <= brilliant and cultured
14:19futiletechnomancy: i read your *whole* section about Leiningen in your readme
14:20futilebut then i stopped caring.
14:20futileoh no wait, that's not true!
14:20futilei read the wikipedia about Leiningen and the Ants.
14:20futileand got the plot summary and was satisfied.
14:20futiletechnomancy: so it kinda worked
14:20technomancyfutile: it's public domain even; no excuses
14:20TimMcI totally went and read it.
14:20TimMcFun story.
14:20technomancywell, maybe only in Canada and NZ
14:20futiletechnomancy: grown-up stories just seem not worth the time
14:21futileoh wait.. one more idea up my sleeve
14:21TimMcfutile: I think you're about to get assigned a reading list.
14:21mavbozotechnomancy: technology + necromancy?
14:21technomancymavbozo: -mancy is a general suffix
14:21futilemavbozo: i thought so, but i looked up technomancy in the dictionary and its a legit word.
14:21futilewait, did i? i cant find it now. maybe i imagined it.
14:21technomancyoriginally a play off neuromancer
14:22technomancy(which if you haven't read please don't tell me and we can still be friends)
14:22futilerosebud!
14:22futilejk
14:23futileok i was thinking of something from LotR, but i havent actually read any of it. so that wont work.
14:23futilethis is roughly around the point where i would just name the library "ihatenamingthings" and just be done with it
14:24TimMcfutile: Just use gfredericks' approach.
14:24mavbozoreminds me of gell-mann vs feynman
14:24TimMc&(format "lib-%04d" (rand-int 1e4))
14:24lazybot⇒ "lib-2858"
14:24mavbozogell-man : quark <= from literature
14:24mavbozofeynman : parton <= completely made up
14:25ystaelTimMc: "i am not a number! i am free software!"
14:28daydreamtIs there any way to unzip files in clojure that doesn't involve writing java?
14:28daydreamtI mean, library. I'm searching for a library.
14:30tolitiusdaydreamt: http://stackoverflow.com/a/10188601/211277
14:31daydreamtYes, I saw that. It triggered my java allergy. I was trying to avoid it if possible.
14:31tolitiusit's just one tiny import..
14:32amalloythat's not even writing java
14:32ThatOneGuytime to write a clojure wrapper around ZipInputStream :P
14:32amalloyyou'll know you're writing java when you have semicolons everywhere
14:32amalloy$google raynes fs compress
14:32lazybot[fs.compression documentation] http://raynes.github.io/fs/fs.compression.html
14:32tolitiusyou can wrap it yourself and release a library if you want.. 5 mins?
14:33gfrederickspeople 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:33gfredericks(or is that not the correct way to achieve faster/better?)
14:34amalloygfredericks: mostly because pmap tempts you to give each thread trivially small tasks; giving those same tasks to different threads won't help
14:34daydreamtthanks amalloy, this is what I was looking for.
14:34technomancygfredericks: it will definitely be better if your work units vary widely in the amount of time they take to process
14:34hiredmangfredericks: using an executor directly gives you much better control
14:34amalloytrue
14:34gfredericksso the overhead for pmap is worse? or just harder to control as hiredman says?
14:35hiredmanpmap isn't slow/bad it just abstracts away way too much
14:35hiredmanso it ends up being slow/bad unless you use it in a way that exactly fits it
14:35gfredericksgot it
14:35gfredericksthanks technomancy amalloy hiredman
14:36hiredmanand pmap's whole intended consequence interaction with chunked seqs
14:36hiredmanunintended
14:36hiredmana disaster
14:37gfredericksoh right
14:37hiredmanif you really want "pmap" use fold and reducers
14:38gfredericksI probably should try reducers
14:38gfrederickswell do they do anything useful with lazy seqs yet?
14:38hiredmanno, and never will
14:38gfredericksokay maybe not appropriate then
14:39gfredericksunless it's worth orchestrating via chunking into vectors or something
14:39hiredmanthe parallel bit in reducers is about parallel processing tree like structures, which clojure's vectors and maps are
14:40hiredmangfredericks: have you seen, uh, I think it was guy steele's talk about cons considered harmful?
14:40gfredericksmmmmaybe not?
14:41aaelonysorry 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:41aaelonyto 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:41hiredmancons builds a linked list, which is a linearly accessable structure
14:41hiredmanwhich is bad for parallism
14:41gfrederickshiredman: oh sure; I understand why there's no direct reducers impl for seqs
14:42gfredericksit's not hard to (map vec (partition-all n coll)), but not an obviously useful thing for reducers to do for you
14:42gfredericksor to do at all
14:42gfredericksbut seemed worth asking about at least
14:43hiredmanI dunno why you would do that? just vec the seq, why partition it?
14:43gfredericksif too big for memory
14:43gfrederickswhich it is in my case
14:43hiredmanah, well write a custom CollReduce :)
14:44gfredericksreducers is expected to work better for small tasks than other approaches?
14:44mmarczykdnolen: ping
14:45aaelonyhey nevermind… just discovered {params :params}… duh. thanks anyways.. :)
14:46amalloygfredericks: if it's too big to fit in memory all at once, you have to be careful how you parallelize it too
14:46jkkramergfredericks: there's this thing: https://github.com/paulbutcher/foldable-seq (never used it)
14:46dnolenmmarczyk: pong
14:46gfredericksjkkramer: hah, I read "never use it" first
14:47hiredmangfredericks: yes, they use a fancy fork/join threadpool with work stealing and etc
14:56futileI've started liking the idea of mixing markdown with hiccup.
14:57futileok, think im going to just go with "attest"
14:57futileill sit on it for a day
15:00seangroveWhat'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:02supersymseangrove: 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:03supersym99/100 times it would seem though that :use :only = :require :refer?
15:03seangroveSeems like it, yes
15:04edbond_what function can do this: (f [1 2 3] [:a :b :c]) ;; => [ [1 :a] [2 :b] [3 :c] ] ?
15:04stuartsierraedbond_: (map vector [1 2 3] [:a :b :c])
15:05edbond_stuartsierra, nice, thanks. I knew map takes several collections.
15:06futile,(map + [1 2 3] [4 5 6])
15:06clojurebot(5 7 9)
15:06futileneat
15:06edbond_have a clean csv output vectors now.
15:10futileedbond_: woo
15:17jouiswalkeris there a nice way to keep the ui from freezing in clojurescript when you have to do a lot of work?
15:17RaynesInvent multithreaded javascript.
15:17mmarczykjouiswalker: https://github.com/pedestal/app-tutorial/wiki/Parallel-Processing
15:17mmarczyk(web workers for processing, main thread for rendering only w/ pedestal-app)
15:18futileour solution has been to avoid using javascript.
15:18RaynesSmooth mmarczyk.
15:18futileit's worked well so far.
15:18mmarczyk:-)
15:18Raynes"You can solve this problem by using this web framework."
15:18jouiswalkernice
15:18jouiswalkerlol
15:18mmarczyk;-)
15:18jouiswalkermaybe i can steal the pedestal web worker
15:19jouiswalkeri had looked at the shoreleave implementation, but in the marginalia docs it said "DONT USE THIS"
15:19RaynesI've had that disease before.
15:19RaynesIIRC, irclj said DON'T USE THIS for the better part of a year while I was using it. :p
15:20jouiswalkerdid it ever come back to bite you?
15:20RaynesPeople complained about it and made other, worse libraries that were even less usable than mine was at the time. :p
15:20RaynesI hope I finally changed the readme...
15:21Raynesamalloy: I just went to https://github.com/fratland. We were almost party animals for a moment.
15:22jouiswalkerthat should be an organization on github
15:23arrdemRaynes: and then the improbability drive converged. we know how this goes.
15:23Rayneslol
15:24arrdemanyone ever heard of a four operand machine?
15:24RaynesWow, what happened to ohpauleez?
15:25RaynesIt looks like he vanished off the face of the planet about 3 months ago.
15:25eggheadhow can I print the value of something that is nil as a the string "nil" ?
15:25arrdem,(prn nil)
15:25clojurebotnil\n
15:25eggheadfor instance, (str [:foo :bar]) is "[:foo :bar]" -- I'd like something that takes in nil and returns "nil"
15:25eggheadand similarly takes in [:foo :bar] and returns "[:foo :bar]"
15:25arrdem,(pr-str nil)
15:25clojurebot"nil"
15:26seangroveRaynes: I hear tutorspree is workin' him good
15:26arrdem,(pr-str [:shut :up :and :use :this])
15:26clojurebot"[:shut :up :and :use :this]"
15:26eggheadthanks arrdem
15:26arrdemegghead: :P no problem
15:30chrisrossi(dumb-noob-question
15:30chrisrossiI used 'lein new app' to create a Hello World app, then ran lein compile.
15:30chrisrossiMy expectation was I would see a .class file in target/classes
15:30chrisrossiYet I see no such thing.
15:31technomancychrisrossi: maybe you want `lein compile :all`?
15:31chrisrossiWhere am I wrong in my thinking?)
15:31technomancy`lein compile` will only compile the namespaces you've asked for in defproject
15:31chrisrossiyep, that looks better.
15:31chrisrossithanks!
15:32technomancynp
15:33futileok, deploying. more time to think of a name.
15:36SomelauwI'm using nrepl, but how to send code directly to the repl to execute?
15:36arrdemfutile: I'm thinking this is an exercise in futility...
15:37futileHA
15:37futileyes, maybe futile will be the name
15:37futile(deployed. waiting for people to complain about bugs.)
15:37arrdemfutility wouldn't be a half bad name either... indicates lack of proof :P
15:43kmicuSomelauw: This is for sure in nrepl's README.
15:45Somelauwkmicu: I found ctrl+x, ctrl+e so far, but that prints in the minibuffer instead.
15:45SomelauwAlso, I want to parse the whole file at once preferably.
15:45kmicuSomelauw: all this is in README :)
15:46Somelauwalso, not familiar with that crazy emacs terminology. What is a region?
15:46kmicuThe name of file is very important here. You should * README * before you use it. ;]
15:47nDuffSomelauw: an area within a buffer, with distinct start and end points
15:47nDuffSomelauw: if you select some text, for instance, that text can be described as a region.
15:48ndpSomelauw: Check out the nrepl-eval-* functions.
15:48SomelauwI really can't find a command to send a single x-expression to the repl. It's not lisp-eval-last-sexp
15:49futilei ned to read more i guess
15:49SomelauwYes, I'm reading them.
15:49futilewhats a story involving sanity/insanity?
15:49technomancyfutile: anything by Philip K Dick
15:49technomancyfutile: the tell-tale heart
15:49futileoh yeah
15:50hyPiRionfutile: anything poe
15:50futile(inc poe)
15:50lazybot⇒ 1
15:50hyPiRionWell, not anything, but most of it
15:50chrisrossipretty much all pynchon novels are about schizophrenia.
15:50Somelauwndp: so i need to select text first? I just want to send the x-expression my cursor is currently on?
15:51technomancyhttp://p.hagelb.org/csp.jpg
15:51kmicuX-expressions FTW
15:51futileha!
15:51technomancythought I might never get a chance to use that one
15:51duck11231Somelauw: C-M-x isn't doing it for you?
15:52hyPiRionIf 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:52Somelauwduck11231: undefined
15:52SomelauwI'm using nrepl + clojure-mode
15:52ndpSomelauw: nrepl-eval-expression-at-point may be what you're looking for
15:52duck11231You might need to run M-x nrepl-enable-on-existing-clojure-buffers first
15:52chrisrossithere's a lot of exploration of human mind in "Blindsight" by Peter Watts, too. Terrifying hard sci-fi.
15:52ndpSomelauw: or nrepl-eval-last-expression
15:53kmicuMaybe you are aware of some Lem like/style sci-fi writer?
15:53ndpSomelauw: duck11231's suggestion is a good idea as well
15:55futileha. "poe: helps you test your code's sanity"
15:55mmarczykwould you guys happen to be able to recommend a jvm-based numeric solver of recurrences?
15:55arrdemfutile: nevermore would be a badass name...
15:55futilehmm nevermore
15:56futileyes.
15:56arrdem\o/
15:56futilei think i like it
15:56cemerickHugely 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:56technomancy(ns never.more)
15:56hyPiRionOr Quoth, but that's possibly used up because of Discworld.
15:56mmarczykB(x) = 1 + B(x)^2, say
15:57Somelauwduck1123: 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:57futileeither way, not raven, it rhymes with maven too much
15:57llasrammmarczyk: 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:58mmarczykllasram: thanks, didn't occur to me to look -- will do
15:58mmarczyklook there
15:58technomancyfutile: http://timberglund.com/blog/2012/08/03/the-maven/
16:00chrisrossicemerick: i let fpm figure it out for me: https://github.com/jordansissel/fpm
16:02amalloymmarczyk: well, that particular "recurrence" is easy, because B(x) can't depend on x the way you wrote it
16:02llasramcemerick: 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:02technomancydebian packaging manuals =\
16:02mmarczykamalloy: x is a real variable here
16:03Somelauwctrl+c, ctrl+l works for loading files. Copy-pasting code also works so far.
16:03cemerickllasram: yeah, this is totally internal. Thanks for the recommendation, chrisrossi :-)
16:03technomancy...are OK if you already know the C toolchain well
16:03mmarczykreal-valued
16:03amalloymmarczyk: my point is that there's no B(x-1) term or similar
16:03amalloyyou can solve that for B(x) and get a constant
16:04seangrovemmarczyk: Have you used pedestal at all?
16:04technomancyreally opaque if you want to build debs for not-C without learning the C tools inside and out
16:04cemericktechnomancy: 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:06mmarczykamalloy: eh, recurrence in the sense of a function being defined in terms of itself
16:06technomancycemerick: 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:06amalloyspecifically you end up with B(x)=(1 +/- sqrt(-3))/2
16:07mmarczykamalloy: this particular case is the counting ordinary generating function of complete planar binary trees
16:07mmarczykamalloy: so I'm interested in transforming this to 1-sqrt(1-4x^2)/2x
16:07mmarczykwell actually I'm not really interested in the symbolic transformation
16:08mmarczykbecause I only really need to evaluate it for arbitrary values of x
16:08mmarczykbut I'd like to do it given a specification in the original form, without needing to provide a closed form
16:09mmarczykso there's a fix point search
16:09brianwongin the repl, im using require to reload my name space
16:09futiletechnomancy: man, i think that ruins the name "nevermore"
16:09brianwongbut it seems like new symbold definitions dont come into the namespace after a reload
16:10brianwongthat is expected behavior?
16:10brianwongwait nevermind
16:10hyPiRionmmarczyk: It's impossible to do that without more knowledge about B. What kind of function may B be?
16:10brianwongplease disregard
16:10mmarczykhyPiRion: analytic
16:12mmarczykhyPiRion: 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:13mmarczykamalloy: not saying "recurrence" was the best choice of term :-(
16:14amalloymmarczyk: 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:15futileok. i think that settles it. i think im going to pick "nevermore".
16:16mmarczykamalloy: "recursive specification" would be fine though, I guess, should have gone with that; or should it be inductive
16:16seangroveCedric trolling datomic again
16:16futileshall i change it? nevermore.
16:16seangrovetbaldridge has saintly patience
16:16mmarczykah, not at my most expressive right now :-/
16:17mmarczykamalloy: 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:19mmarczykamalloy: 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:19mmarczykand solving the original equation in this manner is the most convenient way of arriving at this final OGF
16:20`cbpcallen: ping
16:20mmarczykseangrove: pedestal -- played with it a bit, planning to use it now
16:21callen`cbp: da comrade?
16:25futiletechnomancy: does leiningen have something like :aliases that lets you run a straight-up clojure function?
16:26futileMight be nicer to have ":clj-aliases {"autotest" (nevermore.run/run :runner nevermore.runners/auto-runner)}"
16:27llasramfutile: But you can already run an arbitrary Clojure function in your project with `lein run`, and create `lein run` alias with :alieses
16:27llasram:aliases even
16:28futilellasram: maybe.
16:28futilei mean, yeah
16:28futilemaybe i dont need what im asking for
16:29yedianyone have any experience using friend for user auth?
16:30futileyedi: 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:31yedifutile: 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:31futileyedi: i couldnt figure out how to use his api for just openid
16:31futileyedi: not new to clojure.
16:32futileyedi: 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:32futilebut like i said, many people reported finding it very easy. maybe i missed something.
16:36mmitchellanyone have ideas on how to get lein-ring server running on https?
16:37hiredmanmmitchell: https for dev?
16:37mmitchellhiredman: yes
16:37hiredmandunno, just making sure you're not using lein-ring to run an app in production
16:37mmitchellha yeah, we're not doing that :)
16:38mmitchelli have a feeling i'll have to build the war, and deploy it into jetty or tomcat by hand
16:39hiredmanmmitchell: my guess is lein ring doesn't expose that because most people don't need https at dev time
16:39xpei'm hoping to find an enlive example on how to map (?) a seq into a selector
16:39mmitchellhiredman: i bet you're right
16:40hiredmanmmitchell: 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:41ystaelhave a dumb question about string matching and splitting: https://www.refheap.com/16890
16:43xpe[:a] (h/set-attr …) adapted to use a seq
16:50TimMc&(require '[clojure.string :as str])
16:50lazybot⇒ nil
16:51gfredericks&str/split
16:51lazybot⇒ #<string$split clojure.string$split@8b5c5f>
16:52arrdemTimMc: since when is require not sandbox denied...
16:52TimMcO:-)
16:52arrdem,(do (require '[clojure.string :as str]) (str/split #" " "foo bar baz"))
16:52clojurebot#<ClassCastException java.lang.ClassCastException: java.lang.String cannot be cast to java.util.regex.Pattern>
16:52TimMcBoth bots allow it, I think.
16:53arrdem,(do (in-ns 'arrdems-sanxbox) (require '[clojure.string :as str]) (str/split #" " "foo bar
16:53clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading string>
16:53arrdem baz"))
16:53TimMc&(map #(str/split % #"(?=[A-Z])") ["Foo" "FooBar"])
16:53lazybot⇒ (["Foo"] ["" "Foo" "Bar"])
16:53xeqifun in the sanxbox
16:54TimMc,(in-ns 'SANBOX)
16:54clojurebot#<Namespace SANBOX>
16:54arrdem,(do (in-ns 'arrdems-sanxbox)
16:54clojurebot#<RuntimeException java.lang.RuntimeException: EOF while reading>
16:54arrdem (require '[clojure.string :as str])
16:54arrdem (str/split "foo bar baz" #" "))
16:54futileDo any of you guys ever use once-fixtures?
16:54arrdemarse
16:54arrdem,(do (in-ns 'arrdems-sanxbox) (require '[clojure.string :as str]) (str/split "foo bar baz" #" "))
16:54clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: require in this context, compiling:(NO_SOURCE_PATH:0:0)>
16:54TimMcarrdem: No need for that, the require persists.
16:55arrdemTimMc: it would if I had remembered to refer-clojure :P
16:55xeqifor about ~20 minutes on clojurebot I think
16:55gtrakI've stopped using fixtures entirely
16:56arrdemwhy is def denied in sandbox?
16:57futilegtrak: hasn't that been tedious, to do common setup in every test?
16:57llasramThis looks like a bug in java regular expression, or at least a really weird edge case.
16:57futilehmm, I guess the only fixture I use is (with-memory-datastore)...
16:57gtrakfutile: I don't have to teardown really, since we're using datomic. I just return all the 'services' as a tuple or map
16:57llasram&(mapv #(seq (.split "Foo" %)) ["(?=[A-Z])" "(?=[A-Z])."])
16:57lazybot⇒ [("Foo") ("" "oo")]
16:58gtrakit's not super tedious.. much more maintainable
16:58futilegtrak: hmm, how do you like datomic?
16:59arrdemllasram: er... something isn't right there.
16:59futileI'm tired of using MongoDB for relational data.
16:59gtrakwe're not really using the parts that make it special, but it's been fine so far
16:59futilegtrak: performs fine then?
17:00ystaelllasram: #"(?=[A-Z])." is strictly equivalent to #"[A-Z]" isn't it?
17:00arrdemystael: yes I believe so
17:00ystael&(seq (.split "Foo" "[A-Z]"))
17:00lazybot⇒ ("" "oo")
17:00gtrakfutile: yea, it's not to the point where we have to worry about that
17:01llasramarrdem, ystael: I was just showing that having anything else in the pattern causes it to actually split
17:01clojurebotarrdem is jeremy
17:01llasramThanks, good to know, clojurebot
17:01arrdem~arrdem
17:01clojurebotarrdem is awesome
17:01futilegtrak: 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:01arrdemarrdem, foo bar baz
17:02ystaelllasram: yeah. but the rationale for this behavior is not clear to me
17:02ystaelanyway, the correct workaround for me seems to be to use qerub/camel-snake-kebab instead of rolling my own :)
17:02llasramThere you go!
17:08llasram&(mapv #(seq (.split #"(?=[A-Z])" "FooBar" %)) (range 1 4))
17:08lazybot⇒ [("FooBar") ("" "FooBar") ("" "Foo" "Bar")]
17:09llasramOh, "the array's length will be no greater than <n>"
17:09futilegtrak: did you guys install it from http://downloads.datomic.com/free.html or clojars?
17:09llasramUgh. I never remember which regex-split APIs take the max number of results vs the max number of splits
17:10gtrakfutile: clojars I believe
17:10ystaelthat makes even less sense - i'd expect the size-1 result to be ("")
17:10ystaelbut 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:11futilethx gtrak
17:11TimMcystael: Well, that one is explainable -- if you can only have one entry, there have to be zero splits.
17:11gtrakfutile: the peer client is all you need to play around with the in-memory db
17:11ystaelyeah, i just want a behavior different from what the doc says :)
17:12futilegtrak: im not up to date with datomic terminology yet, dunno what peer client is
17:12TimMc&(str/split "foo" #"o" 3)
17:12lazybot⇒ ["f" "" ""]
17:12TimMc&(str/split "foo" #"o")
17:12lazybot⇒ ["f"]
17:12futilegtrak: if you mean [com.datomic/datomic-free "0.8.4020.26"] then ok
17:12gtrakfutile: yea
17:12futilegtrak: you guys use the paid version?
17:12gtraknah
17:13futilecool
17:13futile(inc gtrak) you've been a real pal
17:13futileohh i see lazybot is sleepin on the job, eh?
17:13hyPiRion(inc gtrak) ; like this
17:13lazybot⇒ 6
17:14futilehmm, i didnt see the semicolon in the regex
17:14futilethen again, how can anyone? those things are dense
17:14gtrakheh, thanks
17:14TimMc(inc lazybot) ; if the non-greedy quantifier was used ;-)
17:14lazybot⇒ 1
17:15TimMcCrud, forgot to check karma first.
17:15TimMc(inc lazybot) ; if the non-greedy quantifier was used ;-)
17:15lazybot⇒ 2
17:15TimMcOh good.
17:17tbaldridgefutile: What are you trying to wrap for Clojure?
17:17futileoh sorry, datomic
17:18futiletbaldridge: btw was it you who suggested test assertions being in the tail position?
17:18tbaldridgefutile: datomic comes with a super nice Clojure API, why a wrapper?
17:18tbaldridgefutile: http://docs.datomic.com/clojure/
17:18futiletbaldridge: i meant a clojure api, so i didnt have to touch java. thanks for that link :)
17:19tbaldridgefutile: 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:19llasram&(mapv #(str/split % #"(?m)^") ["FooBar" "Foo\nBar"])
17:19lazybot⇒ [["FooBar"] ["" "Foo\n" "Bar"]]
17:20tbaldridgefutile: (-> (d/enttity db db-id) :child :child :child)
17:20tbaldridge*entity
17:21futiletbaldridge: oh that looks super handy
17:22tbaldridgefutile: 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:22tbaldridgethat will get a node's grandparent
17:22futiletbaldridge: huh, neat
17:22futiletbaldridge: ok im sold on datomic from an api standpoint
17:22futilenow all i need is to find some entry point i can start messing with in my tests
17:24gfredericks(defn chunkily-pmap [n func coll] (->> coll (partition-all n) (pmap #(doall (map func %))) (apply concat)))
17:27futilegtrak: so you just use (create-database static-test-uri) in all your tests, without ever worrying about deleting it?
17:27gtrakyea
17:27futilegtrak: where static-test-uri is probably "datomic:mem://test"
17:27gtrakyea
17:27futile(always)
17:28futileand that just works?
17:28futileoh man thats awesome.
17:28gtrakwrapped in about 20 layers of abstraction
17:28gtrakbut yes
17:28futileright
17:28futileyeah we'd probably have to store this thing in a var somewhere so we dont have to pass it everywhere.
17:28gtrakright, I explicitly don't store it in a var :-)
17:28futilewhy not?
17:29gtraklifecycles just get nasty if stuff is big enough.
17:29gtrakmaybe I'd consider putting all the app state in a single var.
17:29Somelauwhow to make lein refresh dependencies?
17:30hyPiRionSomelauw: lein -U $TASK
17:30hyPiRion(see `lein help deps`)
17:31futilegtrak: what do you mean about the lifecycle comment?
17:32gtrakfutile: 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:32futilegtrak: ah touche
17:33TimMcystael: Almost certainly a bug: http://grepcode.com/file/repository.grepcode.com/java/root/jdk/openjdk/6-b14/java/util/regex/Pattern.java#1031
17:33TimMcThat line assumes that if the index is still at 0, then no matches were found.
17:33SomelauwhyPiRion: I already tried 'lein deps', but it doesn't download anything.
17:34SomelauwI added org.clojure/tools.trace "0.7.5" to project.clj. So 'lein deps' should now download the jar needed, right?
17:34hyPiRionSomelauw: yes, unless you already have it downloaded
17:35SomelauwhyPiRion: but tryping the following in a repl: (require 'clojure.tools.trace) throws a FileNotFound exception.
17:38hyPiRionSomelauw: 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:38futilethanks everyone (esp arrdem) for name ideas.
17:38futilei went with Nevermore.
17:38hyPiRionthat should be it, really.
17:38futilehttps://github.com/evanescence/nevermore
17:42SomelauwhyPiRion: Oh, I found the problem. I had it like [dep 1 version dep 2 version] instead of [[dep1 version] [dep2 version]].
17:42hyPiRionSomelauw: ah, good to know you found the issue :)
17:42ystaelTimMc: you got it. i was staring at that for a few minutes, but didn't catch that.
17:45ThatOneGuy,(nil {nil 3})
17:45clojurebot#<CompilerException java.lang.IllegalArgumentException: Can't call nil, compiling:(NO_SOURCE_PATH:0:0)>
17:45ThatOneGuy,({nil 3} nil)
17:45clojurebot3
17:45TimMcystael: I just started imitating the code with my own Matcher instance. :-P
17:45ThatOneGuy,(#{nil 3} nil)
17:45clojurebotnil
17:45ThatOneGuyme gusta nil
17:46TimMc&(mapv #(str/split % #"(?=[A-Z]|$)") ["Foo" "FooBar"])
17:46lazybot⇒ [["" "Foo"] ["" "Foo" "Bar"]]
17:47TimMcUgly workaround.
17:47TimMc#"(?=[A-Z])|$" even
17:47SomelauwDoes ctrl+c, ctrl+l automatically apply all changes made to my source file as well in nrepl?
17:47SomelauwI have the feeling it is having problems with 'old errors'.
17:59SomelauwHmm, it does not update when using multimethods. Even manually copy-pasting the multimethod does not work.
18:00Somelauwthere must be a way to refresh this multimethod without having to restart the repl
18:02TimMcSomelauw: I don't have experience with this (known) problem, but what happens if you re-execute the defmethod as well?
18:02TimMcErr, the defmulti.
18:02bbloom_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:04futileCan anyone recommend a Datomic tutorial that's easier to follow than http://docs.datomic.com/tutorial.html ?
18:04futileI think a computer wrote this one.
18:07SomelauwTimMc: 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:08Somelauwsome way to undefine multimethods might work
18:08Somelauwsince I can't override them
18:11seangroveClojure is great, but any time I interact with Java I want to cry
18:13seangroveWell, I'll save implementing a custom IMAP command/protocol implementation/class for javamail for after lunch
18:14futilegtrak: did you use http://docs.datomic.com/tutorial.html to learn it, or something else?
18:14futileI'm having a really hard time understanding the query language, this author isn't making it very clear.
18:15gtrakfutile: 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:18futilethanks
18:20clojurenewbRaynes: 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:33DeranderIs there a way to (with lein) add code that will be eval'd in the user namespace across all repl sessions?
18:33DeranderNamely I have a debugging macro that I'd like available everywhere
18:34SomelauwIs it by the way possible to interactively undefine symbols or multimethods?
18:34Somelauwto solve my problem?
18:34futileDerander: maybe you can def it in clojure.core and it'll just be available everywhere?
18:34futilewait that makes no sense
18:34justin_smithDerander: maybe put it in a leiningen plugin that you load in the :user profile in .lein/profiles.clj?
18:34technomancyDerander: check under :repl-opts in `lein help sample`
18:35Deranderah! thank you for all of the answers. I will read and experiment
18:35eggheadif clojure.edn has read-string, how to I 'write-string' ?
18:35justin_smithegghead: prn mostly prints readably
18:35justin_smiththis fails by design for certain things
18:36justin_smiththat should not be re-readable
18:36dnolenSomelauw: you can probably unmap the var from the namespace
18:36eggheadso if I wanted to ship edn over the wire I'd just use pr-str ?
18:36Derandertechnomancy: I see -- that'll work. Thanks!
18:36futileegghead: I think there's a lib for reading edn
18:37eggheadclojure.edn can read it, I'm interested in how to write it
18:37nDuffegghead: yes, pr-str
18:37eggheadthanks nDuff
18:37futileoh
18:37futilesorry
18:37futileman im off a roll today
18:40egghead:)
18:40eggheadWriting my first cljs app consuming edn, it's fun
18:43futile,`(foo bar)
18:43clojurebot(sandbox/foo sandbox/bar)
18:43futile,(let [baz 4] `(foo bar ~baz))
18:43clojurebot(sandbox/foo sandbox/bar 4)
18:43futileoh!
18:43Somelauwdnolen: how? It's about a multimethod that won't automatically be overwritten in the repl when copy-pasting its definition again.
18:44futileneat.
18:45eggheadwhat should I be using in cljs to read edn?
18:46eggheadcljs.reader/read-string ?
18:46ThatOneGuy,(defn ^String foo [^String bar] (str "foo" bar))
18:46clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
18:47ThatOneGuy,((fn ^String foo [^String bar] (str "foo" bar)) "lol")
18:47clojurebot"foolol"
18:47dnolenSomelauw: multimethods have defonce semantics, the only want to redef is to unmap
18:47dnolens/want/way
18:47ThatOneGuy,((fn ^String foo [^String bar] (foo (str "foo " bar))) "lol")
18:47clojurebot#<StackOverflowError java.lang.StackOverflowError>
18:48ThatOneGuy,((fn ^String foo [^String bar] (recur (str "foo " bar))) "lol")
18:48ThatOneGuylol
18:48clojurebotExecution Timed Out
18:50amalloyThatOneGuy: if you need a private repl to play with, you can /msg clojurebot or lazybot
18:50Somelauwdnolen: So how to unmap?
18:51dnolen,(doc ns-unmap)
18:51clojurebot"([ns sym]); Removes the mappings for the symbol from the namespace."
18:51ThatOneGuyamalloy: just seeing if it had any easy holes
18:51Somelauwdnolen: thanks
18:52amalloyfeel free to do that in private; otherwise you're just wasting space
18:52SomelauwAlso, 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:52SomelauwIn a fresh repl it always works.
18:52ThatOneGuyI 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:53ThatOneGuyamalloy: ok I'll do that in the future
18:54hiredmanbecause doc is by default only available in the user namespace
18:54hiredmanso when you switch the repl to another namespace if you want to keep using doc unqualified you have to require/use it
18:54hiredmanit is in the clojure.repl
18:54hiredmannamespace
18:55Somelauwhiredman: thanks, that works
18:56SomelauwI might some day fall in love with clojure
18:58bbloom_instaparse is pretty fucking sweet
18:59futilebbloom_: what success have you?
18:59bbloom_just got up and running mega fast & every time i said "i wish it…" …. it did :-P
19:00pmonksinstaparse blows my tiny little mind too
19:00pmonksIt's amazeballs
19:03futilebbloom_: sweet
19:04futilebbloom_: sounds like that guy deserves *mad* props. not just props. *mad* props.
19:04bbloom_true story.
19:12eggheadasync jasmine specs in cljs :) -- https://www.refheap.com/16892 wahooo
19:15dnolenegghead: heh nice. side note: there is no wat over + in CLJS. In JS it is *defined* behavior - it's undefined in CLJS :)
19:15futile,(doc only)
19:15clojurebotGabh mo leithscéal?
19:16eggheadnice dnolen :p
19:17hiredmandnolen: I don't think you get to handwave over that
19:18hiredmanthe fact that there is no error for that is a wat
19:33DeranderI 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:33Derander getting substantially slower performance than when I was using awk.
19:35brehautsurely that answers your question then?
19:36Deranderyeah, 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:36callenDerander: right tool for the right job.
19:37technomancyDerander: massive simple text processing is gonna suck in UTF-16
19:37Deranderis there a simple way to force ascii?
19:37technomancyno
19:37technomancywell, you could work directly on byte arrays
19:37callenlol ^^
19:37Deranderhah. okay. maybe I should drop down to java.
19:38technomancyno
19:38brehautyou didnt need that most significant bit anyway
19:38technomancyJava has the same problem
19:38technomancyall JVM strings are UTF-16
19:38technomancyhttp://meshy.org/2009/12/13/widefinder-2-with-clojure.html
19:38technomancy^ possibly relevant
19:39Derandertechnomancy: thanks, reading.
19:40technomancytechnically jruby has non-utf-16 strings, but that is probably not the path towards improved performance in this case =)
19:40Deranderhah, right
19:40DeranderI started w/ ruby 2.0
19:40DeranderI switched to awk b/c that was taking like an hour to process the data. AWK can do it in under a minute.
19:40Deranderunfortunately awk is really painful to maintain when people switch the column ordering around or add new fields
19:41technomancywrite clojure code that compiles to awk =)
19:41Deranderthat is actually not absurd
19:41DeranderI'm not sure anyone else would want to maintain *that* though :-)
19:42brehautDerander: 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:42Deranderbrehaut: 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:43callenDerander: so continue to use awk?
19:43technomancythe wide finder post is really eye opening about how you can still go really low-level if you need to
19:43technomancybut it can get ugly
19:44brehauttechnomancy: likewise that grep one.
19:44Derandertechnomancy: (obviously) haven't had a chance to fully read that yet but I'm interested to see how gnarly it gets.
19:44brehautspoilers: extremely
19:44Deranderhaha.
19:44Derandercallen: I will resort to that if I have to. I'm trying to figure out if this actually needs to be fast.
19:44technomancybrehaut: right, but grep is C; you expect it to be ugly
19:45brehauttechnomancy: its ugly _even for c_
19:45callentechnomancy: I've seen nice BSD C.
19:45brehaut~guards
19:45clojurebotSEIZE HIM!
19:45ThatOneGuyI've seen nice ANSI C
19:45Deranderthis 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:46DeranderI 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:46callenDerander: ...why is this on hadoop?
19:46callenDerander: how much data is involved?
19:46Derandercallen: many terabytes of raw data
19:46callenDerander: exactly how many is many?
19:46Derandernot certain
19:46callenI wouldn't use Hadoop until at least 10TB per batch.
19:46Deranderall of the logs from every request ever made to airbnb.com, basically
19:46Deranderwhich is a lot
19:46callenDerander: you work for airbnb?
19:46Deranderyessir!
19:47callenDerander: do they use Clojure?
19:47Derandera little bit in some places
19:47Derandermostly ruby and java
19:47callencurious.
19:47Deranderwe rewrote our only haskell service awhile ago :-P
19:47callenDerander: into?
19:47Deranderjava -- other people took over maintenance and weren't comfortable enough w/ haskell.
19:48futilephfraw
19:48callenI don't blame them.
19:48nDuffHeh.
19:48Deranderbut yeah I work on the machine learning pipeline that goes into our fraud detection shit
19:48callenDerander: very nifty.
19:48DerandernDuff: :-) glad you've enjoyed it
19:50futileLooks like migrating an existing database to Datomic might not be feasible. What do you think gtrak and tbaldridge?
19:50gtrakmongodb doesn't have schemas, right?
19:51callengtrak: it does
19:51callengtrak: just not enforced ones.
19:51futileRight, it's an implicit schema.
19:51futileWhereas Datomic schemas are.. well, goo.
19:51gtraknot so implicit
19:51callengtrak: the schematic patterns are relevant for indexing, ordering, and other things. What do you need?
19:51futileI guess you can make Datomic schemas look rigid like a Mongo schema, it just won't look right.
19:51gtrakcallen: futile's got a mongo thing
19:52callengtrak: oh I thought I was helping you with something
19:52callenn/m then.
19:53miwaokay, 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:54callenmiwa: don't use ganelon.
19:54futileThis is fun: http://www.flyingmachinestudios.com/programming/the-unofficial-guide-to-rich-hickeys-brain/
19:54callenmiwa: if you expect documentation, ganelon isn't a good fit for you.
19:55miwacallen: then what should I use? :)
19:55callenmiwa: generally, Luminus. If you have specific needs it doesn't suit, ping me.
19:56callenmiwa: try to avoid the fancy bullshit until you're comfortable reading and harnessing Clojure code without the benefit of documentation.
19:57TimMcAnd bullshit it is if it isn't documented.
19:57callenprecise terminology right thurrr
19:58futile(inc TimMc)
19:58lazybot⇒ 43
19:58miwathank you callen, I'll try Luminus out of a while :)
19:58futile(dotimes 3 [i] (inc TimMc))
19:58futilehaha
19:58futilecallen: did you write luminous?
19:59callenfutile: *Luminus, and no. But I did irritate the shit out of the creator in what libraries to use.
19:59callenI use Luminus a lot.
19:59futileit seems like a competitor to Joodo
19:59gtrakLuminus is cool
19:59callenfutile: except useful.
20:00futilelike, it has the same feature set as Joodo
20:00callenjoking aside, joodo and luminus are similar.
20:00callenhiccup is a bad idea for Clojure newbies.
20:00futileis it?
20:00seangrove,(str "(inc TimMc)")
20:00clojurebot"(inc TimMc)"
20:00futilei grokked it right away, before i knew any real clojure
20:00seangrovehrm...
20:00TimMcfutile: I think you mean (swap! karma update-in ["TimMc"] (apply comp (repeat 3 (fnil inc 0))))
20:00callenfutile: how many web apps have you made in Clojure?
20:00futile,(print "(inc TimMc)")
20:00clojurebot(inc TimMc)
20:01callen,'(inc TimcMc)
20:01clojurebot(inc TimcMc)
20:01callen,'(inc TimMc)
20:01clojurebot(inc TimMc)
20:01TimMclazybot ignores clojurebot these days.
20:01futileawww
20:01seangrove~'(inc TimMc)
20:01callenseangrove: nice try.
20:01clojurebotoinc is octo-inc: (apply comp (take 8 (repeat inc)))
20:01futile(inc TimMc)
20:01lazybot⇒ 44
20:01seangroveHeh, bummer
20:01seangroveThe bots have grown apart
20:01TimMc...although I appreciate the sentiments. ;-)
20:01futilehahaha
20:01TimMcseangrove: It's all Raynes' fault. Or hyPiRion's, depending on how you look at it.
20:01callenfutile: so how many web apps have you written in Clojure?
20:02futilei dunno, a handful
20:02callenfutile: github?
20:02futileno, private
20:02callenthought so.
20:02futilewhy?
20:02clojurebotwhy not?
20:02futileand how?
20:02TimMcseangrove: hyPiRion achieved a marvelous two-bot quine using $timer and Raynes put a permanent stop to it.
20:02callenTimMc: that's hilarious.
20:02futileTimMc: oh what day?
20:03TimMcAh, the date is burned in my... logs.
20:03futileTimMc: can you remember any words from it?
20:04brehauthow about 'hyPiRion'
20:04TimMc"well done hyPiRion. many have tried for the multi-bot quine"
20:05TimMcDec 17 2012
20:05TimMc$echo testing
20:05futilehttp://logs.lazybot.org/irc.freenode.net/%23clojure/2012-12-17.txt
20:05TimMc$timer 0 0 1 testing
20:17callenThe Scala guys are going to think we have Akka envy. https://github.com/lantiga/exoref
20:21futileWhat 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:38futileOooh, core.logic is basically just prolog (datomic queries)?
20:46tomjackcore.logic/prolog are not datalog
20:49muhooi'm getting weird errors from clj-http
20:49muhooorg.apache.http.ConnectionClosedException: Premature end of Content-Length delimited message body (expected: 11209; received: 6680
20:50callenmuhoo: catch and harvest what you can. They're not going to fix it.
20:50callenmuhoo: nothing to fix.
20:50muhoo"they're"?
20:50callenmuhoo: apache
20:50muhoowell, i'm not sure it's an apache problem.
20:50muhooit could be a me problem.
20:50callenmuhoo: well it's actually whoever sent you the response.
20:51muhooor the site i'm hitting
20:51callenmuhoo: contentlength didn't match the response body. you can catch it and process anyway.
20:51muhoooh, well, bleah. will abort/retry/ignore
20:52callenmuhoo: 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:13aphyrYo, if anyone figures out a good way to use annotations with (proxy), I will mail you cookies
21:13aphyrLike the second API this week that requires them, and I am getting really worried about my abuse of javac at runtime
21:18callenaphyr: do you want runtime annotation?
21:18aphyrOr at compile time
21:19aphyrBeing able to annotate an arbitrary class would work. Considering learning enough ASM to do it.
21:19aphyrRight now I actually generate big ol strings of java and pass it to the compiler, register a new class, and use that
21:19aphyrthen bind functions into static instance fields on the class
21:19aphyrpretty disgusting
21:20callenaphyr: you and ztellman worry me sometimes. I wish you were in here often but your twitter has to suffice.
21:20callenhere more often*
21:20callenaphyr: one problem is I can't tell where you want the arbitrary annotation to work from.
21:20aphyrHaha, believe me, I don't *want* to do this
21:20callendo you want it as part of your weird compiler toolchain, from Clojure, from Java itself?
21:20aphyrNaw, I want to write clojure that uses Java APIs
21:20callenright, okay.
21:20aphyrSo Netty 4, for instance, requires an @Sharable annotation on any Handlers which can be re-used between channels
21:21aphyrI can proxy a handler
21:21aphyrbut it doesn't have the annotation, so I have to new() a new one for every single conn
21:21aphyrFor UDP, it's a pretty significant overhead
21:21aphyrBe great if I could use the same syntax that gen-class or reify uses to specify annotations for proxy
21:22hiredmanaphyr: have you looked at using asm to generate bytecode to do whatever you want?
21:23onrJVM ecosystem is damn fat
21:23callenaphyr: (:gen-class :methods [^#{:annotations [SomeAnnotation]} [aMethod [T] S]]
21:24callenaphyr: you're AOT'ing right?
21:24aphyrcallen: nope, not AOT'ing
21:24aphyrNeed to generate this at macroexpand time
21:24aphyrso proxy/reify semantics would be most useful
21:25callenaphyr: you're killing me man.
21:26aphyrdon't look at me, it's not my library, haha
21:26callenaphyr: also are you into Star Trek? I noticed Janeway.
21:26aphyrhaha, yeah, though I count myself more a TNG guy
21:27callenaphyr: me too. So have you used clojure.asm much?
21:29aphyrNaw, I haven't used it yet
21:29aphyrDon't know enough about bytecode generation
21:29aphyrWhen I'm not in full-on sprint mode on a project I'll take a look
21:29aphyrjust... I have 20 days to build a database, haha, can't spare the time
21:30callenaphyr: sure. you almost definitely know more than I do though.
21:33callenaphyr: well core_proxy.clj leans on clojure/asm/*.java, and there's an AnnotationWriter.java.
21:33callenaphyr: nothing shake-n-bake ready-to-use but it's not out of the question.
22:07dnolencore.match 0.2.0-rc5 going out
22:07futilewoo
23:17tbaldridgefutile: 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:18futileYeah that's the impression I'm getting.
23:18futileFor 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:19tbaldridgefutile: yeah, history stuff is completely different in Datomic
23:19futileCrap.
23:20tbaldridgefutile: 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:20futileThat 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:20futiletbaldridge: heh, that resonates loud and clear over here
23:20tbaldridgefutile: perhaps, but that doesn't stop you from scanning your SQL database and "updating" an entity to simulate history
23:21futileThat's what I had in mind. Wasn't sure how evil it really is though.
23:22tbaldridgetime 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:23futiletbaldridge: see #datomic
23:23futiledidn't wanna clutter this with OT
23:43eggheadcore.async feels like a building block for a really cool event lib
23:44futilewrite that lib :)
23:44eggheadI'm using it for a silly little cljs app, just wrote my first jasmine spec with it :) https://www.refheap.com/16897
23:45futilepfft, thats not even 30 lines of code
23:45futilei mean.. whoa! thats not even 30 lines of code!
23:45tbaldridgeegghead: 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:46futileis it like go's channels?
23:46futile(and goroutines)
23:46zRecursivemorning
23:46futilezRecursive: morning
23:46tbaldridgepretty much
23:46callenzRecursive: howdy
23:46eggheadI have never published a clj lib but I might for some of this cljs stuff
23:51futileegghead: i still cant understand that code
23:51futilebut 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:51futileRaynes: can you make refheap more flat?
23:52futilethat round help icon in the bottom is too 3d
23:52futileRaynes: flat is the new 3d
23:52futileuntil 2015 when 3d will be the new 3d
23:52egghead:3
23:54eggheadit 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:54eggheads/event/channel
23:56eggheadalso I have no idea what i'm doing :)
23:56futile:D
23:56futilemore than i
23:59eggheadthe whole rendezvous thing in core.async is so weird coming from js events
23:59eggheadthe notion that a message can only be read once