#clojure log - May 31 2013

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

0:00 callen: tieTYT: It's usually not worth it unless you're intentionally writing something complex and ignoring an excellent JS framework (granger has a good reason for this, you probably do not)

0:01 tieTYT: well I want to make a game with the html5 canvas

0:01 this tutorial makes it look easy: http://nakkaya.com/2012/01/31/clojurescript-canvas-a-simple-breakout-implementation/

0:01 callen: tieTYT: then definitely no.

0:02 tieTYT: can you elaborate on the pain?

0:02 callen: tieTYT: unless the game is intentionally trivial and a throwaway, that is.

0:02 tieTYT: is it a throwaway learners project?

0:02 tieTYT: yeah, but it may grow into something more

0:02 callen: erm, you have to make a choice.

0:03 tieTYT: it's to teach myself clojurescript. I was going to make a snake on steroids, not a WOW

0:03 callen: if you do it in cljs, but decide to make it something serious, you'll probably have to rewrite.

0:03 tieTYT: why?

0:03 clojurebot: Why is startup slow is busy compiling the `for` macroexpansion

0:03 tieTYT: why does clojurebot do that? Is it ever useful?

0:03 callen: sometimes.

0:04 tieTYT: cljs doesn't win you more than it costs you outside of some very narrow use-cases (d3 visualizations and a wrapper come to mind)

0:04 tieTYT: something more performance intensive like an html5 game *cannot* be in something like cljs if there are practical performance concerns.

0:04 practical meaning, "I cannot be forced into a rewrite when/if I hit a brick wall"

0:04 bbloom: at least not without *SIGNIFICANT* cleverness :-)

0:05 callen: macros can be abused to get around some of the performance issues, but not all and you're going to end up debugging errors you don't understand.

0:05 it's usually not worth it.

0:05 tieTYT: what would you recommend?

0:06 callen: frontend stuff is somewhat constrained in what you can get away with, unlike backend.

0:06 tieTYT: that's a shame. Because it seemed like a great opportunity to learn clojure better

0:06 callen: depends on the project. HTML5 games commend the use of a good framework.

0:06 complex SPAs should probably be in AngularJS.

0:06 jacortinas: Is there a best practice out there regarding changing behavior between local development and production deployed code? For example, I need to not use s3 when doing file uploads locally during development, but use s3 in production or staging.

0:06 callen: simple stuff suffices with jQuery and vanilla JS.

0:06 tieTYT: what's SPA?

0:07 callen: tieTYT: single-page app.

0:07 tieTYT: implies a more complex/serious frontend application.

0:07 tieTYT: ah right

0:07 yeah that's what I was planning

0:07 dnolen: bbloom: tieTYT: you really don't have to be that clever to write fast CLJS, you just write what you would if you were writing fast JS.

0:08 and many interesting games don't really require obsessing about perf

0:08 jacortinas: If you really needed to you could write optimized loops in plain javascript, things like that.

0:08 callen: tieTYT: erm, you were planning a game. I cased that out separately.

0:08 dnolen: jacortinas: loop/recur becomes optimized loops in JS

0:08 bbloom: dnolen: you need significant cleverness to write idiomatic-ish code

0:09 (that is also fast)

0:09 jacortinas: yeah

0:09 dnolen: bbloom: no more cleverness that you need in JS

0:09 jacortinas: yup

0:09 tieTYT: getting a lot of peer pressure here to not even look into it

0:09 dnolen: loops recur, arrays, objects, arithmetic

0:09 tieTYT: dnolen: I don't think I know JS well enough to be clever with JS

0:09 bbloom: *shrug* if you're gonna avoid all of clojure's libraries and types, you might as well just write coffeescript

0:09 ehaliewicz: well you have macros, which can be pretty great for optimizations

0:09 callen: tieTYT: then the situation is even worse because you really need to know the underlying JS.

0:09 ehaliewicz: depending on what you're doing

0:09 callen: tieTYT: especially with the obtuse error messages.

0:09 jacortinas: Writing a game would honestly end up mostly like plain javascript ( I think ), you end up using things like requestAnimationFrame

0:10 callen: tieTYT: you're better off learning vanilla JS through this project.

0:10 tieTYT: callen: even more than angular?

0:10 callen: Angular is not a programming language, it's a framework. You still need to know JS and to have a good reason for using it.

0:10 bbloom: when writing clojure, you can get away with minimal Java knowledge. when writing cljs, you probably really still want browser & js experience

0:10 callen: you haven't described a project that commends the use of Angular.

0:11 bbloom: significnat

0:11 tieTYT: i have significant java knowledge actually

0:11 callen: tieTYT: I concur with what bbloom just said. but java is besides the point here.

0:11 bbloom: i was speaking generally

0:11 tieTYT: that sounded arrogant

0:11 dnolen: bbloom: i disagree - you can write a high performance game the same way you would in JS, write you perf sensitive stuff low level - everything else at a high level

0:11 this is more or less how CLJS itself is written

0:11 callen: back to the point, you need to know the DOM and JS.

0:12 tieTYT: i know it a bit, but it sounds like i don't know it well enough to attempt clojure

0:12 bbloom: dnolen: what is clear no brainer perf stuff to you is significant cleverness to other folks :-)

0:12 tieTYT: clojurescript i mean

0:12 bbloom: dnolen: remember that you deeply understand the output of any particular piece of cljs code

0:12 dnolen: bbloom: OK, but I think if you're going to do a high perf game you probably know something about JS perf anyhow

0:12 I don't really know secret tricks, I just know JS

0:12 callen: dnolen: he needs to know JS in order to get anywhere with CLJS. I don't believe you to be disingenuous so I have to think that you're really that far removed from the typical programmer's experience.

0:13 tieTYT: but vanilla JS sounds pretty bad. Shouldn't I at least use jquery so that I don't have to figure out browser inconsistencies?

0:13 callen: curse of knowledge and all that.

0:13 tieTYT: laughable notion.

0:13 dnolen: tieTYT: if you going to use jQuery you don't care about perf anyhow

0:13 brehaut: dnolen: knowing JS is knowing how to herd a bag of angry cats though; thats a huge leg up

0:13 bbloom: tieTYT: if you are writing a game w/ canvas, browsers are consistent enough

0:13 callen: tieTYT: jQuery doesn't spare you from knowing JS, it just cleans up DOM API inconsistencies.

0:13 tieTYT: and JS isn't that unpleasant, you have first-class functions.

0:13 tieTYT: yeah I know a little bit about it. I'm just rusty

0:14 bbloom: i generally just check http://caniuse.com/ before i use anything that isn't wrapped up neatly in the browser APIs

0:14 dnolen: tieTYT: in anycase, JS or CLJS - it possible to write games

0:14 bbloom: the known issues data is invaluable

0:14 dnolen: tieTYT: I don't disagree with the sentiment that to get far in CLJS you need to be comfortable in JS

0:15 tieTYT: yeah I'm not super comfortable

0:15 callen: JS and DOM knowledge are a prerequisite regardless, might as well conquer that first.

0:16 amalloy: are you familiar with the libnoir/noir session middleware?

0:16 amalloy: not really. i vaguely remember there being a with* macro of some kind

0:17 like, (with-session foo) is vaguely like (binding [*session* (atom {})] foo)

0:21 tieTYT: callen: do you think your opinion on this would probably change if I asked the same question in 5 years? IE: do you think cljs is just too immature for this right now?

0:22 callen: cljs could improve enough for my opinion to change, I ping nolen periodically about one of the core dealbreakers.

0:22 bbloom: i dunno, i think it's astonishing to me that there are professional software engineers who have no idea how the C calling convention works :-P

0:22 tieTYT: callen: what's that?

0:23 callen: source maps, for one.

0:24 dnolen: tieTYT: regardless of callen's opinions, plenty of people find CLJS preferable over JS even w/o source maps

0:25 tieTYT: i don't evekn know what source maps mean

0:25 dnolen: tieTYT: mapping compiled JS back to original source for debugging purposes

0:25 callen: it means knowing what the fuck just threw that opaque error.

0:25 tieTYT: ah

0:25 akhudek: source maps will be grand

0:25 tieTYT: i would imagine coffeescript has the same issue

0:25 dnolen: tieTYT: Michal Marcyk will be working on that for GSoC

0:25 tieTYT: JS has the same issue for that matter

0:26 callen: tieTYT: nope.

0:26 has source maps and better error messages.

0:26 dnolen: callen: having used CS quite a bit it doesn't have better error message

0:26 unequivocally CLJS has better error messages, it actually *has* some

0:27 tieTYT: CLJS is def rough around the edges, no question about that

0:28 callen: another issue that biases my response is that I pretty much only use JS in relatively complicated frontend apps that virtually require the use of AngularJS. The integration story for CLJS with AngularJS needs improvement.

0:28 dnolen: if you think AngularJS is a good idea, I don't really

0:29 but interop in general is important

0:29 akhudek: I definitely prefer writing cljs to js. The biggest pain points for me are rough tooling and a lack of source maps.

0:29 callen: dnolen: It's incredibly compelling if you want to move past the pyramid slave labor model for building labor-intensive frontend apps.

0:29 dnolen: callen: eye roll

0:30 tieTYT: i kind of have this same complaint about clojure actually. I don't know if it's a CCW issue, but the stack traces usually don't help for shit

0:30 egghead: dribnet did some stuff that makes interop from cljs easier callen

0:30 https://github.com/dribnet/strokes/tree/master/src/cljs

0:30 tieTYT: they often point to the namespace definition instead of the cause of the problem

0:31 akhudek: tieTYT: are you using clojure.stacktrace?

0:31 tieTYT: if (pst) works I am, aren't I?

0:31 akhudek: usually you get a line number of the offending code

0:31 amalloy: bbloom: anecdotal evidence for you. i have a vague idea that `extern "C"` means the caller pushes the arguments on the stack, and the callee pops the stack when he's done. but these things can be looked up in books, on the rare occasion you need to know them, so memorizing them doesn't strike me as an important measure of a programmer

0:32 egghead: clojure.stacktrace is new in 1.5 right?

0:32 akhudek: tieTYT: http://richhickey.github.io/clojure/clojure.stacktrace-api.html

0:32 tieTYT: one time I accidentally removed the brackets around the arguments of a function definition and the error was on the ns definition. Was really hard to debug

0:32 akhudek: I use (e)

0:32 tieTYT: I thought those were the same

0:32 egghead: ritz can help w/ debugging too

0:32 akhudek: maybe they are, dunno

0:32 bbloom: amalloy: that's the minimal level of understanding i'd expect a professional engineer to have

0:32 amalloy: many don't.

0:32 tieTYT: akhudek: hey, i'm the newb here, not you :P

0:32 akhudek: in any case, I almost always get a line number

0:33 dnolen: akhudek: that's a very old link - most of that stuff is in clojure.repl now

0:33 amalloy: i dunno, i think it's becoming a lot less necessary to even know that much. but i suppose i don't feel strongly about it

0:33 egghead: blindly manipulating symbols

0:34 akhudek: dnolen: ah, didn't realize. I've been using that since… 1.2?

0:34 dnolen: tieTYT: the worst bugs are the ones at the level of reading/parsing - ns forms, fn forms since you don't get sensible error information

0:34 bbloom: amalloy: i was mostly trying to convey the fact that i like people to have at least a cursory understanding of 2 or 3 levels of abstraction below them

0:34 dnolen: tieTYT: except for those error messages are usually pretty accurate

0:34 tieTYT: dnolen: yeah

0:35 amalloy: i agree with that

0:35 tieTYT: i'm spoiled by java/haskell's compiler

0:35 amalloy: i'm not sure C is only three levels below most people anymore, but something is, and they should know about it

0:36 bbloom: amalloy: on a mature enough cross platform VM (ie JVM or a browser) that's probably true

0:36 tieTYT: back to cljs, i used to write a lot of GWT. It was impressive how little you needed to know about JS with that

0:37 callen: GWT was horrific.

0:37 bbloom: amalloy: i'm not sure it's so much discrete "levels" as it is some metric of abstraction leakiness and layering usefulness :-)

0:37 tieTYT: i don't like writing apps that GWT is a good fit for

0:38 alex_baranosky: how can I print a Double but force it to not print like 1.0E8

0:38 amalloy: $google java format number

0:38 lazybot????????

0:38 clojurebot: lazybot is echo ~lazybot

0:39 bbloom: amalloy: http://www.raynes.me/logs/irc.freenode.net/clojure/2013-05-30.txt look at the last line

0:39 amalloy: something went horribly wrong in bot land

0:40 amalloy: at 3:12, huh? weird. that was well after the linode emergency

0:40 &1

0:42 alex_baranosky: amalloy: thanks.

0:43 amalloy: &1

0:43 lazybot: ⇒ 1

0:43 amalloy: $mail Raynes lazybot was busted; i've restarted him in your screen session

0:43 lazybot: Message saved.

0:44 bbloom: &"I AM ALIVE"

0:44 lazybot: ⇒ "I AM ALIVE"

0:44 metellus: lazybot is echo ~lazybot

2:10 technomancy: argh; mysterious nrepl.el bugs

3:12 https://github.com/technomancy/nrepl-discover

3:31 ddellacosta: how do you format a regexp in Clojurescript?

3:31 I'm trying variations on this: #"/blackrock/i" and it's not working.

3:36 getting closer, but can't get flags to work...?

3:36 (clojure.string/replace "FOO" (js/RegExp. "foo", "i") "oof")

3:42 argh

3:42 https://www.refheap.com/15166

4:12 noprompt: Raynes: are you here?

4:13 or amalloy_

4:32 jro__: what is status of clojure.core.reducers?

4:35 clgv: jro__: it is included in clojure 1.5.1

4:52 asaleh: question: are core.constraints superset of preconditions?

5:40 jaley: I have a web service, one of things it serves is an expensive operation (generation of a big image). I want to give users access to this, but I don't really want my server running this ~20 second operation on every click. A 5-minute old snapshot would be fine… Any implementation suggestions? I was looking at core.cache for the TTLCache, but AFAIK the way to use this is by putting the cache in an atom/ref/whatever, which means in the case of

5:40 cache miss I'm still likely to have multiple threads generating the same image, only to have all but one discarded when the transaction retries?

5:45 arrdem: jaley: one hack (and it is a hack) is to have a worker thread that renders your page every 5s, updating a cache atom.

5:46 atoms update, well atomically so you are guranteed to get content out the end, but there is nothing more than a probability of getting the "newish" content.

5:46 callen: jaley: matryoshka dolls.

5:46 arrdem: callen: lol

5:46 callen: I'm quite serious.

5:46 composable caches backed by memcached or redis work great.

5:47 jaley: arrdem: Hmm, yeah… I'm thinking actually if I use an agent, requests will be serialised, so I won't have the problem of two requests doing the work at the same time, but I'll need to initialize the agent with a sensible starting state

5:48 callen: yeah it's also worth noting that this project isn't out of the toy stages yet :D

5:49 callen: jaley: nobody caches in-memory on the server, that's silly.

5:49 jaley: use memcached or redis.

5:51 jaley: callen: the image is on disk, I'm caching a string - the file name, of which there will be max 10

5:51 callen: jaley: why do you need to cache a filename?

5:52 arrdem: jaley: I'd think that the file name is nearly free to compute, you want to memcache the image content

5:52 callen: seriously

5:52 jaley: OK, so I have this library, it sucks in a load of data and writes a jpeg to disk

5:52 that takes 20 seconds, ish

5:54 I just have it write to a randomly named tmp file and delete it later

5:55 callen: jaley: this doesn't really make sense.

5:55 jaley: I just don't want to do all that work for every request. This tool will be used by approx 100 users, it's an internal company tool, doesn't need web scale, but may have to handle 2-3 concurrent requests for the same image

5:55 I'd rather, when handling 3 requests for the same image, it didn't generate it 3 times

5:55 callen: jaley: you should be storing the images in a database

5:56 arrdem: callen: why bother? that's way heavyweight for what he's looking at

5:56 jaley: i think that might be over-engineering a 100 user tool?

5:57 arrdem: jaley: frankly it sounds like a crontab entry and some bash scripts would be a better fit than a clojure server :/

5:57 * mix an apache httpd instance in for good measure

5:57 callen: it would take me less time to just stash the data in postgres than anything else that's been suggested

5:57 short of stashing the base64 in a redis server

5:58 jaley: whether writing to a DB or to disk, I still have to solve the concurrency issue

5:59 callen: the database solves that problem if I haven't missed anything.

5:59 I don't know why you'd assume databases can't handle multiple readers and writers. That's a huge chunk of why they're so useful.

5:59 jaley: I have an image, whether a file or blob in a db, and a timestamp. If it's more than n minutes old or not there, I want to regenerate it and return the new one. Else return the existing one. I don't want more than one request (i.e. thread) generating the same image.

5:59 callen: jaley: redis has auto-expiring keys

6:00 jaley: set the 5 minutes or whatever key expiry you want on the value.

6:00 jaley: if you try to GET the key and it's not there, regenerate.

6:00 jaley: callen: so two threads concurrent GET the same key and it's not there for either of them

6:00 callen: then what?

6:00 arrdem: callen: sure, then you hammer someone with a 20s latency after a 5m delay

6:01 jaley: it would seem that both get hammered

6:01 callen: last guy in wins unless he wants to do a final pass check before stashing the final result

6:01 jaley: arrdem: right, exactly what my question was about avoiding :P

6:01 callen: to answer what arrdem is saying, there are a few ways to handle that.

6:01 you can either generate the cache as a batch, or you can trigger per image.

6:01 What will work for you will depend on how much data is involved.

6:04 so you can setup auto-expiry in postgres with subscribers to trigger functions

6:04 image expires? trigger gets called. subscriber to that trigger responds and regenerates the cache.

6:05 alternately, use EXPIRE and redis pub/sub to do more or less the same thing.

6:05 jaley: ^^

6:10 jaley: callen: ok, I have plan involving agents which I'm going to try out before I commit to too many hours work here :)

6:10 callen: thanks for the help

6:12 callen: jaley: my suggestion will take less time than hacking it up yourself - but good luck anyway.

6:22 rbarraud: wow - whole lotta leavin' goin' on :-/

6:22 callen: rbarraud: prooooobably a netsplit.

6:23 rbarraud: or they be sensitive souls...? ;-)

6:23 arrr

6:30 talios: 'lo rbarraud

6:31 rbarraud: howdy talios

6:32 what excitement is afoot in your neck'o'the woods his fine QBWeekend? :-)

6:32 talios: not much - I forgot it was on ;)

6:32 birthday yesterday - old age ;p

6:32 might go see Star Trek, and Iron Man 3 tho

6:32 rbarraud: yeah - 21 already eh? Tempus Fugit! :-)

6:33 nearest pic theatre here is ~28km away

6:33 :-/

6:33 Apple TV FTW! ;-)

6:33 talios: where are you based?

6:33 rbarraud: Patea - more specifically, Whenuakura :-)

6:34 ~60km north of Wanganui

6:34 clojurebot: Cool story bro.

6:34 rbarraud: not exactly Action Central

6:34 talios: when did you move there? or have I just been delusional that you were Auckland based

6:34 rbarraud: mind u i could've had a brewski or 2ski t the Bowling CLub in Patea had I felt so inclined tonight :-)

6:35 I've been kind of exiled here since start of Jan, but coming up ~every 4 weeks or so for appts

6:35 reduced outgoings here accom-wise

6:35 talios: ahh

6:35 rbarraud: i'd like to be back up there in the thick of the action and opportunities though

6:36 meanwhile intending to dispose of a lot of vintage-y stuffz before i return

6:36 unfortunately, ARC doesn't work with physical objects ;-)

6:40 weak POBoxOfStuffz *oldstuffbox ;

6:41 oldstuffBox = nil ;

6:41 *poof*!

6:41 too easy! ;-)

6:41 if only

7:18 talios: Are there any Code Retreats or the like on this weekend? - and are you in NA or AKl?

7:19 talios: in Auck, no code lounges planned this weekend no

7:19 babilen: Could somebody explain why, say, https://github.com/clojure/tools.reader does not declare a dependency on clojure in its pom as detailed in https://github.com/talios/clojure-maven-plugin -- Is this supposed to be handled by the parent pom.contrib ? If the latter, why does tools.reader mention clojure-maven-plugin at all?

7:21 talios: Oh, I was just about to file a bug against clojure-maven-plugin -- It seems as if the latest available version of clojure-maven-plugin is 1.3.17, but only releases up to 1.3.15 are tagged in git. Is that intentional?

7:22 talios: babilen - LIES! ( as he types git push --tags into iTerm) :)

7:22 babilen: heh, okay :)

7:22 talios: babilen - not intentional no :)

7:22 babilen: yeah, that did it -- thanks!

7:22 talios: was that the bug report, or am I expecting something else ? :)

7:23 babilen: No, that was it. :)

7:23 talios: coo.

7:23 babilen: I'd be happy about a comment regarding my earlier question though (if you have the time and know something about it)

7:24 talios: which question? ( i may have missed that )

7:25 babilen: Could somebody explain why, say, https://github.com/clojure/tools.reader does not declare a dependency on clojure in its pom as detailed in https://github.com/talios/clojure-maven-plugin -- Is this supposed to be handled by the parent pom.contrib ? If the latter, why does tools.reader mention clojure-maven-plugin at all?

7:25 talios: oh found it right there :)

7:25 babilen: hehe, well ..

7:26 talios: hrm - thats a good question actually, cause it doesn't actually declare a parent pom either

7:26 Anderkent|away: pom.contrib does in fact add a clojure dependency

7:26 talios: ah it does - its just in the middle :)

7:26 yes - the parent pom declares that dep

7:26 Anderkent|away: I'm confused on how your project.clj and the pom.xml are out of sync tho

7:27 project.clj declares :parent pom.contrib 0.0.26

7:27 pom has it 0.1.2

7:27 talios: project.clj and pom.xml are independent

7:27 afaik the lein builds are totally separate to the clojure builds

7:27 er maven builds

7:28 maven is used pretty much solely for releases

7:28 babilen: talios: Okay, but the parent pom mentions clojure-maven-plugin as well. Why is that repeated in tools.reader pom?

7:28 Anderkent|away: babilen: to control the configuration

7:28 talios: babilen - mmm, it has custom configuration for <namespace>clojure.tools.reader.impl.ExceptionInfo</namespace>

7:29 babilen - that -could- be handled by a property, and made common, but different contrib's may have more namespaces, or different configs

7:29 to be honest - this is the first time I've looked at the contrib poms :)

7:29 at least, first time in about 2 years

7:30 Anderkent|away: talios: having two descriptors of your project be out of sync (and building against different parent poms :O) seems like a bad idea for me...

7:31 esp. since the pom can be generated from project.clj

7:31 talios: is lein's parent a pom tho? or is it a lein project?

7:31 I've never used lein :)

7:31 well, ok I like - I've used it to bootstrap a 5 line script

7:32 lie even. I have no idea how lein works.

7:32 Anderkent|away: talios: lein uses maven as the backend. The parent is a pom

7:32 talios: Anderkent|away - I knew it used maven underneath ( tho kinda assumed it may use Aether now ), but didn't know its parents were poms. In that case, it does seem wrong to have different parents

7:32 babilen: talios: Okay, thank you - I see much clearer now.

7:33 Anderkent: well, I don't think the parent is used for anything other than pom generation

7:34 talios: last time I made a pom from lein for that mini script, it didn't even put the clojure-maven-plugin in there...

7:35 Anderkent: it doesn't by default, because the purpose of doing lein pom is to get a project descriptor, not a maven build pom. But you should inherit the clojure-maven-plugin bindings from the parent pom

7:35 or you can add it manually by puting pom-injections into project.clj

7:35 talios: true true

7:35 not my projects tho :)

7:35 Anderkent: :)

7:36 talios: I didn't realize contrib still used it till I was interviewing ambrose the other month for the podcast

7:36 Anderkent: it as in maven?

7:36 talios: as in clojure-maven-plugin

7:37 Anderkent: right

7:39 I wish I could pretend not to understand why people still use maven... But we're still chugging along with a monster maven build even though every single dev would like to switch to lein :) momentum is a king

7:40 SomeOtherGuy: Hey guys! Can anyone explain to me how to use the filter command in clojure?

7:40 babilen: SomeOtherGuy: http://clojuredocs.org/clojure_core/clojure.core/filter has some examples -- What are you having problems with?

7:40 clgv: SomeOtherGuy: use a predicate the evaluates to true for the elements you want to keep in the given collection

7:40 Anderkent: SomeOtherGuy: you give it a function that returns truthy for values you want to keep, and a collection

7:41 ,(filter odd? [1 2 3 4 5])

7:41 clojurebot: (1 3 5)

7:41 clgv: SomeOtherGuy: like this ##(filter odd? (range 10))

7:41 lazybot: ⇒ (1 3 5 7 9)

7:41 Anderkent: why is it always `odd?` :P

7:41 talios: Anderkent - on a mixed java/clojure project maven still works best I find. Also - one reason: maven-release-plugin. Nothing else has anything suitable to match it.

7:41 clgv: because the question was odd ;)

7:41 talios: at least, not as a standard plugin

7:41 SomeOtherGuy: Okay, for example If I want the first 60 numbers that is a multiplicate of 7?

7:42 clgv: &(take 60 (filter #(zero? (mod % 7)) (range)))

7:42 lazybot: ⇒ (0 7 14 21 28 35 42 49 56 63 70 77 84 91 98 105 112 119 126 133 140 147 154 161 168 175 182 189 196 203 210 217 224 231 238 245 252 259 266 273 280 287 294 301 308 315 322 329 336 343 350 357 364 371 378 385 392 399 406 413)

7:42 SomeOtherGuy: My brother just gave me that task to figure out yesterday. I found a solution but he also told me I can solve it with filter command. Can't stop thinking about it. I'm a total newbie.

7:43 Anderkent: talios: `lein-release` does something similar, but yeah I guess that is a good point

7:43 SomeOtherGuy: It works! :D Great! Thanks. Will try to figure out what all of that means now. Thanks a lot!

7:44 talios: Anderkent - well lein-release will tag, but I don't think it covers the deploy to maven repo, otherwise - why wouldn't contrib just use lein-release

7:44 clgv: SomeOtherGuy: #(zero? (mod % 7)) is the divisibility check

7:45 babilen: talios: One more question (if I may): I am in the process of packaging tools.reader and have to use maven to build it as it requires AOT compilation. Clojure's parent pom looks as if it does a lot that I don't actually need ... Would it be enough to patch tools.reader's pom to declare the clojure dependency for the build to succeed?

7:46 talios: I am not convinced that it will be enough though as it misses, for example, build-helper-maven-plugin - but I am not entirely sure.

7:47 SomeOtherGuy: @clvg ##(filter odd? (range 10)) so this says all odd numbers from 0 - 10? and (mod % 7) would be all numbers that can be devided by 7? What does #(zero?) stand for? Starting at 0?

7:47 lazybot: ⇒ (1 3 5 7 9)

7:48 talios: babilen - mmm not sure, depends on what else the parent pom adds in ( build-helper would probably be for adding a slim.jar or something? ), you should be able to just add clojure as a dep - i'd be careful with the dep tho as you don't neccessarily want your release to enforce a specific clojure version

7:48 not sure if its flagged as optional in the parent?

7:51 babilen: talios: The parent pom simply defines "<clojure.version>1.4.0</clojure.version>" which is then substituted later -- I am packaging for Debian btw and while we need to be able to compile *everything* from source we also don't need certain things that would be done if I "blindly" use the parent pom. I am currently trying to decide how to handle this and am leaning towards simply patching tools.reader's pom with a slimmed down version of the parent ...

7:51 ... pom.

7:52 talios: babilen - ooo, you're one of thoes packaging guys :) You guys like making life hard for yourself :)

7:53 that explains wanting my tags :)

7:53 babilen: talios: Well, yes. The whole "just download the jar" approach makes life hard for us as one of our requirements is that everything has to be built from source. And I am running into circular dependencies here and there

7:53 talios: Yeah, that explains it :)

7:54 talios: I still don't think that "I want to compile this software locally" is an outrageous requirement -- Either way, does my plan above sound feasible or would it be better to define our own parent.pom ?

7:55 talios: you should be able to patch the poms

7:56 it sounds like what you want to somehow automate, is use the "mvn help:effective-pom" ( which pulls in a fully materialized pom based on parents ) then patch that, or strip it down

7:56 altho - that effective-pom is HUGE

7:57 babilen: Well, it sounds like a start though. I'll see what works out best. You helped me a lot and I am grateful for that, thank you :)

7:58 talios: babilen - no worries, any other questions you can generally find me here - or on twitter @talios, or mark @ talios.com

7:58 tho right now I think its time for bed ( 11:50pm )

7:59 babilen: talios: Sleep tight and thanks for the offer. :)

8:04 rbarraud: zzz night talios

8:14 callen: https://jira.mongodb.org/browse/PYTHON-532 Odin knows I've been this guy before.

8:19 Anderkent: SomeOtherGuy: ##(doc zero?)

8:19 lazybot: ⇒ "([x]); Returns true if num is zero, else false"

8:19 Anderkent: babilen: so you're trying to build all transitive dependencies of a maven project?

8:20 callen: well, I can get his emotional state, but publicly shaming someone for 4 year old code that you have no context for is not cool

8:20 babilen: Anderkent: Yes, that is the only way to build everything from source

8:20 Anderkent: You have to build them at least once

8:21 callen: Anderkent: that's the only part that bothered me. The rest I enjoyed.

8:21 Anderkent: there is however no context for defending that code :P

8:22 Anderkent: callen: how about if this was originally a private codepath that was only executed through a wrapper that performed the validation

8:23 callen: Anderkent: I don't have time for implausible excuses. It's 10gen, quality control is a distant 10th in the priority queue for that company.

8:23 Anderkent: So basically you don't care about the context. That's different to 'no context exists that would make this code defendable'

8:24 And the fact that quality control is not important for the company is a fact about its managers, not the developers

8:24 most of the time those are not the people git blame points you to

8:25 SomeOtherGuy: Anderkent: Just got my brother to explain it to me! :)

8:26 Anderkent: Thanks, that's a cool functionality :)

8:26 Anderkent: babilen: is it sufficient if you build each component standalone against pre-packaged jars? That would be much easier than trying to build everything from source at the same time

8:27 babilen: Anderkent: Not everything has to be build at the same time, but we have to bootstrap *everything* from source. (maven builds are done offline but have access to a local maven repository for dependencies)

8:28 Anderkent: And yes, circular dependencies *are* a problem

8:30 jweiss: sometimes when debugging a macro i'm writing i'll see an error something like "ArityException, wrong number of arguments (-1)" I assume this is a bug, right?

8:31 Anderkent: jweiss: I'd expect that to have something to do with the two 'implied' arguments to macroes, and clojure trying to correct for them (i.e. 1-arg macro def expects 3 arguments, gets 1, substracts 2 'implied' args that it thinks it would always get, prints -1)

8:32 babilen: right, so you start with an empty maven repo

8:33 jweiss: Anderkent: sorry, which implied arguments are those?

8:33 Anderkent: i don't think there's a general solution :P If you're doing it by hand, you can do something like `rm -rf ~/.m2/repository && mvn dependency:go-offline` to see what it has to have for a build to succeed

8:33 jweiss: &form and &env

8:34 jweiss: actually, I googled that and I notice I'm confused, so maybe you should just disregard what I said :P

8:36 jweiss: seemed pretty easy to reproduce but i can't remember how i did it

8:36 googling for -1 doesn't work :(

8:37 Anderkent: jweiss: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L6473

8:37 called it :)

8:37 jweiss: (inc Anderkent)

8:37 lazybot: ⇒ 1

8:38 Anderkent: no idea when it would happen though

8:38 jweiss: Anderkent: so the question is how does the macro get called without the "extra"

8:45 Anderkent: Yeah. That, or it's doing the -2 more than once

8:45 macroexpand within macroexpand?

8:52 ha!

8:52 ,(do (defmacro xpand [body] (macroexpand-1 body)) (macroexpand-1 '(xpand (defn))))

8:52 john2x: how do I split a hashmap into a list of [key value] pairs?

8:52 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

8:52 Anderkent: bah

8:52 jweiss: run (do (defmacro xpand [body] (macroexpand-1 body)) (macroexpand-1 '(xpand (defn)))) in a repl :)

8:53 john2x: you don't have to do anything, it *is* a list of key value pairs

8:53 clgv: Anderkent: thats because of you defn ;)

8:53 Anderkent: clgv: still, '-2' arguments

8:53 ;)

8:53 clgv: (do (defmacro xpand [body] (macroexpand-1 body)) (macroexpand-1 '(xpand (defn f [])))) =>(clojure.core/defn f [])

8:54 Anderkent: clgv: run it in a repl and look at the exception. It says '-2' arguments passed to defn

8:54 that's what I wanted to reproduce

8:54 clgv: ok

8:54 Anderkent: john2x: for example ##(take 3 {:a 1 :b 2 :c 3})

8:54 john2x: Anderkent: I wanted to transform {:foo "bar"} into a querystring like "foo=bar".. is there already library that does that?

8:54 lazybot: ⇒ ([:a 1] [:c 3] [:b 2])

8:54 john2x: ohh

8:55 clgv: john2x: just use reduce-kv on the map to build up the string ;)

8:56 Anderkent: clgv: is it different to (reduce (fn [state [key val]] ...) init map) ?

8:56 clgv: &(require '[clojure.string :as s])

8:56 lazybot: ⇒ nil

8:57 clgv: &(s/join " "(map #(apply (format "%s=%s" %)) {:a 1 :b 2 :c 3}))

8:57 lazybot: java.util.MissingFormatArgumentException: Format specifier 's'

8:57 clgv: or like that ^^

8:57 Anderkent: without the parens around format, obvlsy :)

8:57 clgv: loh right^^

8:58 &(s/join " "(map #(apply format "%s=%s" %) {:a 1 :b 2 :c 3}))

8:58 lazybot: ⇒ ":a=1 :c=3 :b=2"

8:58 clgv: damn^^

8:59 john2x: thanks!

8:59 augustl: where should ~/.lein/profile.clj go on windows?

9:00 Anderkent: &(s/join "&" (map (fn format-entry [k v] (format "%s=%s" (name k) v)) {:a 1 :b 2 :c 3}))

9:00 lazybot: clojure.lang.ArityException: Wrong number of args (1) passed to: sandbox10042$eval13855$format-entry

9:00 Anderkent: bah :P

9:00 missed the destructuring

9:00 decaf: augustl: same place. c:\Users\<yourname>\.lein\ in windows 7

9:02 augustl: decaf: ah, thanks

9:06 clgv: augustl: if you used lein already then that directory should exist

9:16 sandbags2: Am I doing something wrong? I'm trying to search clojars.org for the 'math.numeric-tower' library and although I can get it by specifying org.clojure/math.numeric-tower "0.0.1" I can't find the lib on clojars itself.

9:16 augustl: clgv: yup, seems to work.

9:17 sandbags2: I was trying to find the right version number to use... on GitHub the library appears to be 0.0.3

9:17 but that didn't work as a require

9:17 ohpauleez: sandbags2: All the Clojure stuff is in maven central -search.maven,org

9:17 clgv: andbags2: it is on maven

9:17 ohpauleez: search.maven.org

9:17 sandbags2: ah so i'm looking at the wrong site?

9:17 ohpauleez: correct

9:18 sandbags2: ahh so "maven central" the clue is when it says it got it from "central"

9:18 thank you

9:18 ohpauleez: http://search.maven.org/#search|ga|1|g%3A%22org.clojure%22

9:18 you're welcome

9:19 sandbags2: is search.maven.org reachable for you guys?

9:20 (http://downforeveryoneorjustme.com/search.maven.org also seems to say it's down...)

9:22 clgv: the search works

9:22 sandbags2: okay it's back

9:22 clgv: that isup.me is lying ;)

9:34 sandbags2: In the ClojureScript wiki it says "Existing Clojure libs will have to conform to the ClojureScript subset in order to work in ClojureScript" I'm trying to use math.numeric-tower and although I've made it a dependency in project.clj and :require'd it I'm getting "ERROR: JSC_MISSING_PROVIDE_ERROR. required "clojure.math.numeric_tower" namespace never provided at ..." Could these two facts be related?

9:43 ohpauleez: sandbags2: Yeah, the numeric tower stuff is JVM specific

9:44 sandbags2: ohpauleez: i'm wondering if Clojure libraries are, in general, not usable from ClojureScript..?

9:44 Foxboron: sandbags2: you could in theory rewrite what you need so it compiles.

9:44 sandbags2: is it only Clojure Core + your own Clojure code

9:44 ohpauleez: you'll have to look at the Google Closure library for the functions you're specifically using

9:45 Foxboron: sandbags2: could actually be a interesting projects to go around and try rewrite Clojure libs into ClojureScript libs.

9:45 tolitius: sandbags2: what were you going to use form "numeric-tower"?

9:46 sandbags2: tolitius: floor

9:47 clgv: sandbags2: converting to integer should do the trick

9:47 tolitius: you can drop to JS and use Math.floor

9:47 Anderkent: sandbags2: you can use (.floor js/Math my-arg) I suppose, though it does make your code cljs specific

9:47 scratch that, clgv is right

9:47 sandbags2: i'm okay with this code being CLJS specific as this is in-browser code I am doing

9:48 thanks for the suggestions

9:48 clgv: sandbags2: but only for positive floats

9:48 sandbags2: although, as I am learning Clojure, i've tended to look for Clojure solutions (rather than JS which I would prefer to avoid as much as poss :))

9:48 clgv: ,(println (int 3.5) (int -3.5))

9:48 clojurebot: 3 -3\n

9:49 sandbags2: clgv: yep +ve only works here, thanks

9:49 clgv: for negative numbers you need an additional decrement

9:50 tolitius: sandbags2: imo it is good to get use both. when you are integrating other JS libraries that do not play well with clj semantics, it is a good mental switch to train

9:50 *JS and CLJS

9:53 sandbags2: tolitius: you make a good point :)

9:54 Morgawr: I have a clojurescript question, not sure if this is the right place though... I have bound a function to a javascript event, however from that event I need to get the 'this' attribute, how do I do that? do I need to pass it to the event handler with a closure?

9:55 tolitius: Morgawr: this-as

9:56 (fn [] (this-as me (.-a me))))

9:56 Morgawr: great, thanks!

9:57 tolitius: https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/core.clj#L532

9:57 sure

9:57 Morgawr: perfect :)

10:08 asaleh: I have a macro-related question, Is there a way to have macro output two forms instead of just one?

10:11 mefesto: asaleh: you could output them in a (do ...) form

10:12 asaleh: mefesto, but do returns only the last form, I need to have several of them (trying to create macro generating contracts for core.contracts)

10:12 Anderkent: asaleh: return a do form that contains all your forms

10:12 mefesto: asaleh: how about a code example of the output you want?

10:13 Anderkent: asaleh: as in (defmacro my-macro `(do (defn first-fn [arg] 1) (defn second-fn [arg2] 2)))

10:13 I assume your forms side effect

10:14 clgv: asaleh: what exactly do you want to do?

10:14 asaleh: mefesto, Anderkent .. no, they don't have side-effects, they are just part of contracts syntax

10:14 Anderkent, clgv, mefesto ... let me put together a gist ...

10:18 Anderkent, clgv, mefesto ... https://gist.github.com/AdamSaleh/5685224

10:19 Anderkent, clgv, mefesto ... ^ I wan't to do something like that ...

10:20 Anderkent: asaleh: have the macro return a list of args and use apply to call with-constraints with those

10:20 clgv: asaleh: why dont you put "(contracts/with-constraints ~name " in the macro as well?

10:20 mefesto: clgv: +1

10:21 asaleh: Anderkent, clgv, mefesto ... thanks, will try :)

10:25 clgv: asaleh: is there really a use for this macro? in my opinion it is way too specific to be of general use

10:30 asaleh: clgv, I found out, that contracts provide side-effectig (contracts/provide) macro, so I am using that instead :)

10:31 clgv, and of course, in gist I provided simplified version, in reality I am trying to do a verification of a map, that serves as arguments for a rpc call

11:06 climaxius: question: after compiling my clojurescript javascript complains that there is no method "cljs.core.PersistentArrayMap.fromArray"

11:09 rebcabin: #clojurebot '(+ 1 2)

11:09 @clojurebot '(+ 1 2)

11:10 llasram: ,(+ 1 2)

11:10 clojurebot: 3

11:10 llasram: &(+ 1 2)

11:10 lazybot: ⇒ 3

11:10 llasram: And ##(+ 1 2)

11:10 lazybot: ⇒ 3

11:13 * si14_ dnolen: hi. core.logic question: how do you work with lists of random variables?

11:16 si14_: dnolen: sorry, found an example here: http://swannodette.github.io/2013/03/09/logic-programming-is-underrated/

11:26 climaxius: ok, somehow fixed my issue by running lein cljsbuild clean

11:26 wtf

11:28 tomjack: I think there are some gotchas in the stuff cljsbuild does trying to be fast

11:30 dnolen: si14_: lists of random variable?

11:37 tomjack: «Note: "walk" supports all Clojure data structures EXCEPT maps created with sorted-map-by. There is no (obvious) way to retrieve the sorting function.»

11:37 &(.comparator (sorted-map-by (comp - compare) 1 2 3 4 5 6))

11:37 lazybot: ⇒ #<core$comp$fn__4034 clojure.core$comp$fn__4034@17082b6>

11:40 tomjack: &(clojure.walk/postwalk #(if (number? %) (inc %) %) (sorted-map-by (comp - compare) 1 2 3 4 5 6))

11:40 lazybot: ⇒ {6 7, 4 5, 2 3}

11:40 tomjack: &(.comparator (empty (sorted-map-by (comp - compare) 1 2 3 4 5 6)))

11:40 lazybot: ⇒ #<core$comp$fn__4034 clojure.core$comp$fn__4034@1dac188>

11:40 tomjack: :D

11:45 lastavailablenic: What's the traditional way to put flash params in a hiccup template function that's used in most requests, without needing to specify the flash param in every Compojure route and manually pass it to every hiccup function that uses the template?

11:45 Also hi.

11:50 markeroon: Hi, I am hoping someone could help me. I am trying to filter a list based on the contents of a second, equally sized list. Is there an easy way to do this? Thanks!

11:50 llasram: markeroon: Example?

11:51 ToxicFrog|W`rkn: "based on" how? (filter (partial contains? (set second-list)) first-list)?

11:52 markeroon: (def i [a b c d e f]) (def j [10 11 12 13 14 15]) and only returning from the first list where j>12

11:52 lastavailablenic: Blast, nobody knows. Ok time to reinvent some wheels.

11:52 markeroon: ToxicFrog|W`rkn: trying this now

11:52 ToxicFrog|W`rkn: markeroon: that won't do what you want.

11:53 markeroon: ok

11:53 ToxicFrog|W`rkn: I took a guess on what you meant by "based on", since you didn't specify.

11:53 llasram: lastavailablenic: Yeah, sorry. There are people here who do web-fu, but appparently not at the moment :-)

11:53 markeroon: llasram :)

11:54 Ember-: ok, this is getting annoying

11:54 I need to be able to append data to HTML with Enlive without Enlive doing automatic HTML escaping

11:54 ToxicFrog|W`rkn: Hmm

11:54 Ember-: to be more exact, I need to append base64 encoded string as the value of img element

11:54 Anderkent: markeroon: &&(keep (map #(when (> %2 12) 1) [:a :b :c :d :e :f] [1 2 15 3 4 16]))

11:55 gah

11:55 typoed it

11:55 Ember-: everything works fine except that enlive insists on escaping the data

11:55 which of course makes the image go fubar

11:55 markeroon: Anderkent: woah, thanks. i am going to try to digest that. thank you.

11:55 Anderkent: sec need to fix it :)

11:55 Ember-: if I don't find a reasonable solution FAST I'm going to regexp this

11:56 which really would suck

11:56 cgrand: Ember-: use html-snippet

11:56 ToxicFrog|W`rkn: ,(map first (filter #(> 12 (second %)) (map list [:a :b :c :d :e :f] [1 2 15 3 4 16])))

11:56 clojurebot: (:a :b :d :e)

11:56 ToxicFrog|W`rkn: o.O

11:56 Ember-: cgrand: I use it, but I'm guessing you're suggesting I use it somewhere else

11:56 Anderkent: markeroon: &&(keep identity (map #(when (> %2 12) %1) [:a :b :c :d :e :f] [1 2 15 3 4 16]))

11:57 ToxicFrog|W`rkn: Oh wait

11:57 ,(map first (filter #(> (second %) 12) (map list [:a :b :c :d :e :f] [1 2 15 3 4 16])))

11:57 clojurebot: (:c :f)

11:57 cgrand: how are you trying to append data?

11:57 Ember-: cgrand: so, I read the HTML data in via html-snippet

11:57 Anderkent: gah what's the trigger for inline execution for lazybot

11:57 ,(keep identity (map #(when (> %2 12) %1) [:a :b :c :d :e :f] [1 2 15 3 4 16]))

11:57 clojurebot: (:c :f)

11:57 Ember-: then I try to append the data with at

11:57 ToxicFrog|W`rkn: Anderkent's is better, I think.

11:57 Ember-: (-> html (enlive/at [[:img]] img-as-base64))

11:57 markeroon: ToxicFrog|W`rkn, Anderkent: thank you both, that's great

11:58 ToxicFrog|W`rkn: Mine generates a lot of itty bitty temporary lists that are totally unnecessary.

11:58 Ember-: (defn img-as-base64 [n] (update-in n [:attrs :src] (constantly (str "data:image/png;base64," (img-to-base64 ((comp :src :attrs) n))))))

11:58 about like that

11:58 cgrand: what's img-as-base64? the value returned by html-snippet?

11:58 Ember-: so it's a function

11:58 cgrand: I saw

11:58 markeroon: ToxicFrog|W`rkn: I am going to study it regardless. thanks again.

12:00 Ember-: cgrand: I love Enlive, but this thing is really bugging me :)

12:00 cgrand: Ember- and where is the HTML that keeps getting escaped?

12:00 Ember-: it's the base64 string

12:00 that get's escaped

12:00 gets

12:01 cgrand: huh?

12:01 which character?

12:01 Ember-: at least /

12:02 cgrand: Ember-: can you put the output in a gist so that I can see the problem?

12:02 Ember-: what I'm trying to do here: embed images as base64 strings into img elements so that the HTML email sent works well

12:02 cgrand: Ember-: yeah I figured it from the source of img-as-base64

12:03 (ps: use assoc-in rather then update-in constantly)

12:03 Ember-: true

12:03 refheap dies on my paste :)

12:04 well, wait a sec

12:04 cgrand: http://www.collin.fi/~niklas/paste.txt

12:05 should start as data:image/jpeg;base64,/9j/4RZ1RXhp

12:06 oh crap...

12:06 I think I have another problem

12:06 cgrand: nevermind :)

12:06 thanks anyway!

12:07 cgrand: oh, ok because I on't see how attar)str turns + into &#43;

12:16 * si14_ dnolen: logic variables, of course. that post answered to my question, though.

12:18 tomjack: huh, is there CLP(Bayes) ?

12:18 oh maybe CLP(Prob)

12:21 found a paper about CLP(BN)

12:24 jweiss: how do i get records to print with pprint the same way they do with pr? eg, #foo.Myrec{:a 1}

12:27 si14_: tomjack: https://github.com/clojure/core.logic/wiki/CLP%28Prob%29

12:27 tomjack: you can find a lot on the topic there

12:28 tomjack: cool, hadn't seen ProbClojureNice

12:28 clojurebot: excusez-moi

12:29 Anderkent: jweiss: I think you'd have to change *print-pprint-dispatch*

12:33 dnolen: si14_: I was confused by what you meant by "random"

12:33 si14_: dnolen: why it's so slow https://gist.github.com/si14/f09a6caeb2355cd2e727 ? Am I doing something wrong?

12:33 * si14_ dnolen: yeah. I'm sorry. Asked in a middle of some quick hack and thought about something else :)

12:34 jweiss: Anderkent: what would i change it to? seems like it needs an entry for every record type

12:34 Anderkent: jweiss: 1 sec

12:35 dnolen: no idea why it's slow and I don't have time to dig into it at the moment

12:35 si14_: you could fire up YourKit and tell me thought ;)

12:35 s/thought/though

12:36 Anderkent: jweiss: https://www.refheap.com/15181

12:36 a little hacky ;>

12:36 jweiss: Anderkent: I'll take it, thanks@

12:36 er, thanks!

12:36 si14_: dnolen: don't have one yet :) I'm somewhat busy too, so I'll just use less LVs here now. Should I file an issue or is it not important enough?

12:37 dnolen: si14_: I don't really know what the point of that example is. Or why you think that should be fast

12:37 Anderkent: No problem, gotta fight for them imaginary irc points

12:37 dnolen: si14_: I only really care to benchmark real CLP(FD) problems

12:37 si14_: dnolen: I'm trying to rewrite http://tgk.github.io/2012/12/the-composing-schemer.html with less repetition (as in m1 m2 m3 …)

12:40 * si14_ the way that uses everyg like this was shown in your post (http://swannodette.github.io/2013/03/09/logic-programming-is-underrated/), so I've assumed it's fine. And I've assumed that thi should work fast because 11 logic variables with almost simples possible constraints are not so much, IMO

12:40 si14_: *this

12:56 dnolen: si14_: ok I took a moment to further isolate the issue, there is something weird going on

12:58 si14_: ok, ticket already exists for this http://dev.clojure.org/jira/browse/LOGIC-137?focusedCommentId=31190#comment-31190

12:58 si14_: tho this clarifies the issue

13:01 si14_: thanks for the report.

13:24 dobry-den: Is there an obvious way to reverse the order in which condp applies args to the pred so that this works? (condp .startsWith my-string …)

13:24 si14_: dnolen: thanks for considering it.

13:25 dnolen: si14_: apologies for the skepticism, I'm more open to perf reports if the example is extremely minimal. The run 42, nth etc was throwing me off

13:26 this is pretty cool http://github.com/frenchy64/core.typed-example/blob/master/src/fire/simulate.clj

13:30 bbloom: dobry-den: can't you just (condp #(.startsWith %2 %1) … )

13:31 dobry-den: or just use re-find ##(condp re-find "yzw" #"^x" :x #"^y" :y)

13:31 lazybot: ⇒ :y

13:32 dobry-den: bbloom: Yes. Kill me and put me out of my misery

13:32 I tried that and didn't read the error message. (it broke on my :else test (keyword))

13:33 which was a relic from my case statement

13:36 onlynickleft: Is there a better way to get a flash param from inside a hiccup layout function than to add a middleware that binds a global var *flash* at each request, which you can access inside the layout directly?

13:36 The only other way I can think is to have every single Compojure route specifically grab the :flash key out of the request and pass it to every hiccup view function.

13:36 And that seems terrible, just terrible.

13:37 weavejester: onlynickleft: What are you using the flash for?

13:38 onlynickleft: So that I can put success/failure/general-info messages into the next redirect, which might be redirected to any page on the site.

13:38 Also, thanks for all your contributions weavejester, you make my job so much easier. I ought to be paying you at this point.

13:39 weavejester: You're welcome :)

13:40 technomancy: hugod: did you see this? https://github.com/technomancy/nrepl-discover

13:40 onlynickleft: Also, thanks for using the "core" namespace in each of your projects. Some of my colleagues hate it because it's non-descriptive and seems to have an inverted meaning, but it's very helpful as it makes it easy to know which namespace to look in first for the highest-level public functions.

13:40 weavejester: One alternative I've been playing around with is to save all data, regardless of whether it's correct or not, and then generate the error/failure information based on what's in the database.

13:41 tomjack: yes :)

13:41 onlynickleft: Oh, so you've been running into the same question for the same reason? Hmm good to know I'm not crazy.

13:41 tomjack: if you can't save it it ain't data

13:42 weavejester: onlynickleft: It's generally recommended to have at least two items in the namespace, since a namespace with only one part is a packageless class. Hence the blah.core idiom. Some people prefer name.blah though.

13:42 onlynickleft: Right now we're using a legacy framework that binds every *request* entirely, and the layout function just grabs :flash out of that, but it feels wrong for it to have that full access to each request in the view.

13:42 technomancy: clucy.core is kinda silly

13:42 clucy.index would make a lot more sense

13:43 weavejester: technomancy: Yeah

13:43 onlynickleft: technomancy: I can't stress enough though just how helpful it is to have a common place to look first. It's like the conventional name "README" but for namespaces.

13:43 weavejester: If it makes sense, then blah.client or blah.index or blah.whatever ot preferable over blah.core

13:43 technomancy: onlynickleft: there's only one namespace

13:43 onlynickleft: Heck maybe it should just be "compojure.README"

13:43 technomancy: Oh. Touche.

13:44 weavejester: onlynickleft: I don't like having a dynamic *request*, as it gives too much information to the functions using it.

13:44 onlynickleft: weavejester: Oh good once again I don't feel so crazy.

13:44 weavejester: I'm of the opinion that information to functions should be passed around on a need-to-know basis.

13:44 Ideally functions shouldn't have access to data that doesn't affect them.

13:45 onlynickleft: That's been my philosophy for a few years now, it makes it easy to see where dependencies are wrongly or unnecessarily passed around.

13:45 And now that I'm using Clojure instead of Ruby, the benefits of this philosophy are being realized much more quickly.

13:46 But I also don't like binding global vars, although in this case binding *flash* might make sense as a middleware.

13:47 weavejester: Well, if you're going to use dynamic vars, restrict it down to what you need. So perhaps *messages* instead

13:47 You could also have some middleware to inject the message into the HTML, or use AJAX

13:47 onlynickleft: Well isn't that the only use-case of wrap-flash?

13:47 weavejester: Maybe...

13:47 seangrove: weavejester: Could be used with prismatic's plumbing to make it explicit

13:48 arohner: cemerick: (cemerick.url/url "http://foo.com/?label="). I think that's valid, because Google tried to visit my site w/ it

13:48 throws for me. interested in a patch?

13:48 weavejester: However, if you have a choice, I prefer saving all data

13:48 Then a flash becomes unnecessary

13:49 I tend to have the user ID in the session, and that's it.

13:49 amalloy: arohner: fwiw, http://foo.com/?label is valid too (as far as the rfc is concerned)

13:50 arohner: amalloy: thanks. I'll add a case :-)

13:50 onlynickleft: weavejester: Has that been leading to any regrettable complexity in your apps?

13:50 amalloy: that is, the name=value pairs in query-params are a convention, and not a standardized part of the spec

13:50 weavejester: tomjack: I think I agree with the idea that if you can't save it, it's not data :)

13:51 arohner: weavejester: ooh, I like that. I've been on a "everything should be serializable" kick recently

13:51 including fns and closures and refs and ...

13:52 weavejester: onlynickleft: Not really. I mean, you need to do a little more work around tying data to time, which you get for free if you use datomic, but not anything else.

13:52 But there are a lot of benefits to having a concept of time in your DB

13:53 arohner: that quote's attributable to tomjack :)

13:55 hiredman: I am thinking about making a clojure build with the ability to log locals clearing information, prints out "emitting x" "clearing x" with line and file info at compilation time sort of similar to *warn-on-reflection*

13:56 https://gist.github.com/hiredman/5686648 I guess I have the build, I wonder if there is general interest in such a thing?

13:56 amalloy: hiredman: seems like the naive approach would generate way too much logging output. what do you have in mind to narrow it down to something useful?

13:57 hiredman: amalloy: I would only turn it on when compiling a single function

13:57 e.g. at the repl

13:57 amalloy: yeah, now that i've seen your gist i see the intent

14:00 ambrosebs: A brief n biased experience report on using core.typed. Spoiler: I like using my own project ;) But seriously, loving static type checking. https://groups.google.com/forum/?fromgroups#!topic/clojure-core-typed/oxh3DO8dEIc

14:02 onlynickleft: What unit testing framework do you guys prefer?

14:02 llasram: clojure.test

14:02 technomancy: onlynickleft: clojure.test for sure

14:02 onlynickleft: Over Midje?

14:03 technomancy: oh yeah

14:03 onlynickleft: Hmm, I've had the impression that clojure.test is "too simple" or doesn't give good enough feedback or something.

14:03 tomjack: arohner: I'm imagining like running a codeq-alike on a cljs project, with some cljs code in the project that connects to the database the project is codeq'd into and automatically updates on deploys

14:03 llasram: I've use midje some because cascalog-midge, but it's way way too magical.

14:04 64MAADO0W: I've had only bad (more like horrible) experiences with Midje. At least with clojure.test you always know what's going on.

14:04 llasram: Plus its default mode operation has you put tests as top-level forms, which run when compiling a namespace, which makes REPL development with any sort of test helper functions very awkward

14:04 technomancy: onlynickleft: there's lots of tooling around clojure.test if you don't like out-of-the-box behaviour; see lein-difftest

14:04 arohner: I have blog post coming out next week, about how I rewrote our 15k LoC test suite from midje to clojure.test

14:04 tomjack: I had only thought about 'serializing' dynamic 'values' so far, not dynamic code..

14:04 onlynickleft: technomancy: Sounds like a very composable, Clojure-esque idea.

14:04 llasram: arohner: I'm interested in reading that

14:05 arohner: technomancy: oh, that reminds me. I'm interested in being able to write macros around deftest, but they break clojure-test-mode

14:06 i.e. I'd like (test "this is a test") -> (deftest this-is-a-test)

14:06 technomancy: arohner: literally attempting to destroy clojure-test-mode as we speak

14:06 arohner: cool :-) what's your approach?

14:06 hiredman: he is filing dmca take down notices

14:06 technomancy: mwahahaha

14:06 arohner: https://github.com/technomancy/nrepl-discover

14:06 arohner: basically teach nrepl.el how to interpret responses which include overlays

14:07 so you can move all logic server-side

14:07 arohner: cool

14:08 onlynickleft: llasram: I prefer a test auto-runner rather than working in the repl with tests.

14:08 (Even though nrepl.el is awesome, but I only use that for debugging and live-experimenting.)

14:09 technomancy: onlynickleft: it's easy to set up an auto-runner with nrepl.el and emacs after-save-hooks

14:10 papachan: ,3.0 * 0.333

14:10 clojurebot: 3.0

14:11 llasram: It seems to me that having a separate auto-runner process does have one major benefit over in-REPL testing, just by virtue of actually being in a separate process

14:11 technomancy: llasram: you still have to start a fresh process if you want a fresh state

14:12 llasram: Fresh state yes, but not just development state vs test state

14:12 technomancy: yeah, it'll save you from some goofs, but not enough to remove the need for a fresh run

14:12 llasram: I've spent a lot of time recently getting some things to place nicely loading external resources from different locations depending on whether they're under test, in a REPL, or running as part of a Hadoop job

14:14 cemerick: arohner: sure

14:14 onlynickleft: technomancy: That sounds great for someone like me who uses emacs, but just like your recent blog post alluded to, it's not so great for others who like to use IntelliJ to edit Clojure for some reason.

14:14 technomancy: onlynickleft: dunno; I'm sure all respectable editors have equivalents to save hooks

14:15 watching the filesystem seems like a hack

14:15 you already have all the data you need

14:15 arohner: cemerick: good timing. sent :-)

14:16 onlynickleft: I suppose, although it seems non-trivial to re-run all tests that require the current file (even indirectly).

14:16 cemerick: arohner: lol @ (-> ... (->> ...)) :-)

14:16 technomancy: onlynickleft: yeah, that's the hard part. I'm not aware of any good solutions in that space.

14:17 arohner: you seemed down with the arrows

14:17 you used -?>> in that fn

14:17 :-)

14:17 cemerick: arohner: yeah, wasn't criticizing, just funny

14:18 onlynickleft: technomancy: Midje and Speclj seem to have auto-runners that calculate this for you.

14:18 I don't know how they work, and I'm sure it's probably hackish, but they seem to work pretty reliably.

14:19 tbaldridge: I've used them both. Midje's worked better for me than Speclj's

14:19 You still run into the common reload problems with multi-methods and sometimes protocols.

14:19 technomancy: and it's silly to tie that kind of thing to a test library to begin with

14:19 they're two orthogonal features

14:20 tbaldridge: that is, changing a protocol or a multimethod dispatch doesn't always get refreshed when the tests re-run

14:20 technomancy: tbaldridge: that's a flaw inherent in clojure though

14:20 tbaldridge: technomancy: agreed

14:23 onlynickleft: When you're writing tests for a web app that uses the database, do you somehow swap out the database for an in-memory one, or do you load up your real database in the background somehow during the tests?

14:23 arohner: onlynickleft: write your code so you don't need to hit the DB during the test. if you can't avoid that, I prefer hitting a test version of the real DB

14:23 Rhymor: depends on whether you're writing a unit test or an integration test

14:23 onlynickleft: (I suppose this question applies to non-web-apps too)

14:24 Rhymor: I've given up on trying to make tests fit a category these days.

14:24 technomancy: onlynickleft: the idea that you can replace the DB without affecting behaviour is a myth

14:24 unless your DB usage is trivial

14:24 in which case it's probably not slow enough to bother replacing

14:25 tbaldridge: or datomic, in-memory vs file backend

14:25 Rhymor: onlynickleft: then this presentation is for you: http://www.infoq.com/presentations/integration-tests-scam

14:25 onlynickleft: technomancy: I've had pretty good success with using Hyperion, and using an in-memory backend during tests.

14:25 But the problem with Hyperion is that it's super-trivial and probably very inefficient.

14:25 I mean the API is super-trivial.

14:25 tbaldridge: onlynickleft: so what technomancy said :-P

14:26 onlynickleft: Hmm, maybe.

14:26 I have bad memories of ActiveRecord making my Rails test suites slow though.

14:26 Makes me afraid of that approach.

14:26 technomancy: slow is much better than inaccurate

14:27 but anyway, test your functional code separately from your side-effecting code

14:27 like arohner said

14:27 onlynickleft: Okay, the more I'm talking to you guys, the sadder I am about the project I've inherited.

14:28 (I mean, except for all the awesome perks about the job it comes with, like working from home, only having to report once a week to the boss, the boss being technical too.)

14:28 Oh! I remember a question I've been meaning to ask for months.

14:28 How do you guys test the output of your hiccup-calling ring/compojure handlers?

14:29 arohner: onlynickleft: what do you want to verify?

14:29 onlynickleft: Right now I basically do "should-receive"-style tests on the hiccup function itself, but I hate should-receive-style tests.

14:29 I want to make sure the view function got passed the right arguments.

14:30 arohner: you could regex the output for a few keywords

14:31 I tend not to test those kinds of things

14:31 I like testing logic and things that cause the app to throw

14:31 onlynickleft: Hmm, regex seems easiest and probably reliable enough.

14:32 arohner: It's nice to have an automated test that tells me that when I load this page, it's gonna have the right stuff on it. Cuz we have a lot of different pages with several ways of having different stuff on them. Manually testing that would take forever.

14:33 arohner: sure. I don't know what's important to your app

14:33 onlynickleft: Hmm I like the regex idea a lot more than parsing HTML which was my plan.

14:34 Although I bet with enlive, I could get pretty specific about stuff.

14:34 nDuff: ...

14:35 onlynickleft: If you need any kind of remotely useful context filtering, a regex is the wrong approach.

14:35 onlynickleft: I'm not smart enough to understand what you just said.

14:35 Can you dumb it down for me?

14:36 arohner: nDuff: sure. but if you just need to see that "Foo" appears on the page, then a regex is fine

14:36 onlynickleft: That's basically it, yeah.

14:36 arohner: if you need to know that it's in the div enclosed in the p, then yes you need something smarter

14:36 onlynickleft: Oh no, those kinda tests make redesigning really painful.

14:38 nDuff: arohner: "appears on the page" and "appears in the page source" are _completely_ different things.

14:38 arohner: nDuff: I'm aware

14:38 SlabberMouth: hi everybody

14:38 onlynickleft: Ah I see your point nDuff.

14:38 nDuff: ...then I'm not very sure about the practice of giving advice that conflates them.

14:39 onlynickleft: nDuff: there's no way to be absolutely sure it appears visibly on the page without loading it up.

14:39 I just need to make sure that it appears in the source.

14:39 nDuff: onlynickleft: ...and there are very good libraries/frameworkes for "loading it up" in a headless web server

14:39 onlynickleft: Like if I pass (take 3 widgets) to my view, the :name of each widget is somewhere on the page.

14:39 nDuff: and querying what does/doesn't get rendered.

14:39 onlynickleft: *in the source

14:40 I bet if whytheluckystiff finishes coming back, he'll be a Clojure guy this time.

14:40 nDuff: onlynickleft: ...so sure, you need to actually run your page through a browser engine to know for sure what does or doesn't compare, but tools for automating that process have been maturing for years.

14:40 nathanielk: I'm using futures for the first time. I create a future with a function that modifies a database and the function never runs (as far as I can tell). Am I mis-using futures? Do I need to do something extra?

14:41 SlabberMouth: I was wondering whether anybody has found a way yet to use Android and Clojure 1.5 (https://clojars.org/android/clojure/versions/1.5.0) together

14:41 onlynickleft: Sometimes I hate HTML and the evolution path browsers have taken.

14:41 ToxicFrog|W`rkn: Only sometimes?

14:41 arohner: nDuff: browser tests are great. I use them all the time, but they're not the only right way to test. speed to code and speed to run the test are both useful considerations

14:41 onlynickleft: Yeah. The rest of the time I'm playing with my kids or something.

14:42 You know what they say: Out of mind, out of existence.

14:42 tbaldridge: down with the browsers! Long live Swing!

14:42 :-P

14:42 onlynickleft: Man. Everything about what we've done with computers really upsets me when I think about it.

14:42 The trick is to just stop thinking about it and keep making money by writing code that's slightly less bad than what you would have written yesterday.

14:46 matthoffman: cemerick: (or anyone else that is interested) how crazy would it be to use nrepl + a queue-based transport for distributing work between nodes in a cluster?

14:46 clojure-new: hello.

14:46 matthoffman: I was looking at technomancy's die-roboter, and thinking "it'd be nice if it had pluggable transports, kind of like Celery in Python. And pluggable middleware, for some different behavior…" Then it started sounding a lot like nrepl.

14:49 clojure-new: can you suggest template engine for clojure web apps that should be just plain old html with layout support? I want to write somthing like <body><%= outlet %></body> and from my clojure app: (render "partial.html" {:layout "app.html"})

14:49 Raynes: Clabango maybe?

14:49 There is also laser, enlive, mustache, etc.

14:49 laserlaserlaserlaserlaser

14:50 callen is a big fan of clabango.

14:50 clojure-new: Raynes: Don't like clabango, {{}} will conflict.

14:52 amalloy: nathanielk: the function is probably causing an exception

14:52 you're not seeing a stacktrace because exceptions on a separate thread can't interrupt the current one

14:52 you can test this by replacing (future ...) with @(future ...) temporarily

14:53 onlynickleft: Anyone: When you write web apps, what else do you use besides ring, lein-ring, compojure, hiccup, and clojure.test?

14:53 clojure-new: https://github.com/Raynes/laser and enlive looks horribly complicated, wtf is parse, why should i care about it, some document function and so on. Is there somthing that can simply read html file and subsittue special markup things with what in options?

14:53 technomancy: onlynickleft: the source for https://syme.herokuapp.com is pretty readable

14:53 onlynickleft: clojure-new: I was eyeballing Stencil the other day. Not sure if it's alive still.

14:54 justin_smith: how does with-redefs interact with varargs? it is behaving like if I don't have a redef for the specific arg count the original funciton is used

14:54 even when redeffing to a constantly expression that can handle any arg count

14:55 ,(with-redefs [+ (constantly true)] (+ 1))

14:55 clojurebot: true

14:55 justin_smith: ,(with-redefs [+ (constantly true)] (+ 1 1))

14:55 clojurebot: 2

14:56 onlynickleft: heh, .symerc sounds like cemerick

14:59 When you make a hiccup layout function, have you found any clever way to optionally let the caller specify css/js files to include also?

14:59 (You = anyone)

15:01 decaf: (do (map (partial contains? words) words) nil) ...words is a set with 55000 members. criterium says this expression ran in 50 nanoseconds.

15:01 onlynickleft: technomancy: aww, no tests, plus it's not using korma which looked pretty neat

15:01 justin_smith: decaf: mapv

15:01 map is lazy

15:01 if you don't use it, no action is performed

15:02 decaf: ok it's 58 milliseconds, still too good to be true :)

15:02 technomancy: onlynickleft: I have had bad experiences with korma

15:02 onlynickleft: Inflexibility?

15:02 Magic?

15:02 clojurebot: magic bullet is http://www.infomercialcentral.com/store/files/images/d_77.jpg

15:03 bbloom: onlynickleft: what's wrong with an options map as an argument? (update-in options [:stylesheets] conj "styles.css")

15:03 justin_smith: decaf: hmm, I thought mapv would force the evaluation

15:03 there is also (doall (map ...))

15:03 onlynickleft: bbloom: seems weird to pass nil or {} when you needn't specify anything.

15:03 chronno: technomancy: Is there something bad with korma?

15:04 tbaldridge: justin_smith: doall holds the head, in this case he may want dorun

15:04 onlynickleft: What tool do you humans use to figure out what part of some code is so slow and why?

15:04 justin_smith: tbaldridge: wouldn't mapv force it though? I thought it would, not being lazy and all

15:04 dnolen: onlynickleft: criterium is OK for high level stuff, for serious profiling YourKit

15:06 onlynickleft: Oh btw I found out this cool trick: ((juxt get dissoc) m k)

15:06 It gets you a value in a map and returns it without said val.

15:07 dnolen: onlynickleft: juxt is generally awesome

15:07 justin_smith: nice, like pop for maps

15:07 onlynickleft: Rather Hash#delete

15:07 dnolen: yeah, I've been using juxt with for and into {}

15:07 I mean map.

15:08 I really mean for.

15:09 Okay I have to admit it's pretty cool to talk to the smart people who wrote all the tools I've been using for 7 months.

15:10 Thanks guys for paving the way for newbs like me :)

15:12 Have any of you ever integrated with Stripe or Braintree and tried converting users away from PayPal?

15:15 arohner: onlynickleft: I'm using Stripe, haven't tried converting users away

15:16 onlynickleft: Oh.

15:16 Never mind, that's too off-topic.

15:23 Okay bye, disappearing forever again.

15:26 ghengis: ,(+ '1 '2)

15:26 clojurebot: 3

15:26 ghengis: ,('+ '1 '2)

15:26 clojurebot: 2

15:26 ghengis: why did the second one return the last parameter?

15:27 is that just what a symbol does when used as a fn?

15:27 bbloom: ghengis: because symbols are functions

15:27 pjstadig: when used as a fn and given as a first argument something that is not a map (or a map that does not contain the symbol as a key)

15:27 it will use the second arg as the default value

15:27 bbloom: ,('+ {'+ :plus '- :minus} :not-found)

15:27 clojurebot: :plus

15:28 bbloom: ,('* {'+ :plus '- :minus} :not-found)

15:28 clojurebot: :not-found

15:28 ghengis: ah! interesting

15:28 technomancy: tl;dr: clojure doesn't do a lot of sanity checking on its inputs

15:28 garbage in, garbage out basically

15:29 ghengis: basically, works just like a keyword when used as a function

15:36 cemerick: arohner: 0.0.8 now in clojars

15:46 mattmoss: I hate GIGO when my brain is full of it.

15:48 llasram: Huh. Java won't let you have a package and a class with the same name?

15:49 I guess the JVM doesn't care, but why does Java?

15:50 callen: llasram: save people from themselves.

15:51 llasram: I'm just not even sure where it could cause a problem

16:09 arohner: cemerick: thanks

16:10 dobry-den: jvisualvm is also a nice profiler (only profiler i've used in my life). i could figure it out. comes with java. run it from command line

16:14 lynaghk`: I need to implement a queue, and am thinking about just using an atom. Since swap returns the swapped-in value, the only way I can think of to actually give a worker its task is to throw it under a new key. E.g., a swap takes {:todo [a b c] :foo nil} to {:todo [b c] :foo a}, and the worker picks up task a.

16:15 hiredman: lynaghk`: for clojurescript?

16:15 lynaghk`: I'm pretty sure that it'll work fine, but it feels nasty since :foo isn't actually state that needs to be shared with anyone

16:15 hiredman: nah, this is JVM clojure with real threads.

16:15 hiredman: have you considered a java.util.concurrent queue?

16:16 j.u.c.LinkedBlockingQueue is my go to queue

16:16 lynaghk`: hiredman: yeah; however, I need a priority queue with a changing comparator, and I didn't see anything in java util concurrent that would help with that problem

16:16 arohner: lynaghk`: I've used clojure.lang.queue with refs

16:16 lynaghk`: the use case is building a dependency graph in topological order where the graph structure can change during the build process

16:17 arohner: so then (defn dequeue [ref-queue] (dosync (let [head (first @ref-queue)] (alter @ref-queue pop) head))

16:18 lynaghk`: arohner: yeah, I was thinking that maybe it's finally time for me to use dosync = )

16:18 arohner: you can also use compare-and-set, but it's ugly

16:24 mabes: lynaghk`: I'm not sure if it will work for your use case but priority-map is nice: https://github.com/clojure/data.priority-map

16:25 lynaghk`: mabes: yeah, I think that has the same problems as the priority queue in that it assumes the comparator is fixed

16:26 mabes: lynaghk`: when you change your comparator you'll have to resort anyways so why not just create a new priority queue with a new comparator?

16:27 gtrak_: changing comparator... why not a stateful comparator?

16:27 dosync to the rescue

16:27 lynaghk`: gtrak_: yeah, I think I will have to use dosync.

16:28 mabes: if I create a whole new queue, I need to atomically switch all of the workers over to using it, which defeats the purpose of a queue =)

16:57 onlynickleft: Are there really no auto-runners for clojure.test?

16:59 bbloom: onlynickleft: not that auto runners aren't useful… but they demand probably just isn't very high, since most people test code incrementally at the repl & then run the full test suite before committing

16:59 fscker`: hi all, I'm trying out the "new" neko from sattvik ( https://github.com/clojure-android/neko ) , but the steps fail consistently. Does anyone have any experience with the lib?

17:00 onlynickleft: Oh I see.

17:00 bbloom: Do you know of a good tutorial on such a workflow that gets pretty close to having an auto-runner?

17:01 I remember technomancy's idea about after-save-hook but I'm hoping there's a more automated and less ad-hoc technique.

17:02 fscker`: The problem is ant btw - building fails every single time (seriously why ant??)

17:02 seancorfield: onlynickleft: I use an auto runner with Expectations but mostly rely on C-C , in Emacs to run the current namespace's tests whenever I need

17:02 I think C-c , works for clojure.test too if you have that mode package installed?

17:03 (not much help if you don't use Emacs of course but...)

17:03 onlynickleft: I used to be a pretty outspoken vim user, ranting about every other text editor someone would show me.

17:03 Then I saw someone use emacs, and saw that he was way faster at coding than anyone I ever met, including me.

17:04 So yeah I use emacs, going on 9 months now I think.

17:04 nDuff: onlynickleft: Depends on the mode, IMHO. For LISPs, there's no question that Emacs is the thing to beat, IMHO, but I find myself using vim for work in most other languages.

17:05 mattyw: ztellman, any idea if I can use aleph to connect to a secure websocket? When I try it appears that wait-for-result hangs

17:05 onlynickleft: nDuff: Oh. I don't use other languages anymore so I don't know.

17:05 :)

17:05 ztellman: mattyw: what url are you using?

17:05 * onlynickleft <3 Clojure

17:05 ztellman: is the protocols https?

17:05 mattyw: ztellman, wss

17:06 ztellman: mattyw: I don't handle that protocol correctly, try https and see if that changes anything

17:08 mattyw: ztellman, thanks, I'll try

17:12 ztellman, I get this http://paste.ubuntu.com/5721100. Could it be something odd with the server?

17:12 onlynickleft: Okay I'm sold on clojure.test + lein-difftest

17:12 mattyw: ztellman, or that I'm using sun java?

17:13 ztellman: mattyw: yikes, I'm not sure

17:14 I just set up the SSL stuff and trust that it will all work

17:15 bbloom: ,(clojure.walk/macroexpand-all '(fn [] '(fn [])))

17:15 clojurebot: #<ClassNotFoundException java.lang.ClassNotFoundException: clojure.walk>

17:15 bbloom: &(clojure.walk/macroexpand-all '(fn [] '(fn [])))

17:15 lazybot: ⇒ (fn* ([] (quote (fn* ([])))))

17:15 bbloom: i'm sure people are aware, but that's not the correct macro expansion :-P

17:16 dakrone: mattyw: shot in the dark, but do you have the store trust stores installed for your JDK?

17:16 *strong trust stores

17:16 ztellman: mattyw: you can try setting :ignore-ssl-certs? to true in the options

17:17 mattyw: dakrone, no idea - I'll check

17:17 ztellman, I'll give it a shot

17:17 ztellman: a quick search for that error message suggests there are at least half a dozen reasons it can happen, sorry I can't be of more help

17:18 dakrone: mattyw: http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html if you need them

17:18 mattyw: ztellman, no problem, thanks for the help so far, I'm quite a novice when it comes to websockets and ssl anyway so I appreciate the help alot

17:19 onlynickleft: Why do some of you dislike Midje? It looks pretty clean, as long as you wrap every => in its own (fact), like (fact (foo) => :bar).

17:19 technomancy: it's not clean

17:19 it's very macro-heavy

17:19 clojurebot: No entiendo

17:20 arohner: it's implementation is gigantic and hard to understand

17:20 technomancy: side-effects at the top level

17:20 arohner: it's buggy

17:20 onlynickleft: Good enough for me.

17:20 technomancy: random non-lispy syntax like =>

17:20 arohner: you can't compile the tests separately from running them

17:21 so for example, if you have a suite that takes 30 mins to run, you'd like to make sure there are no compile errors before running tests for 25 minutes

17:21 onlynickleft: What about speclj?

17:22 amalloy: arohner: i'm not a fan of midje, but you can wrap midje facts in deftests and then they don't have this stupid behavior

17:22 onlynickleft: Is http://richhickey.github.io/clojure/clojure.test-api.html still current?

17:22 bbloom: onlynickleft: for whatever flaws clojure.test has, it's the standard & it's good enough. just use that & you can move on to another framework if and when you identify a pain point with your existing test suite

17:22 arohner: oh, the test fixtures aren't composable

17:22 Raynes: mucker: I have acquired a guitar.

17:22 technomancy: onlynickleft: speclj just doesn't seem compelling

17:22 bbloom: onlynickleft: nothing on rich's github account is current

17:22 technomancy: none of the things it offers are things that look useful

17:23 gtrak_: clojure.test harnesses are fine as long as you don't try to use them

17:23 seancorfield: http://clojure.github.io/clojure/clojure.test-api.html

17:23 gtrak_: fixtures, rather

17:23 arohner: gtrak_: I've monkeypatched mine to be useful

17:23 I'm considering OSSing that

17:23 gtrak_: o rly? can I see?

17:23 ah

17:23 technomancy: huh? fixtures are great

17:23 gtrak_: fixtures means side-effects

17:23 pjstadig: i've created https://github.com/pjstadig/conjecture with some improvements to fixtures

17:24 technomancy: gtrak_: fixtures can mean side-effects, with-redefs, or conditional runs of tests

17:24 arohner: @gtrak_ https://gist.github.com/arohner/5688067

17:24 amalloy: technomancy: fixtures have some issues: http://dev.clojure.org/jira/browse/CLJ-866

17:24 gtrak_: I prefer doing side-effects within like a setup-services function or something... with-redefs.. maybe

17:25 one thing that's terrible about them is they don't handle exceptions like you'd expect

17:25 technomancy: amalloy: granted. clojure-test-mode ships with a fix for that.

17:25 amalloy: a fix for clojure.test in emacs isn't a fix at all

17:26 technomancy: amalloy: yeah, I hope conjecture could address that

17:27 decaf: justin_smith: mapv does walk trough its argument seq as you said. 58 ms benchmark is true. I'm thrilled.

17:27 onlynickleft: bbl maybe

17:28 amalloy: pjstadig: what does conjecture do? "adds support for idempotent fixtures" doesn't really tell me anything, since of course clojure.test works fine if your fixtures are idempotent

17:28 gtrak_: Raynes: if you like messing with stuff, I really like how mine turned out: http://www.carvinguitars.com/kits/

17:29 pjstadig: amalloy: https://github.com/pjstadig/conjecture/blob/master/CHANGELOG.org && https://github.com/pjstadig/conjecture/blob/master/doc/Fixtures.org

17:29 Wild_Cat`: Carvin do kits? Interesting.

17:30 pjstadig: it's a work in progress, but the idea is that you could compose a fixture multiple times in the same chain for a test and it will only execute the fixture once

17:30 also runs fixtures when you run a single test as a function

17:30 Wild_Cat`: regardless, their guitars sound fantastic. Three of the best guitarists I know play DC127s and *wow*.

17:31 pjstadig: amalloy: i've also added a singleton fixture that runs once around the entire test run

17:31 gtrak_: Wild_Cat`: http://i.imgur.com/ZWUbt.jpg bolt-plus, swamp ash, stainless-steel frets

17:32 Wild_Cat`: gtrak_: nice -- I don't like burst finishes but that wood looks incredible. How much did it cost you?

17:32 (aww, they don't do 6-string bass kits :( )

17:32 gtrak_: like 600 total I think? it's all dye with minwax tung-oil finish on top

17:33 Wild_Cat`: wow, pretty cheap too.

17:33 might consider those when I inevitably choose to buy myself a guitar.

17:33 gtrak_: 648

17:34 Raynes: gtrak_: Meh. I was given a guitar. I wouldn't buy one.

17:34 onlynickleft: Raynes: accoustic?

17:34 Raynes: onlynickleft: Yes.

17:34 gtrak_: I just like messing with gear :-), circuits too

17:35 onlynickleft: Sweet. I just learned Jeff Buckley's Hallelujah on accoustic the other week.

17:35 Just found out about that song 2 weeks before that.

17:35 And Sunday I have a piano recital for the lessons I started in Jan. Programmers are apparently very musical.

17:37 Wild_Cat`: onlynickleft: there's lots of maths in music. Maybe that's that.

17:37 onlynickleft: Patterns, not maths.

17:37 Maybe both, God knows.

17:37 Wild_Cat`: ...or maybe it's just that we spent a terrific amount of time learning to learn, and we have fast fingers to begin with

17:38 onlynickleft: Does clojure.test require putting your tests in a special namespace, or do you just put them anywhere and do 'lein test'?

17:38 Wild_Cat`: nope, not it, not it at all.

17:40 Oh awesome, it just runs my tests, it doesn't care where I put them.

17:40 Oh wait yeah it does.

17:40 * onlynickleft shushes for respect for the room.

17:41 bbloom: there was an overtone video that was extremely mathematical

17:41 super cool stuff

17:42 noprompt: it would be so nice if clojars had a json api.

17:42 bbloom: onlynickleft: Wild_Cat`: here it is http://www.youtube.com/watch?v=Mfsnlbd-4xQ

17:42 ^^ that talk is freaking awesome

17:43 onlynickleft: Oh that reminds me, why isn't clojure-docs.org updated for 1.5.1 etc. anymore?

17:43 gtrak_: Wild_Cat`: here's the raw wood: http://i.imgur.com/S8uz2D5.jpg

17:43 Wild_Cat`: bbloom: thanks for the reminder, I keep telling myself I need to watch those awesome Overtone vids (and learn to use it too)

17:43 gtrak_: and back: http://i.imgur.com/glDG06S.jpg

17:43 Wild_Cat`: gtrak_: lovely! If it was me, I'd have put the thinnest, most transparent coat of varnish money can buy, but hey, your guitar, your choice.

17:44 Morgawr: what's the easiest way to update all the values in a hashmap without touching the keys? The one that has the best performance

17:44 noprompt: Raynes: i'm thinking i'd like to make a tiny patch to one of the fn's in the fs lib.

17:44 Raynes: noprompt: Okay.

17:44 gtrak_: Wild_Cat`: ya, I thought about raw, but I wanted to experiment with dyes

17:44 callen: Raynes: hey! What happened with Linode?

17:44 dnolen: Morgawr: what does that mean?

17:44 Raynes: callen: They had some hardware failures.

17:45 callen: We're all good.

17:45 noprompt: Raynes: it would be nice if fs/find-files used re-find instead of re-match

17:45 Wild_Cat`: gtrak_: what can I say, I'm a sucker for natural finishes :D

17:45 noprompt: re-match seems just a tad to strict imho

17:45 Morgawr: dnolen: let's say I have {:a 1 :b 2 :c 3}, I want to map inc to all the values and get {:a 2 :b 3 :c 4}

17:45 nDuff: bbloom: yup -- that one was great. I promised my fiancee's girlfriend (a mathematician) that I'd get the link in her direction... trying to remember if I actually followed through on that.

17:45 Morgawr: I can do it with some custom-written function but I was wondering if there was some core function that does it already for me

17:45 callen: Raynes: great. And it was great hanging out with you in LA. Was in too much pain to enjoy the concert though.

17:45 onlynickleft: Is there an alternative to deftest, specifically so I can use a string to define what the test is rather than a literal symbol?

17:46 amalloy: noprompt: i don't agree. you can emulate find with match, and match with find; i don't think it really matters which one fs uses, but i do think it's silly to change now

17:46 Raynes: callen: Yeah, I didn't quite hear you when you gave me the reason for leaving. Was it leg agony?

17:46 pjstadig: onlynickleft: there are testing forms inside of a deftest, but nothing like that for deftest

17:46 Raynes: callen: I couldn't feel my feet by time the concert was over, but it was totally worth it.

17:46 callen: Raynes: feet and back. I have flat feet in the extreme.

17:47 I can handle running but standing in place on a hard floor makes me want to suck bleach.

17:47 noprompt: amalloy: sure. i hear you. but you end up having to write longer patterns in some cases.

17:47 Raynes: callen: Brian and I got selected to attend a private concert being taped for the 6th season of Live From The Artists den. This venue has seating.

17:48 noprompt: maybe not even a patch to that function but at least another function which uses a looser matching strategy.

17:49 suppose you wanted to find files in a directory that matched a date pattern, you'd have to wrap the \d{4}-\d\d-\d\d crap in .*? nonsense

17:49 onlynickleft: pjstadig: I see, thanks.

17:49 Does anyone have experience with "test-this"? It looks like it provides auto-runner capabilities for vanilla clojure.test

17:49 noprompt: i guess you could sort of think of it like a grep

17:50 rasmusto: Morgawr: I've heard it said that a hash map might not be the best data structure for that, but you can do (into {} (map (fn [[k v]] [k (inc v)]) {:a 1 :b 2 :c 3}))

17:50 amalloy: noprompt: and what if i wanted to find java*.exe files? with your approach i'd need to write #"^java.*\.exe$", whereas currently i can write #"java.*\.exe"

17:51 callen: Raynes: I haven't seen the show, is it any good?

17:51 amalloy: neither approach is really better; the change is what's expensive

17:51 Raynes: callen: Never seen it either, but it's a private Imagine Dragons concert so…

17:51 :p

17:51 amalloy: not that Raynes cares what i think, but i'd recommend a function that accepts a lambda for filtering, rather than a regex

17:51 noprompt: right, so i guess really what i'm suggesting is separate function

17:51 Morgawr: rasmusto: thanks for that, maybe calling zipmap after getting a list of updated values and the old keys has better performance?

17:52 also, I'm using clojurescript, not sure if that helps or not as far as performance goes

17:52 Raynes: amalloy: There is a 95.3% chance that I never even wrote that code so what you think is right probably is.

17:52 amalloy: then you can write your lambda that uses re-find, someone else can write a lambda that just does #(.startsWith % "foo")

17:52 dnolen: Morgawr: I don't know about fastest, but zipmap solution is pretty clean

17:52 (zipmap (keys m) (map inc (vals m)))

17:52 arohner: technomancy: are test selectors documented anywhere, aside from `lein help test`?

17:52 Morgawr: dnolen: yeah that's what I thought of at first

17:53 onlynickleft: technomancy: do you know of a way to get difftest to print the actual/expected using pprint?

17:53 Sometimes these hashes are pretty involved.

17:53 *maps whatever

17:53 callen: Morgawr: why do you need fastest?

17:53 dnolen: Morgawr: and it looks like zipmap could be a lot faster in CLJS, could use transients

17:53 technomancy: arohner: not that I know of. I would like to move it out of Leiningen; that functionality clearly doesn't belong there

17:53 noprompt: well it was just a minor annoyance imho. i've got a copy of the version i like so i'll use that.

17:53 gtrak_: into uses transients

17:53 Morgawr: callen: because I'm working on a game engine that uses a lot of maps to bind together objects and entities so I'll be operating on moderately big sequences of maps and altering them

17:53 noprompt: personally i prefer regexes that are permissive with the option to be strict rather than the other way around.

17:53 technomancy: onlynickleft: I don't think so

17:54 callen: Morgawr: godspeed.

17:54 noprompt: but i'd love to know what the tradeoffs are of using re-find over re-match

17:54 Morgawr: I guess I can go with zipmap for the moment, if performance is killing it then I can consider implementing it in javascript natively or finding a better solution

17:54 thanks for the help

17:54 noprompt: *in general

17:54 onlynickleft: Pull request time.

17:55 callen: Morgawr: to be frank, using maps/hash-tables for what a struct would suffice for is pretty ridiculous in general if you're in a genuinely performance-intensive game situation.

17:55 Morgawr: callen: a "struct"?

17:56 amalloy: callen: as ridiculous as using immutable data structures? or as ridiculous as using clojure instead of C? where is it on the ridiculous scale?

17:56 arohner: technomancy: what do you see as the motivating purpose of lein? I don't know that I've heard a clear definition of what does and does not belong in lein?

17:56 noprompt: amalloy: i actually like the lambda idea a lot though.

17:56 callen: amalloy: I was speaking about performance intensive games.

17:56 dnolen: Morgawr: deftype or defrecord

17:56 amalloy: callen: so was i

17:56 technomancy: arohner: the only reason lein has test selectors is that clojure.test has had a total of one patch applied since 2010 =\

17:56 amalloy: why is he writing his game in clojure instead of in C? that's a choice that would be mocked by lots of game devs

17:56 gtrak_: (inc amalloy)

17:56 lazybot: ⇒ 60

17:56 callen: amalloy: and yes, if you're in a genuinely performance intensive game use-case, C++ is ideal.

17:57 noprompt: amalloy: honestly that'd make that function a hell of a lot more powerful.

17:57 Morgawr: dnolen: okay, but those end up becoming hashmaps in the end (with maybe some performance improvements) so even if I define my components as records, I don't see how the situation would change (algorithmically-wise)

17:57 amalloy: noprompt: lambdas are always the answer

17:57 noprompt: amalloy: i am finding this to be the case.

17:57 :)

17:57 dnolen: amalloy: what do you mean "becoming hashmaps in the end" ?

17:57 amalloy: dnolen: i probably meant whatever Morgawr meant when he said it

17:57 dnolen: amalloy: oops sorry

17:58 Morgawr: ^

17:58 noprompt: amalloy: so do you think it would be worth then to add another fn to the lib for doing this?

17:58 Morgawr: dnolen: aren't records just more powerful maps in the end? I mean, they are collections of keys and values

17:58 or am I missing something?

17:58 dnolen: Morgawr: not true

17:59 amalloy: noprompt: if i were in charge of fs, i would accept a pull request adding that function and then reimplementing the current regex-based version in terms of it

17:59 but i would not accept a pull request adding just another flavor of regex

17:59 noprompt: Raynes: what say you?

17:59 callen: is there some reason people need to challenge me when I state the obvious?

17:59 noprompt: amalloy: agreed. this is the whole reason i wanted to bring this up. for the discussion.

17:59 dnolen: Morgawr: deftype is very low level built on host types - access time / update times will always out perform maps

17:59 Raynes: Why amalloy thinks I autodisagree with him eludes me, but of course, this is a great idea and I would take that pull request.

17:59 callen: you don't write a serious game in Clojure. I don't know why people feel the need to take up the crusade and defend the faith in response to this. It's not what clojure is made for anyway.

18:00 amalloy: Raynes: i said no such thing!

18:00 noprompt: "autodisagree"

18:00 :)

18:00 lol

18:00 amalloy: i'm disagreeing *now*

18:00 Raynes: amalloy: Well, before you were like "Not that Raynes cares what I think" and then "If *I* were in charge of fs, I'd do x" implying "but Raynes is the sucks and probably won't." :p

18:00 Morgawr: dnolen: yes but the way the code interact with it is the same as it would with a map, right? also keep in mind this is ClojureScript, not Clojure

18:00 technomancy: what's a serious game? does that just mean it's not fun?

18:00 you can play this game, but you're not allowed to smile.

18:00 noprompt: (with disagree (respond-to :Raynes))

18:01 Morgawr: also for people talking about "serious games" or "high performance games", this'd be ClojureScript in a browser game so I'm not going for real time 3D graphics with AA and advanced techniques or whatever :)

18:01 amalloy: that's a fair inference from what i said, Raynes, but i didn't mean to suggest you'd disagree. i intended to imply that my opinion is unimportant

18:01 callen: technomancy: meaning it has to be competitive with the current state of audio/visual content.

18:01 noprompt: ok well i'm sure both of you guys are busy, i'll make a little time for it later to day and submit something.

18:01 still at work.

18:01 technomancy: boooooring

18:01 gtrak_: callen: real tradeoffs are more interesting than FUD, is my opinion

18:01 dnolen: Morgawr: it depends on how you interact with them, but the performance in general will be better than maps

18:01 Raynes: amalloy: Your opinion is important! If you decide what to do in fs then I don't have to.

18:02 callen: technomancy: I'm a huge fan of small focused indie games, but even still, the limitations remain.

18:02 * technomancy plays SNES games exclusively

18:02 Morgawr: dnolen: yes but performance aside, the interface would be the same so I could always swap a map with a type without having problems?

18:02 amalloy: technomancy: i recently re-finished mega man x. good game

18:02 Raynes: noprompt: We're so busy that we're sitting 6 feet from each other arguing on IRC about implied meanings of sentences.

18:02 callen: technomancy: I beat Ninja Gaiden for the NES a few months back. proud moment. :P

18:02 Morgawr: or maybe I'm missing something

18:02 dnolen: Morgawr: not a deftype, but you can use defrecord where you would use maps for the most part yes

18:02 technomancy: amalloy: yesss

18:02 noprompt: amalloy: two summer's ago i went on the ultimate megaman challeng.

18:03 callen: gtrak_: no FUD here, just facts.

18:03 technomancy: amalloy: I hope you listened to the Protomen afterwards

18:03 Morgawr: well ok, anyhow, I guess I will go with zipmap and if necessary implement a native function in Javascript, thanks for the help :)

18:03 noprompt: i beat megaman 1-6 on nes and X and X2 on snes.

18:03 callen: technomancy: have you tried Ninja Gaiden (NES) music? It's quite good.

18:03 amalloy: no, but i bet i could download that album in time for my flight

18:03 noprompt: megaman 1 is like the hardest fucking game ever made next to festers quest.

18:03 callen: ^^ disagree.

18:03 technomancy: callen: I'll check it out

18:03 callen: noprompt: Ninja Gaiden and Castlevania are harder.

18:04 noprompt: which Castlevania?

18:04 technomancy: ooh nice; deus ex ocremix album

18:04 noprompt: cause i can kick the shit out of simon's quest.

18:04 callen: noprompt: first and third are both brutal. simon's quest was kinda derpy.

18:04 gtrak_: facts need to be more precise

18:04 noprompt: the other ones are kinda tough, and yeah, ninja gaide is hardcore too.

18:04 callen: noprompt: I'm surprised you slogged through it.

18:05 noprompt: callen: yeah but simon's quest has the coolest music. :)

18:05 callen: beating the first Ninja Gaiden was a moment of immense pride for me, but I haven't gotten farther than like the 3rd or 4th level in 2

18:05 you have to learn to play NG like playing an instrument

18:05 noprompt: haha, yeah. gone are the days of "games of skill".

18:06 lifeforce is another pretty damn hard game. that and gradius.

18:06 pjstadig: a PPT :(, but really interesting with respect to choosing a programming language for writing a game http://www.cs.princeton.edu/~dpw/popl/06/Tim-POPL.ppt

18:06 arohner: noprompt: have you tried Demon's Souls?

18:06 new game on xbox & ps3. very skill based, very hard

18:06 noprompt: arohner: i don't think so. is it nes?

18:06 callen: gtrak_: dynamic language runtimes that emphasize the use hash-maps over structs, have mandatory GC, no ability to generate optimized native code, and don't have well-tested and optimized paths to working with OpenGL are a bad idea for a "performance intensive" game.

18:07 gtrak_: this, I agree with :-)

18:07 callen: gtrak_: to say otherwise suggests delusions of grandeur

18:07 pjstadig: pdf version http://www.st.cs.uni-saarland.de/edu/seminare/2005/advanced-fp/docs/sweeny.pdf

18:07 callen: to that end, Clojure is not the language for writing a serious game that is intended to make money. It might suffice for a kid's minecraft clone as long as they don't mind lag.

18:07 gtrak_: blanket statements like 'you can't do that' are more absolute than the reality, that is, there are specific costs that are raised by picking clojure

18:08 noprompt: super metroid was my all time favorite growing up.

18:08 callen: you say specific costs as if using clojure doesn't wall-off entire universes of possibilities in the world of game design.

18:08 noprompt: amalloy: play that one if you haven't already.

18:08 gtrak_: it makes them impractical.. yea, that's the difference

18:09 callen: the only recent'ish language that comes even close to being viable is Go, but that requires a lot of time spent squashing stuff that creates GC pressure.

18:09 and there are other problems with that.

18:09 Rust might work though, whenever it's ready to be used by somebody other than walton and klabnik.

18:10 Morgawr: Clojure and Lisp in general are very powerful and very suitable tools for game development. Obviously the tradeoff is performance and you cannot expect to get Triple A -like performance/results but with the growing indie market of simpler 2D games + phone games and browser-based games, I really see nothing wrong with using Clojure(Script) for it

18:10 noprompt: rust syntax is a soup.

18:11 it looks like a little bit of everything.

18:11 technomancy: right; minecraft is only for kids

18:11 * technomancy should be writing this down

18:11 rasmusto: technomancy: because it has cartoony graphics, and kids love cartoons

18:11 callen: technomancy: java as opposed to clojure helped with that a great deal, and it still runs like ass.

18:12 if you bake down a non-GC'd Lisp dialect that is more of a layer to something at the hardware level like GOAL you can get away with it. A Lisp sitting on top of the JVM? Come on.

18:12 Morgawr: it's not really "sitting on top", it's "running in"

18:12 there's a bit of a difference in that

18:12 it's not like Clojure is compiled to Java that is compiled to bytecode

18:13 callen: Morgawr: thank you for reminding me why I shouldn't bother continuing this conversation

18:13 amalloy: technomancy: you can't get anywhere as a developer witout http://www.logicalfallacies.info/relevance/appeals/

18:13 callen: Morgawr: in future though, don't bother with the pedantry when I'm typing quickly.

18:13 gtrak_: I don't know, I think I'd rather code-gen native code than write c++, the real impractical bit of it is raising the cost of re-using any C++ libs

18:13 callen: amalloy: okay, fine, put together a game engine in Clojure that performs similarly to a AAA game with the same graphical results.

18:13 amalloy: no, thanks

18:14 callen: gtrak_: that latter bit is kinda critical for modern game development. you don't want to be baking up your own physics library. Seriously.

18:14 gtrak_: I get that.. but I'm saying it's worthwhile to be more specific with the criticisms

18:14 callen: gtrak_: there's a ton of value-add middleware and third party libraries that get used so it doesn't take 10 years to make a game.

18:14 Morgawr: it's not like people in here are ignorant of the tradeoff performance when running Clojure(Script)

18:14 callen: I was specific earlier.

18:14 I explained what specific language design choices made the type of project not a great idea.

18:15 I even explained how an alternative language is more'ish viable and why.

18:15 Morgawr: callen: what would you use to develop a videogame in a browser?

18:15 out of curiosity

18:15 dnolen: Morgawr: I've said this many times, Clojure makes very different set of design tradeoffs than many FP languages. If you need to drop down you can.

18:15 technomancy: Morgawr: no, everyone who doesn't put performance above maintainability is a kid or an amateur, aren't you paying attention?

18:15 callen: technomancy: stop. come on. don't strawman what I'm saying.

18:15 Morgawr: dnolen: yeah, I love Clojure because of this reason

18:15 callen: technomancy: it's obnoxious and below you.

18:16 talking to you guys about this reminds me a lot of talking to Republicans about Murica. You can't love something unless criticizing it in any way is totally unthinkable.

18:16 or merely mentioning a weak point to it, for that matter

18:16 dnolen: Morgawr: I wouldn't be afraid to write a high performance JS game in CLJS, but you'd have to be stratify your code base into things that absolutely need to be fast and the stuff that doesn't matter so much.

18:16 technomancy: callen: weren't you in here earlier when I was telling Licenser not to teach his brother clojure?

18:16 callen: technomancy: no

18:16 Pupnik: callen, no-one is going to write physics libs in clojure, they will use the ones from java or js

18:17 Licenser: technomancy heh he is still loving it :)

18:17 Morgawr: dnolen: yes, I know, at the moment I'm just working on the design of the whole engine, writing bits of code for the game library and then see how it performs, then eventually stepping down and writing "native" javascript code for the more critical parts

18:17 technomancy: Licenser: no one listens to me!

18:17 callen: This whole time I have qualified what I was saying with, "serious, performance intensive games"

18:17 Licenser: technomancy :) I'm neutering a new functional programmer!

18:17 technomancy: callen: I have no problem with what you're saying about clojure; just what you're saying about games

18:17 callen: Why are you ignoring that as if I'm saying, "writing tetris in Clojure is impossible"?

18:18 Licenser: neutering? You mean mentoring?

18:18 Pupnik: did anyone come in here saying "im writing the crysis killer"

18:18 hes using clojurescript, that should be a clue

18:18 callen: Pupnik: they mentioned performance intensive.

18:18 Pupnik: explicitly so.

18:18 Licenser: callen teehee yea

18:18 gtrak_: dnolen: I think It's a C++ philosophy clojure inherited, 'pay for what you use'

18:18 callen: Pupnik: I mentioned that structuring your data in terms of hash-maps rather than something more static and optimizable like a struct is a contradiction if you really mean "performance intensive"

18:18 Morgawr: callen: performance intensive within the limits of an html5 browser game

18:18 zalzane: if you're supposed to pay for what C++ provides, c++ would be paying you

18:19 callen: it's a legitimately useful language design decision though.

18:19 and is partly how C++ is able to be used across very different sorts of projects.

18:19 gtrak_: zalzane: the JVM's written in C++

18:19 !

18:19 zalzane: gtrak_ that doesnt change that c++ is a horrible language

18:20 gtrak_: it sort of validates horrible languages...

18:20 I like that I can take advantage of them without being bothered by it, really

18:20 callen: Aye, it is, but games aren't long term maintenance products generally speaking. Things "get done" in bad languages in spite of themselves.

18:20 Morgawr: so yeah guys, I apologize for sidetracking the channel like this with my question

18:20 zalzane: get your act together morgawr

18:20 Morgawr: callen: game engines are, though

18:21 you want to make them modular and re-usable

18:21 callen: Morgawr: which happens. cf. crytek, Epic, iD.

18:21 Morgawr: and most games are, ideally, just a scriptable abstraction on top of an engine

18:21 I think Lisp languages are powerful enough to provide such good abstraction

18:21 at an obvious performance tradeoff

18:22 but since my target is to develop not-too-intensive 2D games in a browser with HTML5/Javascript, I really see no problem with this

18:22 also considering ClojureScript provides the possibility of writing native javascript code and natively interfacing with the rest of your code

18:22 so yeah, I don't see the point of this discussion

18:23 gtrak_: the point is to identify tradeoffs and make them while knowing what you're getting yourself into

18:24 at least I hope it is..

18:24 Licenser: Morgawr entirely unrelated: use the language that gives you the most and ignore all the nay sayers, no point in picking X becose it's more Y but you don't enjoy working with it.

18:25 callen: well, maybe. making money is nice. Depends on what sort of project it is.

18:25 if your personal comfort means delivering a product nobody wants, and the point of the product was so that others could use it, then the value of that time just went to /dev/null

18:25 Morgawr: callen: take a look at ImpactJS, it's a great javascript library and the developers are making good money out of licenses for that

18:25 callen: Morgawr: I'm perfectly aware of the JS HTML5 game frameworks.

18:26 Morgawr: including Impact, Akihabara, and the others.

18:26 Licenser: callen but having no compfort has a high chance of meanign that you never deliver a product at all

18:26 Morgawr: in the end, users don't really give a rat's ass about what your game is coded in, so... it's pretty much what Licenser and gtrak_ said, as long as you're aware of the implications it doesn't matter

18:26 callen: Licenser: if you're not professional, that's right.

18:26 Licenser: some people just bite down and do their job.

18:26 noprompt: callen: what does that even mean?

18:27 "professional" <-- loaded word

18:27 callen: noprompt: the existence of COBOL contractors.

18:27 gtrak_: develop TMD

18:27 callen: noprompt: do you really think any of them love COBOL?

18:27 noprompt: callen: well if they're willing to do it for money they must be making some compromise internally.

18:28 gtrak_: why don' they generate cobol from their clojure code? :-)

18:28 technomancy: it's interesting to note the etymological connection between "amateur" and "amour"

18:29 callen: well, that's really just it. Not everybody has to have the stars align, the perfect cuppa tea, and a purring cat in their lap to get work done.

18:29 Licenser: callen but it certenly help

18:29 gtrak_: ah, there's a market for cobol code generators: http://en.wikipedia.org/wiki/CA-Telon

18:29 how about that

18:30 callen: gtrak_: I used to work on the other end of that, migrating mainframe systems to .NET

18:30 noprompt: i've never understood how some people associate "biting the bullet" or "not doing what the want to do but getting paid well for it" with professionalism.

18:30 callen: gtrak_: generated COBOL invariably made the migration more annoying and difficult.

18:30 noprompt: a large component of professionalism is putting the product/work output above personal comfort/preference.

18:31 Licenser: I entirely disagree with that

18:31 callen: Licenser: okay, but you'd be wrong.

18:31 technomancy: that's ... too depressing for words?

18:31 callen: It doesn't mean wearing the hair shirt, it means taking the actual purpose of your work seriously.

18:31 Licenser: I entirely disagree with that too

18:31 gtrak_: callen: no doubt.. just saying even cobol programmers can be unprofessional

18:31 callen: technomancy: not for me. I like thinking about how what I do is actually intended to help people and optimize for that.

18:31 noprompt: i turned down a 6K contract job because they wanted me to write the code in PHP.

18:31 callen: gtrak_: what an incredibly irrelevant point to make.

18:32 technomancy: noprompt: I would refer to that as professional dignity

18:32 callen: noprompt: I'm wrapping up a horrific PHP contract as we speak.

18:32 noprompt: very happy to have it ending.

18:32 Licenser: I'd hire noprompt over callen

18:32 callen: Licenser: don't express pointless ad hominem sentiments like that.

18:32 bbloom: Licenser: i'd never hire callen

18:32 gtrak_: callen: you miss the finer point :-).. there's always people that want to make more out of what they have.. that's not unprofessional

18:33 noprompt: callen: when you don't have a say so i can agree with "biting the bullet", but if you have free will why choose unhappiness?

18:33 callen: noprompt: I just got done saying that I wasn't saying "wear the hair shirt"

18:34 bbloom: why be pointless negative? you don't have nearly enough information to make a call like that, so the only point of saying so in a public channel is to attack me.

18:34 pointlessly*

18:34 gtrak_: there's also people that hate abstraction in any form

18:34 callen: they would be irrational.

18:34 Licenser: callen it's just making the point, someone doing what he enjoys will do it better then someone who does it because he thinks he must. Also someone who turns down a job because he disagrees is much more likely to offer insight, imprvements and laternatively then someone doing what he's told

18:34 bbloom: callen: i have more than enough information to make that call. you're abrasive, argumentative, and generally unpleasant

18:35 callen: bbloom: OTOH, I seem to be able to handle getting attacked on all sides by people in here for making what is a pretty uncontroversial point about trade-offs without resorting to saying I would never work with them.

18:35 Morgawr: callen: why are you in this channel? genuine question. Following your reasoning, you'd never use Clojure for anything

18:35 callen: Licenser: enjoying what you do is good, helps you to get better at it faster. It's not sufficient for what I was speaking about earlier.

18:36 noprompt: callen: i wasn't attacking you, just sharing my POV.

18:36 callen: Morgawr: that is clearly not what I was saying.

18:36 noprompt: FWIW

18:36 callen: Morgawr: stop strawmanning what I've been saying.

18:36 Morgawr: where did I say that? I even explicitly laid out an example of the sorts of things Clojure is great for.

18:36 Morgawr: okay, I apologize for misunderstanding what you said

18:36 callen: that's an understatement.

18:36 gtrak_: I'm picking a battle over a specific trend, reduction in place of facts

18:37 bbloom: callen: i'm just a little tired of you derailing productive conversations, confusing newcomers, and fostering a hostile environment

18:37 callen: bbloom: I've been calmly explaining my point from earlier, the attacks were coming from others.

18:38 bbloom: callen: i have no doubt you believe that you are being calm and civil, but your word and phrase choice has a consistently hostile tone

18:39 callen: That's reaching a bit. Is it somehow unfactual or hostile to describe what Morgawr did a moment ago as strawmanning the point I was making? Because that's what it was. Deliberate misinterpretation into a ridiculous facsimile of a legitimate point for the sake of attacking it so that I look stupid by proxy.

18:40 bbloom: ^^ case in point ^^

18:40 callen: Stating the facts is hostile. Am I understanding you correctly?

18:40 gtrak_: overblowing is being imprecise

18:41 hiredman: bbloom: have you considered /ignore?

18:41 Morgawr: callen: I apologized for being rude, I just asked a genuine question because you seemed very hostile towards anything that wasn't 100% performance and felt you were a bit resentful towards clojure. I apparently was wrong so I apologized. It wasn't my intention, really.

18:41 bbloom: it doesn't matter how right you are if you sound like an asshat in the process. i'm telling you how you are perceived, and not just by me. consider it a datapoint. i'm done

18:41 callen: Morgawr: I'm repeating for the third or fourth time now that what I was saying was scoped to a specific sort of project. namely, "performance intensive" && "game"

18:42 clearly I should give up expressing anything that cannot be gift-wrapped in 140 characters in here.

18:42 Anything else is likely to get lost, twisted, turned against me, etc etc

18:42 ztellman: callen: those are both very relative terms

18:42 callen: ztellman: certainly but the implication is that it's a project meant to be comparable with the current state of the gaming industry.

18:42 ztellman: callen: I don't agree with that at all

18:42 noprompt: wow i would have never thought to make a user.clj file, that's so cool.

18:43 callen: ztellman: that implies that there is a higher standard for "fitness for purpose" than a learning project.

18:43 ztellman: "performance intensive" means "I need to pay attention to the computational cost of things"

18:43 amalloy: hiredman: i'm worried my /ignore list will grow so large that my system starts swapping, in order to hide all participants int his unfriendly conversation

18:43 ztellman: "game" means something that's fun

18:43 callen: ztellman: the thing is, we probably agree on the implications, but not on the scoping implied by the qualifiers.

18:43 mthvedt: amalloy: use a trie

18:43 noprompt: yeah, could we tone this down?

18:44 Morgawr: ^

18:44 technomancy: (inc mthvedt)

18:44 pkmnBlue: well, what have we learned?

18:44 lazybot: ⇒ 3

18:44 callen: pkmnBlue: don't bother saying anything people can disagree with.

18:44 bbloom: amalloy: mthvedt: both excellent jokes. my apologies for the noise

18:44 gtrak_: disagree in interesting ways?

18:44 callen: pkmnBlue: especially if they are feeling defensive about their technology choices.

18:45 hiredman: amalloy: mine is 185 entries, and it does pretty well

18:45 callen: I get that some people can feel embattled because they're trying to introduce clojure at work but that was unmerited and unconstructive.

18:46 akhudek: mthvedt: cache-oblivious trie would handle all levels of discussion with high performance

18:46 amalloy: hiredman: my client is so abysmal it doesn't remember /ignore across program restarts. on the other hand, that enables me to cavalierly block for a day people who are generally friendly enough

18:47 callen: amalloy: if you use irssi you can set up permanent ignores in the .irssi/config

18:47 I wonder what client that is though.

18:47 hiredman: amalloy: hmmm, yeah, expiring ignores would be an interesting feature

18:47 technomancy: yeah, it seems like defaulting to a decaying /ignore would be a neat feature

18:48 gtrak_: someone was discussing a distributed /ignore in here a few months ago with me

18:48 amalloy: hiredman: do you still have Raynes on ignore from three years ago?

18:48 callen: gtrak_: Zed Shaw had Utu.

18:48 technomancy: gtrak_: that would take care of Lajla

18:48 clojurebot: excusez-moi

18:48 callen: gtrak_: he abandoned it though.

18:48 hiredman: yes

18:48 gtrak_: ah, neat

18:48 hiredman: and LauJensen

18:52 noprompt: callen: how do i page up in irssi?

18:52 technomancy: https://twitter.com/LiamAbigail1/status/340528414740074496 I don't evn

18:52 callen: noprompt: pgup works fine for me, I'm in GNU Screen + irssi. That's not working for you?

18:52 noprompt: oh you must be on a mac, right?

18:52 noprompt: callen: yep!

18:52 :|

18:52 callen: noprompt: http://osxdaily.com/2007/10/29/fix-page-up-key-in-terminalapp-to-work-with-irssi/

18:53 noprompt: I actually wrote a blog post about fixing some other stuff in irssi

18:53 noprompt: ah thx

18:53 callen: noprompt: http://bitemyapp.com/post/fixing-arrow-keys-in-iterm-and-terminal-app-for-mac-os-x/

18:53 akhudek: technomancy: that's a really really poor random tweet bot

18:53 callen: noprompt: not having channel left/right work in irssi on OS X was driving me nuts.

18:53 noprompt: technomancy: i need to favorite that

18:54 callen: akhudek: markov chains?

18:54 technomancy: akhudek: the amazing part is that it seems to mismatch the gender of the pic with the gender of the name with ~90% reliability

18:54 akhudek: callen: looks more like uniform bag of words sampling

18:54 bbloom: technomancy: maybe the classifier only has 10% errors, but they swapped their enum values? :-)

18:55 technomancy: bbloom: it's remarkable

18:55 noprompt: callen: thanks for this. i used to use erc in emacs but then the company decided to block usage of all "non-standard" ports.

18:56 callen: now i have to use ssh + irssi.

18:56 technomancy: noprompt: erc over mosh is <3

18:56 but I guess mosh is probably nonstandard =\

18:56 callen: noprompt: irritating. yeah. I use mosh -> GNU Screen ( irssi )

18:56 technomancy: couldn't he tunnel it?

18:56 noprompt: technomancy: does it use ports other than 22, 8080, etc?

18:57 technomancy: I like instantly reconnecting to an ERC instance connected to 4 different chat networks as soon as my network comes back up

18:57 noprompt: yeah, needs a bunch of UDP ports opened

18:57 callen: kinda defeats the point

18:57 as far as the auto-reconnect goes

18:57 which is the best part IMO

18:57 callen: technomancy: I guess you're right. I do like opening my laptop and having it "just work"

18:57 noprompt: well i can check that out at home i suppose.

18:57 callen: noprompt: also mosh is "mobile-shell" on homebrew, not mosh.

18:58 noprompt: mosh on homebrew is some communist scheme thing

18:58 technomancy: stalin?

18:58 callen: I tried to get them to fix it, no dice. :)

18:58 technomancy: Trotskyite. Continuous revolution.

18:58 noprompt: callen: thanks again. boy the spirit in this room is suddenly lifting. ;)

18:59 technomancy: fwiw, i guess i should thank you for the esk. w/o that and evil mode i probably would have never left vim.

19:00 the vim + tmux hackery was killing me.

19:00 amalloy: esk sounds like some kind of rodent

19:00 callen: noprompt: if you want some lovecraftian Emacs inspiration: https://github.com/bitemyapp/dotfiles/

19:00 technomancy: meh; the starter kit is such a hack

19:00 callen: noprompt: 412k LOC, 340-380k of Elisp.

19:00 technomancy: I mean I'm glad you like it

19:00 but it's pretty dated

19:00 callen: noprompt: has roughly the same functionality as the ESK, but a little more up to date.

19:01 well, has more functionality, but a lot of it is stuff you won't care about :)

19:01 noprompt: technomancy: nevertheless it helped get me off the ground. at some point i'll probably pick through the parts i like and fold it in to my init.el

19:01 technomancy: I'm just waiting till I have time to properly deprecate it

19:01 callen: noprompt: I have a nice per-use-case modularization in my dotfiles, but I don't really use package managers.

19:02 not for Emacs anyway.

19:02 noprompt: callen: i'm still new to emacs, probably two months at this point.

19:02 but this is also good to know about.

19:03 callen: noprompt: I had a couple years where I took a break from emacs to get better with vim and the cool stuff the young kids were using, I've otherwise been an Emacs user for a long time.

19:03 noprompt: you could rapidly become a more fluent Emacs user than myself if you put in some time deliberately practicing and exploring.

19:03 noprompt: callen: honestly evil-mode made it pretty easy to switch.

19:04 that and keychord

19:04 callen: noprompt: good. Vimmers don't often believe me that evil-mode is fine :)

19:04 noprompt: I'm surprised you like key-chord

19:04 technomancy: just don't get too used to the idea of pulling in a big glob of disorganized, undocumented code you don't understand and becoming reliant on that.

19:05 callen: noprompt: yeah, what technomancy said. Don't just yank my dotfiles, read it and see how I modularized things. Integrate one thing at a time.

19:06 Morgawr: am I bad for using vim for Clojure? :)

19:06 technomancy: most of the good stuff from uncontroversially-good the starter kit is in https://github.com/technomancy/better-defaults

19:06 callen: the desire to not just dump a bunch of code into my emacs is why I avoid package managers for now. I might modernize later.

19:06 Morgawr: it's a popular choice. Fireplace makes it nicer.

19:06 technomancy: Morgawr: as long as you can avoid writing vimscript you should be fine

19:06 Raynes: Morgawr: I currently use Vim for Clojure. I frequently switch between Vim and Emacs.

19:06 Meh, you can write Vim stuff in Python if you want. It isn't a huge deal.

19:08 callen: Raynes: have you tried vim-easymotion?

19:09 Raynes: callen: No.

19:09 callen: there's a version for Emacs as well, but you've been using vim.

19:09 Raynes: give it a whirl, it's pretty sweet.

19:09 Raynes: http://tinypic.com/view.php?pic=2yysefm&s=7

19:10 noprompt: oh ace-jump-mode?

19:10 that's the bomb.

19:11 the only gripe i generally have about emacs is identation and syntax highlighting.

19:11 callen: it seems to depend on the language for me.

19:11 Stuff like Ruby works great.

19:11 Erlang too

19:11 noprompt: yeah it seems like you need to do a little customization with some stuff.

19:12 like i just discovered the electric-mode stuff recently when working with js so } would automatically dedent.

19:12 one thing i need to work on is my tab key.

19:13 oh another awesome package is autocomplete. holy smokes, that package is amazing.

19:14 sorry. heh, emacs makes me super excited.

19:14 technomancy: ah youthful exuberance... it's so refreshing

19:15 callen: technomancy: I was trying to ask you yesterday, have you read any of the Culture novels?

19:15 technomancy: hm; doesn't ring a bell

19:16 callen: technomancy: Iain M. Banks?

19:16 technomancy: I have seen that name

19:16 in bookstores

19:16 callen: technomancy: they're excellent sci-fi, you should check it out.

19:16 technomancy: cool

19:16 callen: technomancy: starting with consider phlebas or player of games.

19:16 technomancy: I am reading the Cyberiad right now, which is hilarious despite being translated from Polish

19:17 callen: technomancy: I haven't read any Lem, would you recommend that or something else?

19:17 technomancy: I've only read Solaris apart from this

19:17 it's good but a lot more serious

19:18 if you're in the mood for philosophizing

19:19 the cyberiad is short stories, so maybe a better place to start

19:20 noprompt: technomancy: i've never read Solaris, but the movie (the original russian version) is incredible.

19:20 technomancy: noprompt: it's on my list. I think I'd like it from what I've read.

19:20 opinions appear to be mixed

19:20 callen: noprompt: have you seen Stalker?

19:20 technomancy: callen: I don't think so

19:20 noprompt: technomancy: it's out of control with the goodness.

19:21 callen: noprompt: Tarkovsky did Stalker too, I really liked it.

19:21 technomancy: noprompt: I have a hard time imagining how it would transition into a film

19:21 which probably means I should stay away from the hollywood one and go with th emore unconventional take =)

19:21 callen: technomancy: it's a different story though.

19:21 noprompt: callen: no i haven't seen it but since you're reminding me i'm jotting it down.

19:22 callen: technomancy: the focus is very different.

19:22 noprompt: callen: that guy has a lot of really good movies.

19:22 callen: technomancy:

19:22 woops

19:22 noprompt: aye

19:22 noprompt: if you like Russian cinema in general, Kidnapping Caucasian Style is silly and fun.

19:25 noprompt: so far most of the russian and eastern european material i've viewed has been very good. usually heavy on the philosophy. good stuff.

19:25 ztellman: technomancy: if you like Cyberiad, make sure all the other Lem translations you read are by Michael Kandel

19:26 noprompt: there was a nice collection of movies called "The Masters of Russian Animation"

19:26 ztellman: he's less literal, and a lot truer to the spirit as a result

19:26 noprompt: some of the animation in those movies on a technical level is just mind blowing.

19:26 callen: noprompt: KCS isn't philosophical, just fun. :)

19:27 technomancy: ztellman: noted; thanks. I'm amazed how well the wordplay survives the translation.

19:27 ztellman: technomancy: I can't read Polish, but I've spoke to people who can, and they confirm it's very loose translation

19:27 * noprompt feels strangely inspired to read fiction again

19:28 ztellman: still, I think it captures something that a literal translation would trample all over

19:29 technomancy: there's always that tension

19:29 ztellman: oh, also, if you like Cyberiad you'll probably like Jack Vance's Dying Earth collection

19:29 assuming you haven't already read it

19:29 hiredman: hah!

19:30 * hiredman is glad to be not the only one who thought that they were similar

19:30 technomancy: yeah, that's two votes in one day

19:30 ztellman: oh, ha, did someone already say that?

19:30 technomancy: it was a while ago

19:30 and possibly a different channel

19:30 hiredman: it was in #emacs

19:31 jack vance passed away a few days ago

19:32 ztellman: really?

19:32 technomancy: frequently bought with The Book of the New Sun, which I also had recommended to me recently

19:32 ztellman: that's sad to hear

19:32 hiredman: yes, the 26th

19:32 ztellman: technomancy: yeah, was about to mention that too

19:32 very different style/tone, though

19:51 zoldar: I'm trying

19:51 oops

19:54 dnolen: technomancy: I think both Solaris films work well, but I think the book is something else

19:54 zoldar: I'm trying to make a simple hangman game (command-line based), handling user input as a lazy sequence. In current implementation, the game state seems to be one step behind the input. I wonder if it's at all doable using a lazy sequence: https://gist.github.com/zoldar/5688673 . Maybe I'm missing something obvious?

19:55 noprompt: dnolen: i never saw the newer one. is it any good?

19:55 Bronsa: o

19:55 dnolen: noprompt: Soderbergh's no Tartovsky, but he's not bad

19:56 noprompt: dnolen: i think part of what put me off was clooney but maybe i'll give it a chance.

19:59 dnolen: noprompt: I think both films emphasize the psychological aspects of the novel which are great, but both have to ignore the scientific satire for sake of time

20:01 noprompt: (bench (+ 1 1))

20:01 WARNING: Final GC required 5.224976081480942 % of runtime

20:01 uh? wut?

20:01 :/

20:05 hmm... has anyone seen that happen with criterium before?

20:06 ztellman: noprompt: yes, you're creating a bunch of Longs

20:07 noprompt: huh?

20:08 i can't bench anything though, it just locks up.

20:08 Morgawr: how do I use stuff like clojure.walk/walk inside a clojurescript rhino repl? I started the repl with leiningen and I am in cljs.user but when I try to use walk it prints out an error

20:08 ztellman: oh, I thought that was just an initial warning

20:08 noprompt: (bench (Thread/sleep 1000))

20:08 Morgawr: I think I'm missing the namespace or something

20:08 noprompt: WARNING: Final GC required 5.305805923608734 % of runtime

20:08 right out of the example in the README

20:09 Morgawr: oh nvm, I had to use (load-file )

20:11 noprompt: i'm not sure if i should report this or if it's something i'm doing wrong on my end.

20:12 ztellman: noprompt: usually that warning is printed before a bunch of other stuff

20:12 are you killing the task too early, maybe?

20:13 noprompt: yeah i think that's what i was doing. i guess i was just confused because i didn't expect a long delay or the output to be different from what's shown in the README.

20:14 ah the with-progress-reporting macro makes it all clear now.

20:15 * mikethepurple yawns

20:16 * noprompt needs to slow down

20:17 Morgawr: well, to answer myself with the question I asked a few hours ago about mapping onto values and what's the best performance... in ClojureScript apparently using a zipmap on keys and vals of a map takes double the time it takes to perform a walk of a hashmap

20:17 so I guess I'll be using a walk

20:17 takes more or less double the time*

20:18 mikethepurple: Wow, didn't know that

20:21 noprompt: technomancy: is it possible to automatically align docstrings in clojure-mode?

20:25 dnolen: Morgawr: yeah it shouldn't be that slow, looking at Clojure's implementation we could do better

20:25 Morgawr: dnolen: http://www.morgawr.eu/p/1370045233.png this is some naive test I did, just taking 10000 random values and multiplying them with random values, left is clojurescript, right is clojure

20:26 it doesn't count for a lot but I think the difference is there

20:26 dnolen: Morgawr: I'm you're running those in the Rhino REPL

20:26 I'm assuming

20:26 Morgawr: yes

20:27 dnolen: Morgawr: Rhino is useless for benchmarking 100-1000X than modern JS engines

20:27 100X-1000X slower

20:27 Morgawr: I was just looking at the difference between the two methods, not really looking at the numbers

20:27 dnolen: gotcha

20:27 Morgawr: more about the relationship between those two numbers

20:27 and yeah, it *is* a naive test :)

20:27 dnolen: Morgawr: even there it will be pretty misleading

20:27 as Rhino is crap

20:28 Morgawr: but yeah, I'll implement walking as a general implementation, if things start to go wrong and performance drop I'll swap with zipmap just to test and eventually look for another solution maybe

20:28 dnolen: Morgawr: V8 seems more analogous to JVM in terms of perf profile shape

20:43 Morgawr: mmm.. I have a question... I am calling clojure.walk/walk in a .clj macro file for my clojurescript library, when I call that macro from another namespace (I use :require-macros etc etc) I need to also :require [clojure.walk] else it says it cannot find a reference for clojure.walk.walk

20:43 do I need to require all the namespaces used in my macros all the time or is there another way around it?

20:45 onlynickleft: Any ideas why (use 'difftest.core) in the repl says FileNotFoundException when lein-difftest is in my :profiles :dev :plugins?

20:46 tomjack: onlynickleft: plugins are loaded in leiningen's jvm, not the project's jvm

20:46 onlynickleft: My plan is to write an auto-runner that just runs difftest manually via Clojure whenever some file changes in the project.

20:46 Oh.

20:46 tomjack: if you want it in your project put it in :dependencies

20:47 onlynickleft: Hmm, I've done that too, and I still got this exception.

20:47 tomjack: that would be because lein-difftest does not define a difftest.core

20:48 oh, I see

20:48 onlynickleft: Oh!

20:48 tomjack: there's an inner support project

20:48 onlynickleft: It's just difftest.

20:48 tomjack: [difftest "1.3.8"]

20:48 onlynickleft: Confusing.

20:48 tomjack: yap

20:48 onlynickleft: Right, found that on Clojars just now.

20:48 Thanks tom.. or is it jack.

20:48 tomjack: I presume lein-difftest loads that inside the project jvm

20:48 onlynickleft: Yeah.

20:49 Looks like lein-difftest is just a trampoline just a wrapper for difftest

20:49 Oops, didn't mean to paste that, meant to paste https://github.com/brentonashworth/lein-difftest/blob/master/src/leiningen/difftest.clj

20:49 emacs copying things when I delete them is quite weird and I want it to stop.

20:50 But irregardless.

20:50 >:)

20:52 arohner: does slingshot not catch (throw (ex-info ...))?

20:55 onlynickleft: How hard would it be to combine something like weavejester's ns-tracker with difftest to print colorized test output just like lein-difftest does, but re-run every test every time a source file changes?

20:56 I think I know conceptually how to glue these together, I just don't know much about the leiningen plugin system, and it looks overwhelmingly complicated, even for small plugins like this would be.

20:58 weavejester: onlynickleft: The plugin system is actually pretty simple

20:59 onlynickleft: If you run "lein blah foo", it calls the function (leiningen.blah/blah "foo")

21:00 onlynickleft: Oh, thanks. That is simple.

21:00 weavejester: I think I misunderstand how to use ns-tracker.. this lib doesn't loop through, watching things, does it? I have to create my own loop, is that so?

21:01 Because I ran it just now and it exited immediately after the doseq.

21:01 weavejester: onlynickleft: Right. It just returns a function that tells you what has changed since you last ran it.

21:03 onlynickleft: Is (while true ...) efficient and fine?

21:04 Awesome! I just made an automatic test-rerunner. Now to figure out how to make it colorize its output via difftest.

21:04 Clojure is fun :)

21:12 dnolen: Morgawr: funny enough looking it to this makes me realize that Clojure's handling of keys / vals fns is particularly clever

21:19 onlynickleft: Hmm, is it a feature or a bug that clojure.test doesn't consider it a test-error when the test file contains an undefined symbol?

21:22 gfredericks: probably not an intentional feature

21:23 I don't know that clojure.test aims to control how the file is loaded

21:23 onlynickleft: Ambiguity! I call ambiguity on you!

21:23 Oh.

21:23 gfredericks: which would be the only way to provide that feature

21:23 onlynickleft: Right.

21:23 gfredericks: I don't know the clojure.test internals, but that's my guess

21:24 presumably your test runner could wrap such things if it wanted to

21:24 onlynickleft: That's my plan. Just a try/catch/println. Or TCP if you will, a la REPL.

21:25 Or rather, try/catch/println (if printable), i.e. TCP/IP

21:27 gfredericks: TCP/IP is a good abbreviation for it

21:27 onlynickleft: Seems legit.

21:27 gfredericks: "The Clojure Parenthesis (is pretty)"

21:28 onlynickleft: Dang. Turns out my idea of an auto-runner wrapper around difftest using ns-tracker isn't as perfect as I thought it'd be.

21:29 Some hard problems to solve, like if I do (apply run-tests namespaces) then it will be less verbose, but if there's an exception in one of the test files, I can't print exactly which one had the exception.

21:29 I guess I can just let it die upon exception.

21:30 noprompt: gfredericks: i absolutely love parens.

21:30 let the record show this.

21:31 onlynickleft: Is there a reasonable way to run another leiningen task within a normal Clojure function?

21:31 (Besides shelling out.)

21:32 noprompt: i'm going to start refering to fridays as "documentation fridays"

21:32 onlynickleft: That bad eh?

21:32 noprompt: for some reason i always find myself writing a lot of documentation and doing code clean up on fridays.

21:32 onlynickleft: i don't think it's bad at all. i actually really enjoy it.

21:32 there's something wondeful about revisting a code base 5 months later and the code is clean and the documenation is clear.

21:33 onlynickleft: Wouldn't know.

21:33 noprompt: i really like the concept of literate programming too.

21:35 writing documentation and explaining your code can also help you refactor it.

21:35 at least that's what i've discovered.

21:35 i dunno maybe i'm just a shitty programmer.

21:35 or maybe i just give a shit.

21:35 :)

21:35 onlynickleft: I'm constantly cleaning up my code.

21:36 And other people's code.

21:36 But it's still always crap. No matter how much or little time passes.

21:36 The only code I like is the stuff I see in the stable Clojure tools. i.e. ring, compojure...

21:36 noprompt: nothing says "fuck you" like leaving beind a pile of undocumented, speghetti code.

21:37 onlynickleft: Yep.

21:37 People have been telling me "F U" quite a lot.

21:37 For months.

21:37 tomjack: why does fd/process-dom merge dom and domp in addition to the merge-dom stuff in logic.clj?

21:37 noprompt: haha, yeah. i've been going through one of the biggest "fuck you"'s of my career.

21:38 it's a mangled pile of interpolated php and js.

21:38 of course, to be fair, it was written 6 or 7 years ago during the close of the web dark ages.

21:39 tomjack: oh I guess wildly that logic.clj's merging is when different vars with doms are unified, and the thing in fd is for adding a different dom to the same var

21:39 noprompt: all i can say is thank god for the mysql workbench and foreign keys.

21:40 had i not had those two things i would have been royally screwed.

21:49 dnolen: keys/vals operations now up to 8X faster on CLJS, some ops seem near 2X of the JVM http://github.com/clojure/clojurescript/commit/a879aee5b8b4246a942c29a733fdc752d11e30ce

21:49 Morgawr: thanks for pointing out the issue

21:51 akhudek: wow, dnolen you seem to be on an optimization tear lately

21:51 dnolen: akhudek: well I get annoyed whenever CLJS ops are ridiculously slow :)

21:52 akhudek: I look forward to the day that you can easily predict the perf difference between CLJ JVM & CLJS

21:53 akhudek: honestly most of my optimization boil down to "What did Rich do?"

21:53 akhudek: dnolen: there are many times I've been surprised by the jvm when trying to improve the speed of things

21:54 dnolen: performance tuning can be really difficult

21:55 dnolen: akhudek: no argument there

21:58 * gfredericks imagines rich giving a talk on "performance tuning" that turns out to be about piano tuning

22:00 gdev_: then compares tuning a piano with tuning an electric organ and everyone is suddenly enlightened

22:08 tomjack: ,(do (defrecord Foo [^:bar bar ^{:baz :bing} bing]) (map meta (Foo/getBasis)))

22:08 clojurebot: #<Exception java.lang.Exception: SANBOX DENIED>

22:09 tomjack: (you get the metadata :D)

22:13 gfredericks: only way to get the basis of a general record instance is reflectively?

22:17 tomjack: I'm probably just going to use a macro

22:18 since there are no anonymous ITypes anyway?

22:26 gfredericks: what is an anonymous IType?

22:29 callen: gfredericks: deja vu

22:30 gfredericks: o_O?

22:30 tomjack: like if you could reify a record type

22:30 clojurebot: The use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. -- Dijkstra

22:31 tomjack: it's moot, I realized only working for deftype/defrecord would be silly anyway

22:32 gfredericks: deftype doesn't have a basis does it?

22:33 tomjack: yeah it does

22:33 not that you probably should use it for anything..

22:34 gfredericks: oh weird

22:35 noprompt: boy this meta data stuff comes in handy. somehow i always for get about it :/

22:48 callen: noprompt: what are you using it for?

22:48 noprompt: I usually use it to annotate functions.

22:51 john2x: can't enlive's html-resource fn read html strings? i'm getting NPE when passing a string to it

22:51 noprompt: callen: i have some files which contain data where the individual records aren't timestamped, however the files are.

22:52 callen: john2x: just check the code.

22:52 noprompt: callen: the records are being imported in to a database and some of the data changes between files.

22:53 callen: i need to be able to compare the differences between the records in t

Logging service provided by n01se.net