#clojure logs

2013-05-31

00:00callentieTYT: 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)
00:01tieTYTwell I want to make a game with the html5 canvas
00:01tieTYTthis tutorial makes it look easy: http://nakkaya.com/2012/01/31/clojurescript-canvas-a-simple-breakout-implementation/
00:01callentieTYT: then definitely no.
00:02tieTYTcan you elaborate on the pain?
00:02callentieTYT: unless the game is intentionally trivial and a throwaway, that is.
00:02callentieTYT: is it a throwaway learners project?
00:02tieTYTyeah, but it may grow into something more
00:02callenerm, you have to make a choice.
00:03tieTYTit's to teach myself clojurescript. I was going to make a snake on steroids, not a WOW
00:03callenif you do it in cljs, but decide to make it something serious, you'll probably have to rewrite.
00:03tieTYTwhy?
00:03clojurebotWhy is startup slow is busy compiling the `for` macroexpansion
00:03tieTYTwhy does clojurebot do that? Is it ever useful?
00:03callensometimes.
00:04callentieTYT: 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)
00:04callentieTYT: something more performance intensive like an html5 game *cannot* be in something like cljs if there are practical performance concerns.
00:04callenpractical meaning, "I cannot be forced into a rewrite when/if I hit a brick wall"
00:04bbloomat least not without *SIGNIFICANT* cleverness :-)
00:05callenmacros 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.
00:05callenit's usually not worth it.
00:05tieTYTwhat would you recommend?
00:06callenfrontend stuff is somewhat constrained in what you can get away with, unlike backend.
00:06tieTYTthat's a shame. Because it seemed like a great opportunity to learn clojure better
00:06callendepends on the project. HTML5 games commend the use of a good framework.
00:06callencomplex SPAs should probably be in AngularJS.
00:06jacortinasIs 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.
00:06callensimple stuff suffices with jQuery and vanilla JS.
00:06tieTYTwhat's SPA?
00:07callentieTYT: single-page app.
00:07callentieTYT: implies a more complex/serious frontend application.
00:07tieTYTah right
00:07tieTYTyeah that's what I was planning
00:07dnolenbbloom: 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.
00:08dnolenand many interesting games don't really require obsessing about perf
00:08jacortinasIf you really needed to you could write optimized loops in plain javascript, things like that.
00:08callentieTYT: erm, you were planning a game. I cased that out separately.
00:08dnolenjacortinas: loop/recur becomes optimized loops in JS
00:08bbloomdnolen: you need significant cleverness to write idiomatic-ish code
00:09bbloom(that is also fast)
00:09jacortinasyeah
00:09dnolenbbloom: no more cleverness that you need in JS
00:09jacortinasyup
00:09tieTYTgetting a lot of peer pressure here to not even look into it
00:09dnolenloops recur, arrays, objects, arithmetic
00:09tieTYTdnolen: I don't think I know JS well enough to be clever with JS
00:09bbloom*shrug* if you're gonna avoid all of clojure's libraries and types, you might as well just write coffeescript
00:09ehaliewiczwell you have macros, which can be pretty great for optimizations
00:09callentieTYT: then the situation is even worse because you really need to know the underlying JS.
00:09ehaliewiczdepending on what you're doing
00:09callentieTYT: especially with the obtuse error messages.
00:09jacortinasWriting a game would honestly end up mostly like plain javascript ( I think ), you end up using things like requestAnimationFrame
00:10callentieTYT: you're better off learning vanilla JS through this project.
00:10tieTYTcallen: even more than angular?
00:10callenAngular is not a programming language, it's a framework. You still need to know JS and to have a good reason for using it.
00:10bbloomwhen writing clojure, you can get away with minimal Java knowledge. when writing cljs, you probably really still want browser & js experience
00:10callenyou haven't described a project that commends the use of Angular.
00:11bbloomsignificnat
00:11tieTYTi have significant java knowledge actually
00:11callentieTYT: I concur with what bbloom just said. but java is besides the point here.
00:11bbloomi was speaking generally
00:11tieTYTthat sounded arrogant
00:11dnolenbbloom: 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
00:11dnolenthis is more or less how CLJS itself is written
00:11callenback to the point, you need to know the DOM and JS.
00:12tieTYTi know it a bit, but it sounds like i don't know it well enough to attempt clojure
00:12bbloomdnolen: what is clear no brainer perf stuff to you is significant cleverness to other folks :-)
00:12tieTYTclojurescript i mean
00:12bbloomdnolen: remember that you deeply understand the output of any particular piece of cljs code
00:12dnolenbbloom: OK, but I think if you're going to do a high perf game you probably know something about JS perf anyhow
00:12dnolenI don't really know secret tricks, I just know JS
00:12callendnolen: 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.
00:13tieTYTbut vanilla JS sounds pretty bad. Shouldn't I at least use jquery so that I don't have to figure out browser inconsistencies?
00:13callencurse of knowledge and all that.
00:13callentieTYT: laughable notion.
00:13dnolentieTYT: if you going to use jQuery you don't care about perf anyhow
00:13brehautdnolen: knowing JS is knowing how to herd a bag of angry cats though; thats a huge leg up
00:13bbloomtieTYT: if you are writing a game w/ canvas, browsers are consistent enough
00:13callentieTYT: jQuery doesn't spare you from knowing JS, it just cleans up DOM API inconsistencies.
00:13callentieTYT: and JS isn't that unpleasant, you have first-class functions.
00:13tieTYTyeah I know a little bit about it. I'm just rusty
00:14bbloomi generally just check http://caniuse.com/ before i use anything that isn't wrapped up neatly in the browser APIs
00:14dnolentieTYT: in anycase, JS or CLJS - it possible to write games
00:14bbloomthe known issues data is invaluable
00:14dnolentieTYT: I don't disagree with the sentiment that to get far in CLJS you need to be comfortable in JS
00:15tieTYTyeah I'm not super comfortable
00:15callenJS and DOM knowledge are a prerequisite regardless, might as well conquer that first.
00:16callenamalloy: are you familiar with the libnoir/noir session middleware?
00:16amalloynot really. i vaguely remember there being a with* macro of some kind
00:17amalloylike, (with-session foo) is vaguely like (binding [*session* (atom {})] foo)
00:21tieTYTcallen: 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?
00:22callencljs could improve enough for my opinion to change, I ping nolen periodically about one of the core dealbreakers.
00:22bbloomi 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
00:22tieTYTcallen: what's that?
00:23callensource maps, for one.
00:24dnolentieTYT: regardless of callen's opinions, plenty of people find CLJS preferable over JS even w/o source maps
00:25tieTYTi don't evekn know what source maps mean
00:25dnolentieTYT: mapping compiled JS back to original source for debugging purposes
00:25callenit means knowing what the fuck just threw that opaque error.
00:25tieTYTah
00:25akhudeksource maps will be grand
00:25tieTYTi would imagine coffeescript has the same issue
00:25dnolentieTYT: Michal Marcyk will be working on that for GSoC
00:25dnolentieTYT: JS has the same issue for that matter
00:26callentieTYT: nope.
00:26callenhas source maps and better error messages.
00:26dnolencallen: having used CS quite a bit it doesn't have better error message
00:26dnolenunequivocally CLJS has better error messages, it actually *has* some
00:27dnolentieTYT: CLJS is def rough around the edges, no question about that
00:28callenanother 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.
00:28dnolenif you think AngularJS is a good idea, I don't really
00:29dnolenbut interop in general is important
00:29akhudekI definitely prefer writing cljs to js. The biggest pain points for me are rough tooling and a lack of source maps.
00:29callendnolen: It's incredibly compelling if you want to move past the pyramid slave labor model for building labor-intensive frontend apps.
00:29dnolencallen: eye roll
00:30tieTYTi 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
00:30eggheaddribnet did some stuff that makes interop from cljs easier callen
00:30eggheadhttps://github.com/dribnet/strokes/tree/master/src/cljs
00:30tieTYTthey often point to the namespace definition instead of the cause of the problem
00:31akhudektieTYT: are you using clojure.stacktrace?
00:31tieTYTif (pst) works I am, aren't I?
00:31akhudekusually you get a line number of the offending code
00:31amalloybbloom: 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
00:32eggheadclojure.stacktrace is new in 1.5 right?
00:32akhudektieTYT: http://richhickey.github.io/clojure/clojure.stacktrace-api.html
00:32tieTYTone 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
00:32akhudekI use (e)
00:32tieTYTI thought those were the same
00:32eggheadritz can help w/ debugging too
00:32akhudekmaybe they are, dunno
00:32bbloomamalloy: that's the minimal level of understanding i'd expect a professional engineer to have
00:32bbloomamalloy: many don't.
00:32tieTYTakhudek: hey, i'm the newb here, not you :P
00:32akhudekin any case, I almost always get a line number
00:33dnolenakhudek: that's a very old link - most of that stuff is in clojure.repl now
00:33amalloyi 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
00:33eggheadblindly manipulating symbols
00:34akhudekdnolen: ah, didn't realize. I've been using that since… 1.2?
00:34dnolentieTYT: the worst bugs are the ones at the level of reading/parsing - ns forms, fn forms since you don't get sensible error information
00:34bbloomamalloy: 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
00:34dnolentieTYT: except for those error messages are usually pretty accurate
00:34tieTYTdnolen: yeah
00:35amalloyi agree with that
00:35tieTYTi'm spoiled by java/haskell's compiler
00:35amalloyi'm not sure C is only three levels below most people anymore, but something is, and they should know about it
00:36bbloomamalloy: on a mature enough cross platform VM (ie JVM or a browser) that's probably true
00:36tieTYTback to cljs, i used to write a lot of GWT. It was impressive how little you needed to know about JS with that
00:37callenGWT was horrific.
00:37bbloomamalloy: i'm not sure it's so much discrete "levels" as it is some metric of abstraction leakiness and layering usefulness :-)
00:37tieTYTi don't like writing apps that GWT is a good fit for
00:38alex_baranoskyhow can I print a Double but force it to not print like 1.0E8
00:38amalloy$google java format number
00:38amalloylazybot????????
00:38clojurebotlazybot is echo ~lazybot
00:39bbloomamalloy: http://www.raynes.me/logs/irc.freenode.net/clojure/2013-05-30.txt look at the last line
00:39bbloomamalloy: something went horribly wrong in bot land
00:40amalloyat 3:12, huh? weird. that was well after the linode emergency
00:40amalloy&1
00:42alex_baranoskyamalloy: thanks.
00:43amalloy&1
00:43lazybot⇒ 1
00:43amalloy$mail Raynes lazybot was busted; i've restarted him in your screen session
00:43lazybotMessage saved.
00:44bbloom&"I AM ALIVE"
00:44lazybot⇒ "I AM ALIVE"
00:44metelluslazybot is echo ~lazybot
02:10technomancyargh; mysterious nrepl.el bugs
03:12technomancyhttps://github.com/technomancy/nrepl-discover
03:31ddellacostahow do you format a regexp in Clojurescript?
03:31ddellacostaI'm trying variations on this: #"/blackrock/i" and it's not working.
03:36ddellacostagetting closer, but can't get flags to work...?
03:36ddellacosta(clojure.string/replace "FOO" (js/RegExp. "foo", "i") "oof")
03:42ddellacostaargh
03:42ddellacostahttps://www.refheap.com/15166
04:12nopromptRaynes: are you here?
04:13nopromptor amalloy_
04:32jro__what is status of clojure.core.reducers?
04:35clgvjro__: it is included in clojure 1.5.1
04:52asalehquestion: are core.constraints superset of preconditions?
05:40jaleyI 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
05:40jaleycache miss I'm still likely to have multiple threads generating the same image, only to have all but one discarded when the transaction retries?
05:45arrdemjaley: one hack (and it is a hack) is to have a worker thread that renders your page every 5s, updating a cache atom.
05:46arrdematoms 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.
05:46callenjaley: matryoshka dolls.
05:46arrdemcallen: lol
05:46callenI'm quite serious.
05:46callencomposable caches backed by memcached or redis work great.
05:47jaleyarrdem: 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
05:48jaleycallen: yeah it's also worth noting that this project isn't out of the toy stages yet :D
05:49callenjaley: nobody caches in-memory on the server, that's silly.
05:49callenjaley: use memcached or redis.
05:51jaleycallen: the image is on disk, I'm caching a string - the file name, of which there will be max 10
05:51callenjaley: why do you need to cache a filename?
05:52arrdemjaley: I'd think that the file name is nearly free to compute, you want to memcache the image content
05:52callenseriously
05:52jaleyOK, so I have this library, it sucks in a load of data and writes a jpeg to disk
05:52jaleythat takes 20 seconds, ish
05:54jaleyI just have it write to a randomly named tmp file and delete it later
05:55callenjaley: this doesn't really make sense.
05:55jaleyI 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
05:55jaleyI'd rather, when handling 3 requests for the same image, it didn't generate it 3 times
05:55callenjaley: you should be storing the images in a database
05:56arrdemcallen: why bother? that's way heavyweight for what he's looking at
05:56jaleyi think that might be over-engineering a 100 user tool?
05:57arrdemjaley: frankly it sounds like a crontab entry and some bash scripts would be a better fit than a clojure server :/
05:57arrdem* mix an apache httpd instance in for good measure
05:57callenit would take me less time to just stash the data in postgres than anything else that's been suggested
05:57callenshort of stashing the base64 in a redis server
05:58jaleywhether writing to a DB or to disk, I still have to solve the concurrency issue
05:59callenthe database solves that problem if I haven't missed anything.
05:59callenI 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.
05:59jaleyI 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.
05:59callenjaley: redis has auto-expiring keys
06:00callenjaley: set the 5 minutes or whatever key expiry you want on the value.
06:00callenjaley: if you try to GET the key and it's not there, regenerate.
06:00jaleycallen: so two threads concurrent GET the same key and it's not there for either of them
06:00jaleycallen: then what?
06:00arrdemcallen: sure, then you hammer someone with a 20s latency after a 5m delay
06:01arrdemjaley: it would seem that both get hammered
06:01callenlast guy in wins unless he wants to do a final pass check before stashing the final result
06:01jaleyarrdem: right, exactly what my question was about avoiding :P
06:01callento answer what arrdem is saying, there are a few ways to handle that.
06:01callenyou can either generate the cache as a batch, or you can trigger per image.
06:01callenWhat will work for you will depend on how much data is involved.
06:04callenso you can setup auto-expiry in postgres with subscribers to trigger functions
06:04callenimage expires? trigger gets called. subscriber to that trigger responds and regenerates the cache.
06:05callenalternately, use EXPIRE and redis pub/sub to do more or less the same thing.
06:05callenjaley: ^^
06:10jaleycallen: ok, I have plan involving agents which I'm going to try out before I commit to too many hours work here :)
06:10jaleycallen: thanks for the help
06:12callenjaley: my suggestion will take less time than hacking it up yourself - but good luck anyway.
06:22rbarraudwow - whole lotta leavin' goin' on :-/
06:22callenrbarraud: prooooobably a netsplit.
06:23rbarraudor they be sensitive souls...? ;-)
06:23rbarraudarrr
06:30talios'lo rbarraud
06:31rbarraudhowdy talios
06:32rbarraudwhat excitement is afoot in your neck'o'the woods his fine QBWeekend? :-)
06:32taliosnot much - I forgot it was on ;)
06:32taliosbirthday yesterday - old age ;p
06:32taliosmight go see Star Trek, and Iron Man 3 tho
06:32rbarraudyeah - 21 already eh? Tempus Fugit! :-)
06:33rbarraudnearest pic theatre here is ~28km away
06:33rbarraud:-/
06:33rbarraudApple TV FTW! ;-)
06:33talioswhere are you based?
06:33rbarraudPatea - more specifically, Whenuakura :-)
06:34rbarraud~60km north of Wanganui
06:34clojurebotCool story bro.
06:34rbarraudnot exactly Action Central
06:34talioswhen did you move there? or have I just been delusional that you were Auckland based
06:34rbarraudmind u i could've had a brewski or 2ski t the Bowling CLub in Patea had I felt so inclined tonight :-)
06:35rbarraudI've been kind of exiled here since start of Jan, but coming up ~every 4 weeks or so for appts
06:35rbarraudreduced outgoings here accom-wise
06:35taliosahh
06:35rbarraudi'd like to be back up there in the thick of the action and opportunities though
06:36rbarraudmeanwhile intending to dispose of a lot of vintage-y stuffz before i return
06:36rbarraudunfortunately, ARC doesn't work with physical objects ;-)
06:40rbarraudweak POBoxOfStuffz *oldstuffbox ;
06:41rbarraudoldstuffBox = nil ;
06:41rbarraud*poof*!
06:41rbarraudtoo easy! ;-)
06:41rbarraudif only
07:18rbarraudtalios: Are there any Code Retreats or the like on this weekend? - and are you in NA or AKl?
07:19taliosin Auck, no code lounges planned this weekend no
07:19babilenCould 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?
07:21babilentalios: 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?
07:22taliosbabilen - LIES! ( as he types git push --tags into iTerm) :)
07:22babilenheh, okay :)
07:22taliosbabilen - not intentional no :)
07:22babilenyeah, that did it -- thanks!
07:22talioswas that the bug report, or am I expecting something else ? :)
07:23babilenNo, that was it. :)
07:23talioscoo.
07:23babilenI'd be happy about a comment regarding my earlier question though (if you have the time and know something about it)
07:24talioswhich question? ( i may have missed that )
07:25babilenCould 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?
07:25taliosoh found it right there :)
07:25babilenhehe, well ..
07:26talioshrm - thats a good question actually, cause it doesn't actually declare a parent pom either
07:26Anderkent|awaypom.contrib does in fact add a clojure dependency
07:26taliosah it does - its just in the middle :)
07:26taliosyes - the parent pom declares that dep
07:26Anderkent|awayI'm confused on how your project.clj and the pom.xml are out of sync tho
07:27Anderkent|awayproject.clj declares :parent pom.contrib 0.0.26
07:27Anderkent|awaypom has it 0.1.2
07:27taliosproject.clj and pom.xml are independent
07:27taliosafaik the lein builds are totally separate to the clojure builds
07:27talioser maven builds
07:28taliosmaven is used pretty much solely for releases
07:28babilentalios: Okay, but the parent pom mentions clojure-maven-plugin as well. Why is that repeated in tools.reader pom?
07:28Anderkent|awaybabilen: to control the configuration
07:28taliosbabilen - mmm, it has custom configuration for <namespace>clojure.tools.reader.impl.ExceptionInfo</namespace>
07:29taliosbabilen - that -could- be handled by a property, and made common, but different contrib's may have more namespaces, or different configs
07:29taliosto be honest - this is the first time I've looked at the contrib poms :)
07:29taliosat least, first time in about 2 years
07:30Anderkent|awaytalios: having two descriptors of your project be out of sync (and building against different parent poms :O) seems like a bad idea for me...
07:31Anderkent|awayesp. since the pom can be generated from project.clj
07:31taliosis lein's parent a pom tho? or is it a lein project?
07:31taliosI've never used lein :)
07:31talioswell, ok I like - I've used it to bootstrap a 5 line script
07:32talioslie even. I have no idea how lein works.
07:32Anderkent|awaytalios: lein uses maven as the backend. The parent is a pom
07:32taliosAnderkent|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
07:32babilentalios: Okay, thank you - I see much clearer now.
07:33Anderkentwell, I don't think the parent is used for anything other than pom generation
07:34talioslast time I made a pom from lein for that mini script, it didn't even put the clojure-maven-plugin in there...
07:35Anderkentit 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
07:35Anderkentor you can add it manually by puting pom-injections into project.clj
07:35taliostrue true
07:35taliosnot my projects tho :)
07:35Anderkent:)
07:36taliosI didn't realize contrib still used it till I was interviewing ambrose the other month for the podcast
07:36Anderkentit as in maven?
07:36taliosas in clojure-maven-plugin
07:37Anderkentright
07:39AnderkentI 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
07:40SomeOtherGuyHey guys! Can anyone explain to me how to use the filter command in clojure?
07:40babilenSomeOtherGuy: http://clojuredocs.org/clojure_core/clojure.core/filter has some examples -- What are you having problems with?
07:40clgvSomeOtherGuy: use a predicate the evaluates to true for the elements you want to keep in the given collection
07:40AnderkentSomeOtherGuy: you give it a function that returns truthy for values you want to keep, and a collection
07:41Anderkent,(filter odd? [1 2 3 4 5])
07:41clojurebot(1 3 5)
07:41clgvSomeOtherGuy: like this ##(filter odd? (range 10))
07:41lazybot⇒ (1 3 5 7 9)
07:41Anderkentwhy is it always `odd?` :P
07:41taliosAnderkent - 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.
07:41clgvbecause the question was odd ;)
07:41taliosat least, not as a standard plugin
07:41SomeOtherGuyOkay, for example If I want the first 60 numbers that is a multiplicate of 7?
07:42clgv&(take 60 (filter #(zero? (mod % 7)) (range)))
07:42lazybot⇒ (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)
07:42SomeOtherGuyMy 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.
07:43Anderkenttalios: `lein-release` does something similar, but yeah I guess that is a good point
07:43SomeOtherGuyIt works! :D Great! Thanks. Will try to figure out what all of that means now. Thanks a lot!
07:44taliosAnderkent - 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
07:44clgvSomeOtherGuy: #(zero? (mod % 7)) is the divisibility check
07:45babilentalios: 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?
07:46babilentalios: 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.
07:47SomeOtherGuy @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?
07:47lazybot⇒ (1 3 5 7 9)
07:48taliosbabilen - 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
07:48taliosnot sure if its flagged as optional in the parent?
07:51babilentalios: 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 ...
07:51babilen... pom.
07:52taliosbabilen - ooo, you're one of thoes packaging guys :) You guys like making life hard for yourself :)
07:53taliosthat explains wanting my tags :)
07:53babilentalios: 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
07:53babilentalios: Yeah, that explains it :)
07:54babilentalios: 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 ?
07:55taliosyou should be able to patch the poms
07:56taliosit 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
07:56taliosaltho - that effective-pom is HUGE
07:57babilenWell, 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 :)
07:58taliosbabilen - no worries, any other questions you can generally find me here - or on twitter @talios, or mark @ talios.com
07:58taliostho right now I think its time for bed ( 11:50pm )
07:59babilentalios: Sleep tight and thanks for the offer. :)
08:04rbarraudzzz night talios
08:14callenhttps://jira.mongodb.org/browse/PYTHON-532 Odin knows I've been this guy before.
08:19AnderkentSomeOtherGuy: ##(doc zero?)
08:19lazybot⇒ "([x]); Returns true if num is zero, else false"
08:19Anderkentbabilen: so you're trying to build all transitive dependencies of a maven project?
08:20Anderkentcallen: 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
08:20babilenAnderkent: Yes, that is the only way to build everything from source
08:20babilenAnderkent: You have to build them at least once
08:21callenAnderkent: that's the only part that bothered me. The rest I enjoyed.
08:21callenAnderkent: there is however no context for defending that code :P
08:22Anderkentcallen: how about if this was originally a private codepath that was only executed through a wrapper that performed the validation
08:23callenAnderkent: I don't have time for implausible excuses. It's 10gen, quality control is a distant 10th in the priority queue for that company.
08:23AnderkentSo basically you don't care about the context. That's different to 'no context exists that would make this code defendable'
08:24AnderkentAnd the fact that quality control is not important for the company is a fact about its managers, not the developers
08:24Anderkentmost of the time those are not the people git blame points you to
08:25SomeOtherGuyAnderkent: Just got my brother to explain it to me! :)
08:26SomeOtherGuyAnderkent: Thanks, that's a cool functionality :)
08:26Anderkentbabilen: 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
08:27babilenAnderkent: 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)
08:28babilenAnderkent: And yes, circular dependencies *are* a problem
08:30jweisssometimes 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?
08:31Anderkentjweiss: 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)
08:32Anderkentbabilen: right, so you start with an empty maven repo
08:33jweissAnderkent: sorry, which implied arguments are those?
08:33Anderkenti 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
08:33Anderkentjweiss: &form and &env
08:34Anderkentjweiss: actually, I googled that and I notice I'm confused, so maybe you should just disregard what I said :P
08:36jweissseemed pretty easy to reproduce but i can't remember how i did it
08:36jweissgoogling for -1 doesn't work :(
08:37Anderkentjweiss: https://github.com/clojure/clojure/blob/master/src/jvm/clojure/lang/Compiler.java#L6473
08:37Anderkentcalled it :)
08:37jweiss(inc Anderkent)
08:37lazybot⇒ 1
08:38Anderkentno idea when it would happen though
08:38jweissAnderkent: so the question is how does the macro get called without the "extra"
08:45AnderkentYeah. That, or it's doing the -2 more than once
08:45Anderkentmacroexpand within macroexpand?
08:52Anderkentha!
08:52Anderkent,(do (defmacro xpand [body] (macroexpand-1 body)) (macroexpand-1 '(xpand (defn))))
08:52john2xhow do I split a hashmap into a list of [key value] pairs?
08:52clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
08:52Anderkentbah
08:52Anderkentjweiss: run (do (defmacro xpand [body] (macroexpand-1 body)) (macroexpand-1 '(xpand (defn)))) in a repl :)
08:53Anderkentjohn2x: you don't have to do anything, it *is* a list of key value pairs
08:53clgvAnderkent: thats because of you defn ;)
08:53Anderkentclgv: still, '-2' arguments
08:53Anderkent;)
08:53clgv(do (defmacro xpand [body] (macroexpand-1 body)) (macroexpand-1 '(xpand (defn f [])))) =>(clojure.core/defn f [])
08:54Anderkentclgv: run it in a repl and look at the exception. It says '-2' arguments passed to defn
08:54Anderkentthat's what I wanted to reproduce
08:54clgvok
08:54Anderkentjohn2x: for example ##(take 3 {:a 1 :b 2 :c 3})
08:54john2xAnderkent: I wanted to transform {:foo "bar"} into a querystring like "foo=bar".. is there already library that does that?
08:54lazybot⇒ ([:a 1] [:c 3] [:b 2])
08:54john2xohh
08:55clgvjohn2x: just use reduce-kv on the map to build up the string ;)
08:56Anderkentclgv: is it different to (reduce (fn [state [key val]] ...) init map) ?
08:56clgv&(require '[clojure.string :as s])
08:56lazybot⇒ nil
08:57clgv&(s/join " "(map #(apply (format "%s=%s" %)) {:a 1 :b 2 :c 3}))
08:57lazybotjava.util.MissingFormatArgumentException: Format specifier 's'
08:57clgvor like that ^^
08:57Anderkentwithout the parens around format, obvlsy :)
08:57clgvloh right^^
08:58clgv&(s/join " "(map #(apply format "%s=%s" %) {:a 1 :b 2 :c 3}))
08:58lazybot⇒ ":a=1 :c=3 :b=2"
08:58clgvdamn^^
08:59john2xthanks!
08:59augustlwhere should ~/.lein/profile.clj go on windows?
09:00Anderkent&(s/join "&" (map (fn format-entry [k v] (format "%s=%s" (name k) v)) {:a 1 :b 2 :c 3}))
09:00lazybotclojure.lang.ArityException: Wrong number of args (1) passed to: sandbox10042$eval13855$format-entry
09:00Anderkentbah :P
09:00Anderkentmissed the destructuring
09:00decafaugustl: same place. c:\Users\<yourname>\.lein\ in windows 7
09:02augustldecaf: ah, thanks
09:06clgvaugustl: if you used lein already then that directory should exist
09:16sandbags2Am 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.
09:16augustlclgv: yup, seems to work.
09:17sandbags2I was trying to find the right version number to use... on GitHub the library appears to be 0.0.3
09:17sandbags2but that didn't work as a require
09:17ohpauleezsandbags2: All the Clojure stuff is in maven central -search.maven,org
09:17clgvandbags2: it is on maven
09:17ohpauleezsearch.maven.org
09:17sandbags2ah so i'm looking at the wrong site?
09:17ohpauleezcorrect
09:18sandbags2ahh so "maven central" the clue is when it says it got it from "central"
09:18sandbags2thank you
09:18ohpauleezhttp://search.maven.org/#search|ga|1|g%3A%22org.clojure%22
09:18ohpauleezyou're welcome
09:19sandbags2is search.maven.org reachable for you guys?
09:20sandbags2(http://downforeveryoneorjustme.com/search.maven.org also seems to say it's down...)
09:22clgvthe search works
09:22sandbags2okay it's back
09:22clgvthat isup.me is lying ;)
09:34sandbags2In 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?
09:43ohpauleezsandbags2: Yeah, the numeric tower stuff is JVM specific
09:44sandbags2ohpauleez: i'm wondering if Clojure libraries are, in general, not usable from ClojureScript..?
09:44Foxboronsandbags2: you could in theory rewrite what you need so it compiles.
09:44sandbags2is it only Clojure Core + your own Clojure code
09:44ohpauleezyou'll have to look at the Google Closure library for the functions you're specifically using
09:45Foxboronsandbags2: could actually be a interesting projects to go around and try rewrite Clojure libs into ClojureScript libs.
09:45tolitiussandbags2: what were you going to use form "numeric-tower"?
09:46sandbags2tolitius: floor
09:47clgv sandbags2: converting to integer should do the trick
09:47tolitiusyou can drop to JS and use Math.floor
09:47Anderkentsandbags2: you can use (.floor js/Math my-arg) I suppose, though it does make your code cljs specific
09:47Anderkentscratch that, clgv is right
09:47sandbags2i'm okay with this code being CLJS specific as this is in-browser code I am doing
09:48sandbags2thanks for the suggestions
09:48clgvsandbags2: but only for positive floats
09:48sandbags2although, 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 :))
09:48clgv,(println (int 3.5) (int -3.5))
09:48clojurebot3 -3\n
09:49sandbags2clgv: yep +ve only works here, thanks
09:49clgvfor negative numbers you need an additional decrement
09:50tolitiussandbags2: 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
09:50tolitius*JS and CLJS
09:53sandbags2tolitius: you make a good point :)
09:54MorgawrI 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?
09:55tolitiusMorgawr: this-as
09:56tolitius(fn [] (this-as me (.-a me))))
09:56Morgawrgreat, thanks!
09:57tolitiushttps://github.com/clojure/clojurescript/blob/master/src/clj/cljs/core.clj#L532
09:57tolitiussure
09:57Morgawrperfect :)
10:08asalehI have a macro-related question, Is there a way to have macro output two forms instead of just one?
10:11mefestoasaleh: you could output them in a (do ...) form
10:12asalehmefesto, but do returns only the last form, I need to have several of them (trying to create macro generating contracts for core.contracts)
10:12Anderkentasaleh: return a do form that contains all your forms
10:12mefestoasaleh: how about a code example of the output you want?
10:13Anderkentasaleh: as in (defmacro my-macro `(do (defn first-fn [arg] 1) (defn second-fn [arg2] 2)))
10:13AnderkentI assume your forms side effect
10:14clgvasaleh: what exactly do you want to do?
10:14asalehmefesto, Anderkent .. no, they don't have side-effects, they are just part of contracts syntax
10:14asalehAnderkent, clgv, mefesto ... let me put together a gist ...
10:18asalehAnderkent, clgv, mefesto ... https://gist.github.com/AdamSaleh/5685224
10:19asalehAnderkent, clgv, mefesto ... ^ I wan't to do something like that ...
10:20Anderkentasaleh: have the macro return a list of args and use apply to call with-constraints with those
10:20clgvasaleh: why dont you put "(contracts/with-constraints ~name " in the macro as well?
10:20mefestoclgv: +1
10:21asalehAnderkent, clgv, mefesto ... thanks, will try :)
10:25clgvasaleh: is there really a use for this macro? in my opinion it is way too specific to be of general use
10:30asalehclgv, I found out, that contracts provide side-effectig (contracts/provide) macro, so I am using that instead :)
10:31asalehclgv, 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:06climaxiusquestion: after compiling my clojurescript javascript complains that there is no method "cljs.core.PersistentArrayMap.fromArray"
11:09rebcabin#clojurebot '(+ 1 2)
11:09rebcabin@clojurebot '(+ 1 2)
11:10llasram,(+ 1 2)
11:10clojurebot3
11:10llasram&(+ 1 2)
11:10lazybot⇒ 3
11:10llasramAnd ##(+ 1 2)
11:10lazybot⇒ 3
11:16si14_dnolen: sorry, found an example here: http://swannodette.github.io/2013/03/09/logic-programming-is-underrated/
11:26climaxiusok, somehow fixed my issue by running lein cljsbuild clean
11:26climaxiuswtf
11:28tomjackI think there are some gotchas in the stuff cljsbuild does trying to be fast
11:30dnolensi14_: lists of random variable?
11:37tomjack«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:37tomjack&(.comparator (sorted-map-by (comp - compare) 1 2 3 4 5 6))
11:37lazybot⇒ #<core$comp$fn__4034 clojure.core$comp$fn__4034@17082b6>
11:40tomjack&(clojure.walk/postwalk #(if (number? %) (inc %) %) (sorted-map-by (comp - compare) 1 2 3 4 5 6))
11:40lazybot⇒ {6 7, 4 5, 2 3}
11:40tomjack&(.comparator (empty (sorted-map-by (comp - compare) 1 2 3 4 5 6)))
11:40lazybot⇒ #<core$comp$fn__4034 clojure.core$comp$fn__4034@1dac188>
11:40tomjack:D
11:45lastavailablenicWhat'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:45lastavailablenicAlso hi.
11:50markeroonHi, 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:50llasrammarkeroon: Example?
11:51ToxicFrog|W`rkn"based on" how? (filter (partial contains? (set second-list)) first-list)?
11:52markeroon(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:52lastavailablenicBlast, nobody knows. Ok time to reinvent some wheels.
11:52markeroonToxicFrog|W`rkn: trying this now
11:52ToxicFrog|W`rknmarkeroon: that won't do what you want.
11:53markeroonok
11:53ToxicFrog|W`rknI took a guess on what you meant by "based on", since you didn't specify.
11:53llasramlastavailablenic: Yeah, sorry. There are people here who do web-fu, but appparently not at the moment :-)
11:53markeroonllasram :)
11:54Ember-ok, this is getting annoying
11:54Ember-I need to be able to append data to HTML with Enlive without Enlive doing automatic HTML escaping
11:54ToxicFrog|W`rknHmm
11:54Ember-to be more exact, I need to append base64 encoded string as the value of img element
11:54Anderkentmarkeroon: &&(keep (map #(when (> %2 12) 1) [:a :b :c :d :e :f] [1 2 15 3 4 16]))
11:55Anderkentgah
11:55Anderkenttypoed it
11:55Ember-everything works fine except that enlive insists on escaping the data
11:55Ember-which of course makes the image go fubar
11:55markeroon Anderkent: woah, thanks. i am going to try to digest that. thank you.
11:55Anderkentsec need to fix it :)
11:55Ember-if I don't find a reasonable solution FAST I'm going to regexp this
11:56Ember-which really would suck
11:56cgrandEmber-: use html-snippet
11:56ToxicFrog|W`rkn,(map first (filter #(> 12 (second %)) (map list [:a :b :c :d :e :f] [1 2 15 3 4 16])))
11:56clojurebot(:a :b :d :e)
11:56ToxicFrog|W`rkno.O
11:56Ember-cgrand: I use it, but I'm guessing you're suggesting I use it somewhere else
11:56Anderkentmarkeroon: &&(keep identity (map #(when (> %2 12) %1) [:a :b :c :d :e :f] [1 2 15 3 4 16]))
11:57ToxicFrog|W`rknOh wait
11:57ToxicFrog|W`rkn,(map first (filter #(> (second %) 12) (map list [:a :b :c :d :e :f] [1 2 15 3 4 16])))
11:57clojurebot(:c :f)
11:57cgrandhow are you trying to append data?
11:57Ember-cgrand: so, I read the HTML data in via html-snippet
11:57Anderkentgah what's the trigger for inline execution for lazybot
11:57Anderkent,(keep identity (map #(when (> %2 12) %1) [:a :b :c :d :e :f] [1 2 15 3 4 16]))
11:57clojurebot(:c :f)
11:57Ember-then I try to append the data with at
11:57ToxicFrog|W`rknAnderkent's is better, I think.
11:57Ember-(-> html (enlive/at [[:img]] img-as-base64))
11:57markeroonToxicFrog|W`rkn, Anderkent: thank you both, that's great
11:58ToxicFrog|W`rknMine generates a lot of itty bitty temporary lists that are totally unnecessary.
11:58Ember-(defn img-as-base64 [n] (update-in n [:attrs :src] (constantly (str "data:image/png;base64," (img-to-base64 ((comp :src :attrs) n))))))
11:58Ember-about like that
11:58cgrandwhat's img-as-base64? the value returned by html-snippet?
11:58Ember-so it's a function
11:58cgrandI saw
11:58markeroonToxicFrog|W`rkn: I am going to study it regardless. thanks again.
12:00Ember-cgrand: I love Enlive, but this thing is really bugging me :)
12:00cgrandEmber- and where is the HTML that keeps getting escaped?
12:00Ember-it's the base64 string
12:00Ember-that get's escaped
12:00Ember-gets
12:01cgrandhuh?
12:01cgrandwhich character?
12:01Ember-at least /
12:02cgrandEmber-: can you put the output in a gist so that I can see the problem?
12:02Ember-what I'm trying to do here: embed images as base64 strings into img elements so that the HTML email sent works well
12:02cgrandEmber-: yeah I figured it from the source of img-as-base64
12:03cgrand(ps: use assoc-in rather then update-in constantly)
12:03Ember-true
12:03Ember-refheap dies on my paste :)
12:04Ember-well, wait a sec
12:04Ember-cgrand: http://www.collin.fi/~niklas/paste.txt
12:05Ember-should start as data:image/jpeg;base64,/9j/4RZ1RXhp
12:06Ember-oh crap...
12:06Ember-I think I have another problem
12:06Ember-cgrand: nevermind :)
12:06Ember-thanks anyway!
12:07cgrandoh, ok because I on't see how attar)str turns + into &#43;
12:18tomjackhuh, is there CLP(Bayes) ?
12:18tomjackoh maybe CLP(Prob)
12:21tomjackfound a paper about CLP(BN)
12:24jweisshow do i get records to print with pprint the same way they do with pr? eg, #foo.Myrec{:a 1}
12:27si14_tomjack: https://github.com/clojure/core.logic/wiki/CLP%28Prob%29
12:27si14_tomjack: you can find a lot on the topic there
12:28tomjackcool, hadn't seen ProbClojureNice
12:28clojurebotexcusez-moi
12:29Anderkentjweiss: I think you'd have to change *print-pprint-dispatch*
12:33dnolensi14_: I was confused by what you meant by "random"
12:33si14_dnolen: why it's so slow https://gist.github.com/si14/f09a6caeb2355cd2e727 ? Am I doing something wrong?
12:34jweissAnderkent: what would i change it to? seems like it needs an entry for every record type
12:34Anderkentjweiss: 1 sec
12:35dnolenno idea why it's slow and I don't have time to dig into it at the moment
12:35dnolensi14_: you could fire up YourKit and tell me thought ;)
12:35dnolens/thought/though
12:36Anderkentjweiss: https://www.refheap.com/15181
12:36Anderkenta little hacky ;>
12:36jweissAnderkent: I'll take it, thanks@
12:36jweisser, thanks!
12:36si14_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:37dnolensi14_: I don't really know what the point of that example is. Or why you think that should be fast
12:37AnderkentNo problem, gotta fight for them imaginary irc points
12:37dnolensi14_: I only really care to benchmark real CLP(FD) problems
12:37si14_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:40si14_*this
12:56dnolensi14_: ok I took a moment to further isolate the issue, there is something weird going on
12:58dnolensi14_: ok, ticket already exists for this http://dev.clojure.org/jira/browse/LOGIC-137?focusedCommentId=31190#comment-31190
12:58dnolensi14_: tho this clarifies the issue
13:01dnolensi14_: thanks for the report.
13:24dobry-denIs 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:24si14_dnolen: thanks for considering it.
13:25dnolensi14_: 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:26dnolenthis is pretty cool http://github.com/frenchy64/core.typed-example/blob/master/src/fire/simulate.clj
13:30bbloomdobry-den: can't you just (condp #(.startsWith %2 %1) … )
13:31bbloomdobry-den: or just use re-find ##(condp re-find "yzw" #"^x" :x #"^y" :y)
13:31lazybot⇒ :y
13:32dobry-denbbloom: Yes. Kill me and put me out of my misery
13:32dobry-denI tried that and didn't read the error message. (it broke on my :else test (keyword))
13:33dobry-denwhich was a relic from my case statement
13:36onlynickleftIs 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:36onlynickleftThe 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:36onlynickleftAnd that seems terrible, just terrible.
13:37weavejesteronlynickleft: What are you using the flash for?
13:38onlynickleftSo that I can put success/failure/general-info messages into the next redirect, which might be redirected to any page on the site.
13:38onlynickleftAlso, thanks for all your contributions weavejester, you make my job so much easier. I ought to be paying you at this point.
13:39weavejesterYou're welcome :)
13:40technomancyhugod: did you see this? https://github.com/technomancy/nrepl-discover
13:40onlynickleftAlso, 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:40weavejesterOne 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:41tomjackyes :)
13:41onlynickleftOh, so you've been running into the same question for the same reason? Hmm good to know I'm not crazy.
13:41tomjackif you can't save it it ain't data
13:42weavejesteronlynickleft: 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:42onlynickleftRight 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:42technomancyclucy.core is kinda silly
13:42technomancyclucy.index would make a lot more sense
13:43weavejestertechnomancy: Yeah
13:43onlynicklefttechnomancy: 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:43weavejesterIf it makes sense, then blah.client or blah.index or blah.whatever ot preferable over blah.core
13:43technomancyonlynickleft: there's only one namespace
13:43onlynickleftHeck maybe it should just be "compojure.README"
13:43onlynicklefttechnomancy: Oh. Touche.
13:44weavejesteronlynickleft: I don't like having a dynamic *request*, as it gives too much information to the functions using it.
13:44onlynickleftweavejester: Oh good once again I don't feel so crazy.
13:44weavejesterI'm of the opinion that information to functions should be passed around on a need-to-know basis.
13:44weavejesterIdeally functions shouldn't have access to data that doesn't affect them.
13:45onlynickleftThat's been my philosophy for a few years now, it makes it easy to see where dependencies are wrongly or unnecessarily passed around.
13:45onlynickleftAnd now that I'm using Clojure instead of Ruby, the benefits of this philosophy are being realized much more quickly.
13:46onlynickleftBut I also don't like binding global vars, although in this case binding *flash* might make sense as a middleware.
13:47weavejesterWell, if you're going to use dynamic vars, restrict it down to what you need. So perhaps *messages* instead
13:47weavejesterYou could also have some middleware to inject the message into the HTML, or use AJAX
13:47onlynickleftWell isn't that the only use-case of wrap-flash?
13:47weavejesterMaybe...
13:47seangroveweavejester: Could be used with prismatic's plumbing to make it explicit
13:48arohnercemerick: (cemerick.url/url "http://foo.com/?label=&quot;). I think that's valid, because Google tried to visit my site w/ it
13:48arohnerthrows for me. interested in a patch?
13:48weavejesterHowever, if you have a choice, I prefer saving all data
13:48weavejesterThen a flash becomes unnecessary
13:49weavejesterI tend to have the user ID in the session, and that's it.
13:49amalloyarohner: fwiw, http://foo.com/?label is valid too (as far as the rfc is concerned)
13:50arohneramalloy: thanks. I'll add a case :-)
13:50onlynickleftweavejester: Has that been leading to any regrettable complexity in your apps?
13:50amalloythat is, the name=value pairs in query-params are a convention, and not a standardized part of the spec
13:50weavejestertomjack: I think I agree with the idea that if you can't save it, it's not data :)
13:51arohnerweavejester: ooh, I like that. I've been on a "everything should be serializable" kick recently
13:51arohnerincluding fns and closures and refs and ...
13:52weavejesteronlynickleft: 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:52weavejesterBut there are a lot of benefits to having a concept of time in your DB
13:53weavejesterarohner: that quote's attributable to tomjack :)
13:55hiredmanI 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:56hiredmanhttps://gist.github.com/hiredman/5686648 I guess I have the build, I wonder if there is general interest in such a thing?
13:56amalloyhiredman: 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:57hiredmanamalloy: I would only turn it on when compiling a single function
13:57hiredmane.g. at the repl
13:57amalloyyeah, now that i've seen your gist i see the intent
14:00ambrosebsA 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:02onlynickleftWhat unit testing framework do you guys prefer?
14:02llasramclojure.test
14:02technomancyonlynickleft: clojure.test for sure
14:02onlynickleftOver Midje?
14:03technomancyoh yeah
14:03onlynickleftHmm, I've had the impression that clojure.test is "too simple" or doesn't give good enough feedback or something.
14:03tomjackarohner: 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:03llasramI've use midje some because cascalog-midge, but it's way way too magical.
14:0464MAADO0WI've had only bad (more like horrible) experiences with Midje. At least with clojure.test you always know what's going on.
14:04llasramPlus 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:04technomancyonlynickleft: there's lots of tooling around clojure.test if you don't like out-of-the-box behaviour; see lein-difftest
14:04arohnerI have blog post coming out next week, about how I rewrote our 15k LoC test suite from midje to clojure.test
14:04tomjackI had only thought about 'serializing' dynamic 'values' so far, not dynamic code..
14:04onlynicklefttechnomancy: Sounds like a very composable, Clojure-esque idea.
14:04llasramarohner: I'm interested in reading that
14:05arohnertechnomancy: oh, that reminds me. I'm interested in being able to write macros around deftest, but they break clojure-test-mode
14:06arohneri.e. I'd like (test "this is a test") -> (deftest this-is-a-test)
14:06technomancyarohner: literally attempting to destroy clojure-test-mode as we speak
14:06arohnercool :-) what's your approach?
14:06hiredmanhe is filing dmca take down notices
14:06technomancymwahahaha
14:06technomancyarohner: https://github.com/technomancy/nrepl-discover
14:06technomancyarohner: basically teach nrepl.el how to interpret responses which include overlays
14:07technomancyso you can move all logic server-side
14:07arohnercool
14:08onlynickleftllasram: I prefer a test auto-runner rather than working in the repl with tests.
14:08onlynickleft(Even though nrepl.el is awesome, but I only use that for debugging and live-experimenting.)
14:09technomancyonlynickleft: it's easy to set up an auto-runner with nrepl.el and emacs after-save-hooks
14:10papachan,3.0 * 0.333
14:10clojurebot3.0
14:11llasramIt 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:11technomancyllasram: you still have to start a fresh process if you want a fresh state
14:12llasramFresh state yes, but not just development state vs test state
14:12technomancyyeah, it'll save you from some goofs, but not enough to remove the need for a fresh run
14:12llasramI'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:14cemerickarohner: sure
14:14onlynicklefttechnomancy: 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:14technomancyonlynickleft: dunno; I'm sure all respectable editors have equivalents to save hooks
14:15technomancywatching the filesystem seems like a hack
14:15technomancyyou already have all the data you need
14:15arohnercemerick: good timing. sent :-)
14:16onlynickleftI suppose, although it seems non-trivial to re-run all tests that require the current file (even indirectly).
14:16cemerickarohner: lol @ (-> ... (->> ...)) :-)
14:16technomancyonlynickleft: yeah, that's the hard part. I'm not aware of any good solutions in that space.
14:17arohneryou seemed down with the arrows
14:17arohneryou used -?>> in that fn
14:17arohner:-)
14:17cemerickarohner: yeah, wasn't criticizing, just funny
14:18onlynicklefttechnomancy: Midje and Speclj seem to have auto-runners that calculate this for you.
14:18onlynickleftI don't know how they work, and I'm sure it's probably hackish, but they seem to work pretty reliably.
14:19tbaldridgeI've used them both. Midje's worked better for me than Speclj's
14:19tbaldridgeYou still run into the common reload problems with multi-methods and sometimes protocols.
14:19technomancyand it's silly to tie that kind of thing to a test library to begin with
14:19technomancythey're two orthogonal features
14:20tbaldridgethat is, changing a protocol or a multimethod dispatch doesn't always get refreshed when the tests re-run
14:20technomancytbaldridge: that's a flaw inherent in clojure though
14:20tbaldridgetechnomancy: agreed
14:23onlynickleftWhen 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:23arohneronlynickleft: 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:23Rhymordepends on whether you're writing a unit test or an integration test
14:23onlynickleft(I suppose this question applies to non-web-apps too)
14:24onlynickleftRhymor: I've given up on trying to make tests fit a category these days.
14:24technomancyonlynickleft: the idea that you can replace the DB without affecting behaviour is a myth
14:24technomancyunless your DB usage is trivial
14:24technomancyin which case it's probably not slow enough to bother replacing
14:25tbaldridgeor datomic, in-memory vs file backend
14:25Rhymoronlynickleft: then this presentation is for you: http://www.infoq.com/presentations/integration-tests-scam
14:25onlynicklefttechnomancy: I've had pretty good success with using Hyperion, and using an in-memory backend during tests.
14:25onlynickleftBut the problem with Hyperion is that it's super-trivial and probably very inefficient.
14:25onlynickleftI mean the API is super-trivial.
14:25tbaldridgeonlynickleft: so what technomancy said :-P
14:26onlynickleftHmm, maybe.
14:26onlynickleftI have bad memories of ActiveRecord making my Rails test suites slow though.
14:26onlynickleftMakes me afraid of that approach.
14:26technomancyslow is much better than inaccurate
14:27technomancybut anyway, test your functional code separately from your side-effecting code
14:27technomancylike arohner said
14:27onlynickleftOkay, the more I'm talking to you guys, the sadder I am about the project I've inherited.
14:28onlynickleft(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:28onlynickleftOh! I remember a question I've been meaning to ask for months.
14:28onlynickleftHow do you guys test the output of your hiccup-calling ring/compojure handlers?
14:29arohneronlynickleft: what do you want to verify?
14:29onlynickleftRight now I basically do "should-receive"-style tests on the hiccup function itself, but I hate should-receive-style tests.
14:29onlynickleftI want to make sure the view function got passed the right arguments.
14:30arohneryou could regex the output for a few keywords
14:31arohnerI tend not to test those kinds of things
14:31arohnerI like testing logic and things that cause the app to throw
14:31onlynickleftHmm, regex seems easiest and probably reliable enough.
14:32onlynickleftarohner: 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:33arohnersure. I don't know what's important to your app
14:33onlynickleftHmm I like the regex idea a lot more than parsing HTML which was my plan.
14:34onlynickleftAlthough I bet with enlive, I could get pretty specific about stuff.
14:34nDuff...
14:35nDuffonlynickleft: If you need any kind of remotely useful context filtering, a regex is the wrong approach.
14:35onlynickleftI'm not smart enough to understand what you just said.
14:35onlynickleftCan you dumb it down for me?
14:36arohnernDuff: sure. but if you just need to see that "Foo" appears on the page, then a regex is fine
14:36onlynickleftThat's basically it, yeah.
14:36arohnerif you need to know that it's in the div enclosed in the p, then yes you need something smarter
14:36onlynickleftOh no, those kinda tests make redesigning really painful.
14:38nDuffarohner: "appears on the page" and "appears in the page source" are _completely_ different things.
14:38arohnernDuff: I'm aware
14:38SlabberMouthhi everybody
14:38onlynickleftAh I see your point nDuff.
14:38nDuff...then I'm not very sure about the practice of giving advice that conflates them.
14:39onlynickleftnDuff: there's no way to be absolutely sure it appears visibly on the page without loading it up.
14:39onlynickleftI just need to make sure that it appears in the source.
14:39nDuffonlynickleft: ...and there are very good libraries/frameworkes for "loading it up" in a headless web server
14:39onlynickleftLike if I pass (take 3 widgets) to my view, the :name of each widget is somewhere on the page.
14:39nDuffand querying what does/doesn't get rendered.
14:39onlynickleft*in the source
14:40onlynickleftI bet if whytheluckystiff finishes coming back, he'll be a Clojure guy this time.
14:40nDuffonlynickleft: ...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:40nathanielkI'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:41SlabberMouthI 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:41onlynickleftSometimes I hate HTML and the evolution path browsers have taken.
14:41ToxicFrog|W`rknOnly sometimes?
14:41arohnernDuff: 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:41onlynickleftYeah. The rest of the time I'm playing with my kids or something.
14:42onlynickleftYou know what they say: Out of mind, out of existence.
14:42tbaldridgedown with the browsers! Long live Swing!
14:42tbaldridge:-P
14:42onlynickleftMan. Everything about what we've done with computers really upsets me when I think about it.
14:42onlynickleftThe 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:46matthoffmancemerick: (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:46clojure-newhello.
14:46matthoffmanI 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:49clojure-newcan 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:49RaynesClabango maybe?
14:49RaynesThere is also laser, enlive, mustache, etc.
14:49Rayneslaserlaserlaserlaserlaser
14:50Raynescallen is a big fan of clabango.
14:50clojure-newRaynes: Don't like clabango, {{}} will conflict.
14:52amalloynathanielk: the function is probably causing an exception
14:52amalloyyou're not seeing a stacktrace because exceptions on a separate thread can't interrupt the current one
14:52amalloyyou can test this by replacing (future ...) with @(future ...) temporarily
14:53onlynickleftAnyone: When you write web apps, what else do you use besides ring, lein-ring, compojure, hiccup, and clojure.test?
14:53clojure-newhttps://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:53technomancyonlynickleft: the source for https://syme.herokuapp.com is pretty readable
14:53onlynickleftclojure-new: I was eyeballing Stencil the other day. Not sure if it's alive still.
14:54justin_smithhow 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:54justin_smitheven when redeffing to a constantly expression that can handle any arg count
14:55justin_smith,(with-redefs [+ (constantly true)] (+ 1))
14:55clojurebottrue
14:55justin_smith,(with-redefs [+ (constantly true)] (+ 1 1))
14:55clojurebot2
14:56onlynickleftheh, .symerc sounds like cemerick
14:59onlynickleftWhen 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:59onlynickleft(You = anyone)
15:01decaf(do (map (partial contains? words) words) nil) ...words is a set with 55000 members. criterium says this expression ran in 50 nanoseconds.
15:01onlynicklefttechnomancy: aww, no tests, plus it's not using korma which looked pretty neat
15:01justin_smithdecaf: mapv
15:01justin_smithmap is lazy
15:01justin_smithif you don't use it, no action is performed
15:02decafok it's 58 milliseconds, still too good to be true :)
15:02technomancyonlynickleft: I have had bad experiences with korma
15:02onlynickleftInflexibility?
15:02onlynickleftMagic?
15:02clojurebotmagic bullet is http://www.infomercialcentral.com/store/files/images/d_77.jpg
15:03bbloomonlynickleft: what's wrong with an options map as an argument? (update-in options [:stylesheets] conj "styles.css")
15:03justin_smithdecaf: hmm, I thought mapv would force the evaluation
15:03justin_smiththere is also (doall (map ...))
15:03onlynickleftbbloom: seems weird to pass nil or {} when you needn't specify anything.
15:03chronnotechnomancy: Is there something bad with korma?
15:04tbaldridgejustin_smith: doall holds the head, in this case he may want dorun
15:04onlynickleftWhat tool do you humans use to figure out what part of some code is so slow and why?
15:04justin_smithtbaldridge: wouldn't mapv force it though? I thought it would, not being lazy and all
15:04dnolenonlynickleft: criterium is OK for high level stuff, for serious profiling YourKit
15:06onlynickleftOh btw I found out this cool trick: ((juxt get dissoc) m k)
15:06onlynickleftIt gets you a value in a map and returns it without said val.
15:07dnolenonlynickleft: juxt is generally awesome
15:07justin_smithnice, like pop for maps
15:07onlynickleftRather Hash#delete
15:07onlynickleftdnolen: yeah, I've been using juxt with for and into {}
15:07onlynickleftI mean map.
15:08onlynickleftI really mean for.
15:09onlynickleftOkay 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:10onlynickleftThanks guys for paving the way for newbs like me :)
15:12onlynickleftHave any of you ever integrated with Stripe or Braintree and tried converting users away from PayPal?
15:15arohneronlynickleft: I'm using Stripe, haven't tried converting users away
15:16onlynickleftOh.
15:16onlynickleftNever mind, that's too off-topic.
15:23onlynickleftOkay bye, disappearing forever again.
15:26ghengis,(+ '1 '2)
15:26clojurebot3
15:26ghengis,('+ '1 '2)
15:26clojurebot2
15:26ghengiswhy did the second one return the last parameter?
15:27ghengisis that just what a symbol does when used as a fn?
15:27bbloomghengis: because symbols are functions
15:27pjstadigwhen 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:27pjstadigit will use the second arg as the default value
15:27bbloom,('+ {'+ :plus '- :minus} :not-found)
15:27clojurebot:plus
15:28bbloom,('* {'+ :plus '- :minus} :not-found)
15:28clojurebot:not-found
15:28ghengisah! interesting
15:28technomancytl;dr: clojure doesn't do a lot of sanity checking on its inputs
15:28technomancygarbage in, garbage out basically
15:29ghengisbasically, works just like a keyword when used as a function
15:36cemerickarohner: 0.0.8 now in clojars
15:46mattmossI hate GIGO when my brain is full of it.
15:48llasramHuh. Java won't let you have a package and a class with the same name?
15:49llasramI guess the JVM doesn't care, but why does Java?
15:50callenllasram: save people from themselves.
15:51llasramI'm just not even sure where it could cause a problem
16:09arohnercemerick: thanks
16:10dobry-denjvisualvm 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:14lynaghk`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:15hiredmanlynaghk`: for clojurescript?
16:15lynaghk`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:15lynaghk`hiredman: nah, this is JVM clojure with real threads.
16:15hiredmanhave you considered a java.util.concurrent queue?
16:16hiredmanj.u.c.LinkedBlockingQueue is my go to queue
16:16lynaghk`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:16arohnerlynaghk`: I've used clojure.lang.queue with refs
16:16lynaghk`the use case is building a dependency graph in topological order where the graph structure can change during the build process
16:17arohnerso then (defn dequeue [ref-queue] (dosync (let [head (first @ref-queue)] (alter @ref-queue pop) head))
16:18lynaghk`arohner: yeah, I was thinking that maybe it's finally time for me to use dosync = )
16:18arohneryou can also use compare-and-set, but it's ugly
16:24mabeslynaghk`: 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:25lynaghk`mabes: yeah, I think that has the same problems as the priority queue in that it assumes the comparator is fixed
16:26mabeslynaghk`: 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:27gtrak_changing comparator... why not a stateful comparator?
16:27gtrak_dosync to the rescue
16:27lynaghk`gtrak_: yeah, I think I will have to use dosync.
16:28lynaghk`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:57onlynickleftAre there really no auto-runners for clojure.test?
16:59bbloomonlynickleft: 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:59fscker`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:00onlynickleftOh I see.
17:00onlynickleftbbloom: Do you know of a good tutorial on such a workflow that gets pretty close to having an auto-runner?
17:01onlynickleftI remember technomancy's idea about after-save-hook but I'm hoping there's a more automated and less ad-hoc technique.
17:02fscker`The problem is ant btw - building fails every single time (seriously why ant??)
17:02seancorfieldonlynickleft: 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:02seancorfieldI think C-c , works for clojure.test too if you have that mode package installed?
17:03seancorfield(not much help if you don't use Emacs of course but...)
17:03onlynickleftI used to be a pretty outspoken vim user, ranting about every other text editor someone would show me.
17:03onlynickleftThen I saw someone use emacs, and saw that he was way faster at coding than anyone I ever met, including me.
17:04onlynickleftSo yeah I use emacs, going on 9 months now I think.
17:04nDuffonlynickleft: 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:05mattywztellman, any idea if I can use aleph to connect to a secure websocket? When I try it appears that wait-for-result hangs
17:05onlynickleftnDuff: Oh. I don't use other languages anymore so I don't know.
17:05onlynickleft:)
17:05ztellmanmattyw: what url are you using?
17:05ztellmanis the protocols https?
17:05mattywztellman, wss
17:06ztellmanmattyw: I don't handle that protocol correctly, try https and see if that changes anything
17:08mattywztellman, thanks, I'll try
17:12mattywztellman, I get this http://paste.ubuntu.com/5721100. Could it be something odd with the server?
17:12onlynickleftOkay I'm sold on clojure.test + lein-difftest
17:12mattywztellman, or that I'm using sun java?
17:13ztellmanmattyw: yikes, I'm not sure
17:14ztellmanI just set up the SSL stuff and trust that it will all work
17:15bbloom,(clojure.walk/macroexpand-all '(fn [] '(fn [])))
17:15clojurebot#<ClassNotFoundException java.lang.ClassNotFoundException: clojure.walk>
17:15bbloom&(clojure.walk/macroexpand-all '(fn [] '(fn [])))
17:15lazybot⇒ (fn* ([] (quote (fn* ([])))))
17:15bbloomi'm sure people are aware, but that's not the correct macro expansion :-P
17:16dakronemattyw: shot in the dark, but do you have the store trust stores installed for your JDK?
17:16dakrone*strong trust stores
17:16ztellmanmattyw: you can try setting :ignore-ssl-certs? to true in the options
17:17mattywdakrone, no idea - I'll check
17:17mattywztellman, I'll give it a shot
17:17ztellmana 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:18dakronemattyw: http://www.oracle.com/technetwork/java/javase/downloads/jce-6-download-429243.html if you need them
17:18mattywztellman, 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:19onlynickleftWhy 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:19technomancyit's not clean
17:19technomancyit's very macro-heavy
17:19clojurebotNo entiendo
17:20arohnerit's implementation is gigantic and hard to understand
17:20technomancyside-effects at the top level
17:20arohnerit's buggy
17:20onlynickleftGood enough for me.
17:20technomancyrandom non-lispy syntax like =>
17:20arohneryou can't compile the tests separately from running them
17:21arohnerso 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:21onlynickleftWhat about speclj?
17:22amalloyarohner: 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:22onlynickleftIs http://richhickey.github.io/clojure/clojure.test-api.html still current?
17:22bbloomonlynickleft: 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:22arohneroh, the test fixtures aren't composable
17:22Raynesmucker: I have acquired a guitar.
17:22technomancyonlynickleft: speclj just doesn't seem compelling
17:22bbloomonlynickleft: nothing on rich's github account is current
17:22technomancynone of the things it offers are things that look useful
17:23gtrak_clojure.test harnesses are fine as long as you don't try to use them
17:23seancorfieldhttp://clojure.github.io/clojure/clojure.test-api.html
17:23gtrak_fixtures, rather
17:23arohnergtrak_: I've monkeypatched mine to be useful
17:23arohnerI'm considering OSSing that
17:23gtrak_o rly? can I see?
17:23gtrak_ah
17:23technomancyhuh? fixtures are great
17:23gtrak_fixtures means side-effects
17:23pjstadigi've created https://github.com/pjstadig/conjecture with some improvements to fixtures
17:24technomancygtrak_: fixtures can mean side-effects, with-redefs, or conditional runs of tests
17:24arohner@gtrak_ https://gist.github.com/arohner/5688067
17:24amalloytechnomancy: fixtures have some issues: http://dev.clojure.org/jira/browse/CLJ-866
17:24gtrak_I prefer doing side-effects within like a setup-services function or something... with-redefs.. maybe
17:25gtrak_one thing that's terrible about them is they don't handle exceptions like you'd expect
17:25technomancyamalloy: granted. clojure-test-mode ships with a fix for that.
17:25amalloya fix for clojure.test in emacs isn't a fix at all
17:26technomancyamalloy: yeah, I hope conjecture could address that
17:27decafjustin_smith: mapv does walk trough its argument seq as you said. 58 ms benchmark is true. I'm thrilled.
17:27onlynickleftbbl maybe
17:28amalloypjstadig: 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:28gtrak_Raynes: if you like messing with stuff, I really like how mine turned out: http://www.carvinguitars.com/kits/
17:29pjstadigamalloy: https://github.com/pjstadig/conjecture/blob/master/CHANGELOG.org && https://github.com/pjstadig/conjecture/blob/master/doc/Fixtures.org
17:29Wild_Cat`Carvin do kits? Interesting.
17:30pjstadigit'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:30pjstadigalso runs fixtures when you run a single test as a function
17:30Wild_Cat`regardless, their guitars sound fantastic. Three of the best guitarists I know play DC127s and *wow*.
17:31pjstadigamalloy: i've also added a singleton fixture that runs once around the entire test run
17:31gtrak_Wild_Cat`: http://i.imgur.com/ZWUbt.jpg bolt-plus, swamp ash, stainless-steel frets
17:32Wild_Cat`gtrak_: nice -- I don't like burst finishes but that wood looks incredible. How much did it cost you?
17:32Wild_Cat`(aww, they don't do 6-string bass kits :( )
17:32gtrak_like 600 total I think? it's all dye with minwax tung-oil finish on top
17:33Wild_Cat`wow, pretty cheap too.
17:33Wild_Cat`might consider those when I inevitably choose to buy myself a guitar.
17:33gtrak_648
17:34Raynesgtrak_: Meh. I was given a guitar. I wouldn't buy one.
17:34onlynickleftRaynes: accoustic?
17:34Raynesonlynickleft: Yes.
17:34gtrak_I just like messing with gear :-), circuits too
17:35onlynickleftSweet. I just learned Jeff Buckley's Hallelujah on accoustic the other week.
17:35onlynickleftJust found out about that song 2 weeks before that.
17:35onlynickleftAnd Sunday I have a piano recital for the lessons I started in Jan. Programmers are apparently very musical.
17:37Wild_Cat`onlynickleft: there's lots of maths in music. Maybe that's that.
17:37onlynickleftPatterns, not maths.
17:37onlynickleftMaybe both, God knows.
17:37Wild_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:38onlynickleftDoes clojure.test require putting your tests in a special namespace, or do you just put them anywhere and do 'lein test'?
17:38onlynickleftWild_Cat`: nope, not it, not it at all.
17:40onlynickleftOh awesome, it just runs my tests, it doesn't care where I put them.
17:40onlynickleftOh wait yeah it does.
17:41bbloomthere was an overtone video that was extremely mathematical
17:41bbloomsuper cool stuff
17:42nopromptit would be so nice if clojars had a json api.
17:42bbloomonlynickleft: Wild_Cat`: here it is http://www.youtube.com/watch?v=Mfsnlbd-4xQ
17:42bbloom^^ that talk is freaking awesome
17:43onlynickleftOh that reminds me, why isn't clojure-docs.org updated for 1.5.1 etc. anymore?
17:43gtrak_Wild_Cat`: here's the raw wood: http://i.imgur.com/S8uz2D5.jpg
17:43Wild_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:43gtrak_and back: http://i.imgur.com/glDG06S.jpg
17:43Wild_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:44Morgawrwhat's the easiest way to update all the values in a hashmap without touching the keys? The one that has the best performance
17:44nopromptRaynes: i'm thinking i'd like to make a tiny patch to one of the fn's in the fs lib.
17:44Raynesnoprompt: Okay.
17:44gtrak_Wild_Cat`: ya, I thought about raw, but I wanted to experiment with dyes
17:44callenRaynes: hey! What happened with Linode?
17:44dnolenMorgawr: what does that mean?
17:44Raynescallen: They had some hardware failures.
17:45Raynescallen: We're all good.
17:45nopromptRaynes: it would be nice if fs/find-files used re-find instead of re-match
17:45Wild_Cat`gtrak_: what can I say, I'm a sucker for natural finishes :D
17:45nopromptre-match seems just a tad to strict imho
17:45Morgawrdnolen: 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:45nDuffbbloom: 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:45MorgawrI 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:45callenRaynes: great. And it was great hanging out with you in LA. Was in too much pain to enjoy the concert though.
17:45onlynickleftIs there an alternative to deftest, specifically so I can use a string to define what the test is rather than a literal symbol?
17:46amalloynoprompt: 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:46Raynescallen: Yeah, I didn't quite hear you when you gave me the reason for leaving. Was it leg agony?
17:46pjstadigonlynickleft: there are testing forms inside of a deftest, but nothing like that for deftest
17:46Raynescallen: I couldn't feel my feet by time the concert was over, but it was totally worth it.
17:46callenRaynes: feet and back. I have flat feet in the extreme.
17:47callenI can handle running but standing in place on a hard floor makes me want to suck bleach.
17:47nopromptamalloy: sure. i hear you. but you end up having to write longer patterns in some cases.
17:47Raynescallen: 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:48nopromptmaybe not even a patch to that function but at least another function which uses a looser matching strategy.
17:49nopromptsuppose 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:49onlynickleftpjstadig: I see, thanks.
17:49onlynickleftDoes anyone have experience with "test-this"? It looks like it provides auto-runner capabilities for vanilla clojure.test
17:49noprompti guess you could sort of think of it like a grep
17:50rasmustoMorgawr: 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:50amalloynoprompt: 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:51callenRaynes: I haven't seen the show, is it any good?
17:51amalloyneither approach is really better; the change is what's expensive
17:51Raynescallen: Never seen it either, but it's a private Imagine Dragons concert so…
17:51Raynes:p
17:51amalloynot that Raynes cares what i think, but i'd recommend a function that accepts a lambda for filtering, rather than a regex
17:51nopromptright, so i guess really what i'm suggesting is separate function
17:51Morgawrrasmusto: thanks for that, maybe calling zipmap after getting a list of updated values and the old keys has better performance?
17:52Morgawralso, I'm using clojurescript, not sure if that helps or not as far as performance goes
17:52Raynesamalloy: There is a 95.3% chance that I never even wrote that code so what you think is right probably is.
17:52amalloythen you can write your lambda that uses re-find, someone else can write a lambda that just does #(.startsWith % "foo")
17:52dnolenMorgawr: I don't know about fastest, but zipmap solution is pretty clean
17:52dnolen(zipmap (keys m) (map inc (vals m)))
17:52arohnertechnomancy: are test selectors documented anywhere, aside from `lein help test`?
17:52Morgawrdnolen: yeah that's what I thought of at first
17:53onlynicklefttechnomancy: do you know of a way to get difftest to print the actual/expected using pprint?
17:53onlynickleftSometimes these hashes are pretty involved.
17:53onlynickleft*maps whatever
17:53callenMorgawr: why do you need fastest?
17:53dnolenMorgawr: and it looks like zipmap could be a lot faster in CLJS, could use transients
17:53technomancyarohner: not that I know of. I would like to move it out of Leiningen; that functionality clearly doesn't belong there
17:53nopromptwell it was just a minor annoyance imho. i've got a copy of the version i like so i'll use that.
17:53gtrak_into uses transients
17:53Morgawrcallen: 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:53nopromptpersonally i prefer regexes that are permissive with the option to be strict rather than the other way around.
17:53technomancyonlynickleft: I don't think so
17:54callenMorgawr: godspeed.
17:54nopromptbut i'd love to know what the tradeoffs are of using re-find over re-match
17:54MorgawrI 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:54Morgawrthanks for the help
17:54noprompt*in general
17:54onlynickleftPull request time.
17:55callenMorgawr: 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:55Morgawrcallen: a "struct"?
17:56amalloycallen: as ridiculous as using immutable data structures? or as ridiculous as using clojure instead of C? where is it on the ridiculous scale?
17:56arohnertechnomancy: 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:56nopromptamalloy: i actually like the lambda idea a lot though.
17:56callenamalloy: I was speaking about performance intensive games.
17:56dnolenMorgawr: deftype or defrecord
17:56amalloycallen: so was i
17:56technomancyarohner: the only reason lein has test selectors is that clojure.test has had a total of one patch applied since 2010 =\
17:56amalloywhy 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:56gtrak_(inc amalloy)
17:56lazybot⇒ 60
17:56callenamalloy: and yes, if you're in a genuinely performance intensive game use-case, C++ is ideal.
17:57nopromptamalloy: honestly that'd make that function a hell of a lot more powerful.
17:57Morgawrdnolen: 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:57amalloynoprompt: lambdas are always the answer
17:57nopromptamalloy: i am finding this to be the case.
17:57noprompt:)
17:57dnolenamalloy: what do you mean "becoming hashmaps in the end" ?
17:57amalloydnolen: i probably meant whatever Morgawr meant when he said it
17:57dnolenamalloy: oops sorry
17:58dnolenMorgawr: ^
17:58nopromptamalloy: so do you think it would be worth then to add another fn to the lib for doing this?
17:58Morgawrdnolen: aren't records just more powerful maps in the end? I mean, they are collections of keys and values
17:58Morgawror am I missing something?
17:58dnolenMorgawr: not true
17:59amalloynoprompt: 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:59amalloybut i would not accept a pull request adding just another flavor of regex
17:59nopromptRaynes: what say you?
17:59callenis there some reason people need to challenge me when I state the obvious?
17:59nopromptamalloy: agreed. this is the whole reason i wanted to bring this up. for the discussion.
17:59dnolenMorgawr: deftype is very low level built on host types - access time / update times will always out perform maps
17:59RaynesWhy amalloy thinks I autodisagree with him eludes me, but of course, this is a great idea and I would take that pull request.
17:59callenyou 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:00amalloyRaynes: i said no such thing!
18:00noprompt"autodisagree"
18:00noprompt:)
18:00nopromptlol
18:00amalloyi'm disagreeing *now*
18:00Raynesamalloy: 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:00Morgawrdnolen: 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:00technomancywhat's a serious game? does that just mean it's not fun?
18:00technomancyyou can play this game, but you're not allowed to smile.
18:00noprompt(with disagree (respond-to :Raynes))
18:01Morgawralso 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:01amalloythat'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:01callentechnomancy: meaning it has to be competitive with the current state of audio/visual content.
18:01nopromptok 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:01nopromptstill at work.
18:01technomancyboooooring
18:01gtrak_callen: real tradeoffs are more interesting than FUD, is my opinion
18:01dnolenMorgawr: it depends on how you interact with them, but the performance in general will be better than maps
18:01Raynesamalloy: Your opinion is important! If you decide what to do in fs then I don't have to.
18:02callentechnomancy: I'm a huge fan of small focused indie games, but even still, the limitations remain.
18:02Morgawrdnolen: yes but performance aside, the interface would be the same so I could always swap a map with a type without having problems?
18:02amalloytechnomancy: i recently re-finished mega man x. good game
18:02Raynesnoprompt: We're so busy that we're sitting 6 feet from each other arguing on IRC about implied meanings of sentences.
18:02callentechnomancy: I beat Ninja Gaiden for the NES a few months back. proud moment. :P
18:02Morgawror maybe I'm missing something
18:02dnolenMorgawr: not a deftype, but you can use defrecord where you would use maps for the most part yes
18:02technomancyamalloy: yesss
18:02nopromptamalloy: two summer's ago i went on the ultimate megaman challeng.
18:03callengtrak_: no FUD here, just facts.
18:03technomancyamalloy: I hope you listened to the Protomen afterwards
18:03Morgawrwell ok, anyhow, I guess I will go with zipmap and if necessary implement a native function in Javascript, thanks for the help :)
18:03noprompti beat megaman 1-6 on nes and X and X2 on snes.
18:03callentechnomancy: have you tried Ninja Gaiden (NES) music? It's quite good.
18:03amalloyno, but i bet i could download that album in time for my flight
18:03nopromptmegaman 1 is like the hardest fucking game ever made next to festers quest.
18:03callen^^ disagree.
18:03technomancycallen: I'll check it out
18:03callennoprompt: Ninja Gaiden and Castlevania are harder.
18:04nopromptwhich Castlevania?
18:04technomancyooh nice; deus ex ocremix album
18:04nopromptcause i can kick the shit out of simon's quest.
18:04callennoprompt: first and third are both brutal. simon's quest was kinda derpy.
18:04gtrak_facts need to be more precise
18:04nopromptthe other ones are kinda tough, and yeah, ninja gaide is hardcore too.
18:04callennoprompt: I'm surprised you slogged through it.
18:05nopromptcallen: yeah but simon's quest has the coolest music. :)
18:05callenbeating 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:05callenyou have to learn to play NG like playing an instrument
18:05noprompthaha, yeah. gone are the days of "games of skill".
18:06nopromptlifeforce is another pretty damn hard game. that and gradius.
18:06pjstadiga 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:06arohnernoprompt: have you tried Demon's Souls?
18:06arohnernew game on xbox & ps3. very skill based, very hard
18:06nopromptarohner: i don't think so. is it nes?
18:06callengtrak_: 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:07gtrak_this, I agree with :-)
18:07callengtrak_: to say otherwise suggests delusions of grandeur
18:07pjstadigpdf version http://www.st.cs.uni-saarland.de/edu/seminare/2005/advanced-fp/docs/sweeny.pdf
18:07callento 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:07gtrak_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:08nopromptsuper metroid was my all time favorite growing up.
18:08callenyou say specific costs as if using clojure doesn't wall-off entire universes of possibilities in the world of game design.
18:08nopromptamalloy: play that one if you haven't already.
18:08gtrak_it makes them impractical.. yea, that's the difference
18:09callenthe 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:09callenand there are other problems with that.
18:09callenRust might work though, whenever it's ready to be used by somebody other than walton and klabnik.
18:10MorgawrClojure 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:10nopromptrust syntax is a soup.
18:11nopromptit looks like a little bit of everything.
18:11technomancyright; minecraft is only for kids
18:11rasmustotechnomancy: because it has cartoony graphics, and kids love cartoons
18:11callentechnomancy: java as opposed to clojure helped with that a great deal, and it still runs like ass.
18:12callenif 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:12Morgawrit's not really "sitting on top", it's "running in"
18:12Morgawrthere's a bit of a difference in that
18:12Morgawrit's not like Clojure is compiled to Java that is compiled to bytecode
18:13callenMorgawr: thank you for reminding me why I shouldn't bother continuing this conversation
18:13amalloytechnomancy: you can't get anywhere as a developer witout http://www.logicalfallacies.info/relevance/appeals/
18:13callenMorgawr: in future though, don't bother with the pedantry when I'm typing quickly.
18:13gtrak_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:13callenamalloy: okay, fine, put together a game engine in Clojure that performs similarly to a AAA game with the same graphical results.
18:13amalloyno, thanks
18:14callengtrak_: that latter bit is kinda critical for modern game development. you don't want to be baking up your own physics library. Seriously.
18:14gtrak_I get that.. but I'm saying it's worthwhile to be more specific with the criticisms
18:14callengtrak_: 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:14Morgawrit's not like people in here are ignorant of the tradeoff performance when running Clojure(Script)
18:14callenI was specific earlier.
18:14callenI explained what specific language design choices made the type of project not a great idea.
18:15callenI even explained how an alternative language is more'ish viable and why.
18:15Morgawrcallen: what would you use to develop a videogame in a browser?
18:15Morgawrout of curiosity
18:15dnolenMorgawr: 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:15technomancyMorgawr: no, everyone who doesn't put performance above maintainability is a kid or an amateur, aren't you paying attention?
18:15callentechnomancy: stop. come on. don't strawman what I'm saying.
18:15Morgawrdnolen: yeah, I love Clojure because of this reason
18:15callentechnomancy: it's obnoxious and below you.
18:16callentalking 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:16callenor merely mentioning a weak point to it, for that matter
18:16dnolenMorgawr: 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:16technomancycallen: weren't you in here earlier when I was telling Licenser not to teach his brother clojure?
18:16callentechnomancy: no
18:16Pupnikcallen, no-one is going to write physics libs in clojure, they will use the ones from java or js
18:17Licensertechnomancy heh he is still loving it :)
18:17Morgawrdnolen: 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:17technomancyLicenser: no one listens to me!
18:17callenThis whole time I have qualified what I was saying with, "serious, performance intensive games"
18:17Licensertechnomancy :) I'm neutering a new functional programmer!
18:17technomancycallen: I have no problem with what you're saying about clojure; just what you're saying about games
18:17callenWhy are you ignoring that as if I'm saying, "writing tetris in Clojure is impossible"?
18:18callenLicenser: neutering? You mean mentoring?
18:18Pupnikdid anyone come in here saying "im writing the crysis killer"
18:18Pupnikhes using clojurescript, that should be a clue
18:18callenPupnik: they mentioned performance intensive.
18:18callenPupnik: explicitly so.
18:18Licensercallen teehee yea
18:18gtrak_dnolen: I think It's a C++ philosophy clojure inherited, 'pay for what you use'
18:18callenPupnik: 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:18Morgawrcallen: performance intensive within the limits of an html5 browser game
18:18zalzaneif you're supposed to pay for what C++ provides, c++ would be paying you
18:19callenit's a legitimately useful language design decision though.
18:19callenand is partly how C++ is able to be used across very different sorts of projects.
18:19gtrak_zalzane: the JVM's written in C++
18:19gtrak_!
18:19zalzanegtrak_ that doesnt change that c++ is a horrible language
18:20gtrak_it sort of validates horrible languages...
18:20gtrak_I like that I can take advantage of them without being bothered by it, really
18:20callenAye, it is, but games aren't long term maintenance products generally speaking. Things "get done" in bad languages in spite of themselves.
18:20Morgawrso yeah guys, I apologize for sidetracking the channel like this with my question
18:20zalzaneget your act together morgawr
18:20Morgawrcallen: game engines are, though
18:21Morgawryou want to make them modular and re-usable
18:21callenMorgawr: which happens. cf. crytek, Epic, iD.
18:21Morgawrand most games are, ideally, just a scriptable abstraction on top of an engine
18:21MorgawrI think Lisp languages are powerful enough to provide such good abstraction
18:21Morgawrat an obvious performance tradeoff
18:22Morgawrbut 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:22Morgawralso considering ClojureScript provides the possibility of writing native javascript code and natively interfacing with the rest of your code
18:22Morgawrso yeah, I don't see the point of this discussion
18:23gtrak_the point is to identify tradeoffs and make them while knowing what you're getting yourself into
18:24gtrak_at least I hope it is..
18:24LicenserMorgawr 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:25callenwell, maybe. making money is nice. Depends on what sort of project it is.
18:25callenif 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:25Morgawrcallen: take a look at ImpactJS, it's a great javascript library and the developers are making good money out of licenses for that
18:25callenMorgawr: I'm perfectly aware of the JS HTML5 game frameworks.
18:26callenMorgawr: including Impact, Akihabara, and the others.
18:26Licensercallen but having no compfort has a high chance of meanign that you never deliver a product at all
18:26Morgawrin 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:26callenLicenser: if you're not professional, that's right.
18:26callenLicenser: some people just bite down and do their job.
18:26nopromptcallen: what does that even mean?
18:27noprompt"professional" <-- loaded word
18:27callennoprompt: the existence of COBOL contractors.
18:27gtrak_develop TMD
18:27callennoprompt: do you really think any of them love COBOL?
18:27nopromptcallen: well if they're willing to do it for money they must be making some compromise internally.
18:28gtrak_why don' they generate cobol from their clojure code? :-)
18:28technomancyit's interesting to note the etymological connection between "amateur" and "amour"
18:29callenwell, 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:29Licensercallen but it certenly help
18:29gtrak_ah, there's a market for cobol code generators: http://en.wikipedia.org/wiki/CA-Telon
18:29gtrak_how about that
18:30callengtrak_: I used to work on the other end of that, migrating mainframe systems to .NET
18:30noprompti'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:30callengtrak_: generated COBOL invariably made the migration more annoying and difficult.
18:30callennoprompt: a large component of professionalism is putting the product/work output above personal comfort/preference.
18:31LicenserI entirely disagree with that
18:31callenLicenser: okay, but you'd be wrong.
18:31technomancythat's ... too depressing for words?
18:31callenIt doesn't mean wearing the hair shirt, it means taking the actual purpose of your work seriously.
18:31LicenserI entirely disagree with that too
18:31gtrak_callen: no doubt.. just saying even cobol programmers can be unprofessional
18:31callentechnomancy: not for me. I like thinking about how what I do is actually intended to help people and optimize for that.
18:31noprompti turned down a 6K contract job because they wanted me to write the code in PHP.
18:31callengtrak_: what an incredibly irrelevant point to make.
18:32technomancynoprompt: I would refer to that as professional dignity
18:32callennoprompt: I'm wrapping up a horrific PHP contract as we speak.
18:32callennoprompt: very happy to have it ending.
18:32LicenserI'd hire noprompt over callen
18:32callenLicenser: don't express pointless ad hominem sentiments like that.
18:32bbloomLicenser: i'd never hire callen
18:32gtrak_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:33nopromptcallen: 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:33callennoprompt: I just got done saying that I wasn't saying "wear the hair shirt"
18:34callenbbloom: 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:34callenpointlessly*
18:34gtrak_there's also people that hate abstraction in any form
18:34callenthey would be irrational.
18:34Licensercallen 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:34bbloomcallen: i have more than enough information to make that call. you're abrasive, argumentative, and generally unpleasant
18:35callenbbloom: 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:35Morgawrcallen: why are you in this channel? genuine question. Following your reasoning, you'd never use Clojure for anything
18:35callenLicenser: 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:36nopromptcallen: i wasn't attacking you, just sharing my POV.
18:36callenMorgawr: that is clearly not what I was saying.
18:36nopromptFWIW
18:36callenMorgawr: stop strawmanning what I've been saying.
18:36callenMorgawr: where did I say that? I even explicitly laid out an example of the sorts of things Clojure is great for.
18:36Morgawrokay, I apologize for misunderstanding what you said
18:36callenthat's an understatement.
18:36gtrak_I'm picking a battle over a specific trend, reduction in place of facts
18:37bbloomcallen: i'm just a little tired of you derailing productive conversations, confusing newcomers, and fostering a hostile environment
18:37callenbbloom: I've been calmly explaining my point from earlier, the attacks were coming from others.
18:38bbloomcallen: 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:39callenThat'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:40bbloom^^ case in point ^^
18:40callenStating the facts is hostile. Am I understanding you correctly?
18:40gtrak_overblowing is being imprecise
18:41hiredmanbbloom: have you considered /ignore?
18:41Morgawrcallen: 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:41bbloomit 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:41callenMorgawr: 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:42callenclearly I should give up expressing anything that cannot be gift-wrapped in 140 characters in here.
18:42callenAnything else is likely to get lost, twisted, turned against me, etc etc
18:42ztellmancallen: those are both very relative terms
18:42callenztellman: certainly but the implication is that it's a project meant to be comparable with the current state of the gaming industry.
18:42ztellmancallen: I don't agree with that at all
18:42nopromptwow i would have never thought to make a user.clj file, that's so cool.
18:43callenztellman: that implies that there is a higher standard for "fitness for purpose" than a learning project.
18:43ztellman"performance intensive" means "I need to pay attention to the computational cost of things"
18:43amalloyhiredman: 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:43ztellman"game" means something that's fun
18:43callenztellman: the thing is, we probably agree on the implications, but not on the scoping implied by the qualifiers.
18:43mthvedtamalloy: use a trie
18:43nopromptyeah, could we tone this down?
18:44Morgawr^
18:44technomancy(inc mthvedt)
18:44pkmnBluewell, what have we learned?
18:44lazybot⇒ 3
18:44callenpkmnBlue: don't bother saying anything people can disagree with.
18:44bbloomamalloy: mthvedt: both excellent jokes. my apologies for the noise
18:44gtrak_disagree in interesting ways?
18:44callenpkmnBlue: especially if they are feeling defensive about their technology choices.
18:45hiredmanamalloy: mine is 185 entries, and it does pretty well
18:45callenI get that some people can feel embattled because they're trying to introduce clojure at work but that was unmerited and unconstructive.
18:46akhudekmthvedt: cache-oblivious trie would handle all levels of discussion with high performance
18:46amalloyhiredman: 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:47callenamalloy: if you use irssi you can set up permanent ignores in the .irssi/config
18:47callenI wonder what client that is though.
18:47hiredmanamalloy: hmmm, yeah, expiring ignores would be an interesting feature
18:47technomancyyeah, it seems like defaulting to a decaying /ignore would be a neat feature
18:48gtrak_someone was discussing a distributed /ignore in here a few months ago with me
18:48amalloyhiredman: do you still have Raynes on ignore from three years ago?
18:48callengtrak_: Zed Shaw had Utu.
18:48technomancygtrak_: that would take care of Lajla
18:48clojurebotexcusez-moi
18:48callengtrak_: he abandoned it though.
18:48hiredmanyes
18:48gtrak_ah, neat
18:48hiredmanand LauJensen
18:52nopromptcallen: how do i page up in irssi?
18:52technomancyhttps://twitter.com/LiamAbigail1/status/340528414740074496 I don't evn
18:52callennoprompt: pgup works fine for me, I'm in GNU Screen + irssi. That's not working for you?
18:52callennoprompt: oh you must be on a mac, right?
18:52nopromptcallen: yep!
18:52noprompt:|
18:52callennoprompt: http://osxdaily.com/2007/10/29/fix-page-up-key-in-terminalapp-to-work-with-irssi/
18:53callennoprompt: I actually wrote a blog post about fixing some other stuff in irssi
18:53nopromptah thx
18:53callennoprompt: http://bitemyapp.com/post/fixing-arrow-keys-in-iterm-and-terminal-app-for-mac-os-x/
18:53akhudektechnomancy: that's a really really poor random tweet bot
18:53callennoprompt: not having channel left/right work in irssi on OS X was driving me nuts.
18:53noprompttechnomancy: i need to favorite that
18:54callenakhudek: markov chains?
18:54technomancyakhudek: the amazing part is that it seems to mismatch the gender of the pic with the gender of the name with ~90% reliability
18:54akhudekcallen: looks more like uniform bag of words sampling
18:54bbloomtechnomancy: maybe the classifier only has 10% errors, but they swapped their enum values? :-)
18:55technomancybbloom: it's remarkable
18:55nopromptcallen: thanks for this. i used to use erc in emacs but then the company decided to block usage of all "non-standard" ports.
18:56nopromptcallen: now i have to use ssh + irssi.
18:56technomancynoprompt: erc over mosh is <3
18:56technomancybut I guess mosh is probably nonstandard =\
18:56callennoprompt: irritating. yeah. I use mosh -> GNU Screen ( irssi )
18:56callentechnomancy: couldn't he tunnel it?
18:56noprompttechnomancy: does it use ports other than 22, 8080, etc?
18:57technomancyI like instantly reconnecting to an ERC instance connected to 4 different chat networks as soon as my network comes back up
18:57technomancynoprompt: yeah, needs a bunch of UDP ports opened
18:57technomancycallen: kinda defeats the point
18:57technomancyas far as the auto-reconnect goes
18:57technomancywhich is the best part IMO
18:57callentechnomancy: I guess you're right. I do like opening my laptop and having it "just work"
18:57nopromptwell i can check that out at home i suppose.
18:57callennoprompt: also mosh is "mobile-shell" on homebrew, not mosh.
18:58callennoprompt: mosh on homebrew is some communist scheme thing
18:58technomancystalin?
18:58callenI tried to get them to fix it, no dice. :)
18:58callentechnomancy: Trotskyite. Continuous revolution.
18:58nopromptcallen: thanks again. boy the spirit in this room is suddenly lifting. ;)
18:59noprompttechnomancy: fwiw, i guess i should thank you for the esk. w/o that and evil mode i probably would have never left vim.
19:00nopromptthe vim + tmux hackery was killing me.
19:00amalloyesk sounds like some kind of rodent
19:00callennoprompt: if you want some lovecraftian Emacs inspiration: https://github.com/bitemyapp/dotfiles/
19:00technomancymeh; the starter kit is such a hack
19:00callennoprompt: 412k LOC, 340-380k of Elisp.
19:00technomancyI mean I'm glad you like it
19:00technomancybut it's pretty dated
19:00callennoprompt: has roughly the same functionality as the ESK, but a little more up to date.
19:01callenwell, has more functionality, but a lot of it is stuff you won't care about :)
19:01noprompttechnomancy: 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:01technomancyI'm just waiting till I have time to properly deprecate it
19:01callennoprompt: I have a nice per-use-case modularization in my dotfiles, but I don't really use package managers.
19:02callennot for Emacs anyway.
19:02nopromptcallen: i'm still new to emacs, probably two months at this point.
19:02nopromptbut this is also good to know about.
19:03callennoprompt: 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:03callennoprompt: you could rapidly become a more fluent Emacs user than myself if you put in some time deliberately practicing and exploring.
19:03nopromptcallen: honestly evil-mode made it pretty easy to switch.
19:04nopromptthat and keychord
19:04callennoprompt: good. Vimmers don't often believe me that evil-mode is fine :)
19:04callennoprompt: I'm surprised you like key-chord
19:04technomancyjust 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:05callennoprompt: 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:06Morgawram I bad for using vim for Clojure? :)
19:06technomancymost of the good stuff from uncontroversially-good the starter kit is in https://github.com/technomancy/better-defaults
19:06callenthe 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:06callenMorgawr: it's a popular choice. Fireplace makes it nicer.
19:06technomancyMorgawr: as long as you can avoid writing vimscript you should be fine
19:06RaynesMorgawr: I currently use Vim for Clojure. I frequently switch between Vim and Emacs.
19:06RaynesMeh, you can write Vim stuff in Python if you want. It isn't a huge deal.
19:08callenRaynes: have you tried vim-easymotion?
19:09Raynescallen: No.
19:09callenthere's a version for Emacs as well, but you've been using vim.
19:09callenRaynes: give it a whirl, it's pretty sweet.
19:09callenRaynes: http://tinypic.com/view.php?pic=2yysefm&amp;s=7
19:10nopromptoh ace-jump-mode?
19:10nopromptthat's the bomb.
19:11nopromptthe only gripe i generally have about emacs is identation and syntax highlighting.
19:11callenit seems to depend on the language for me.
19:11callenStuff like Ruby works great.
19:11callenErlang too
19:11nopromptyeah it seems like you need to do a little customization with some stuff.
19:12nopromptlike i just discovered the electric-mode stuff recently when working with js so } would automatically dedent.
19:12nopromptone thing i need to work on is my tab key.
19:13nopromptoh another awesome package is autocomplete. holy smokes, that package is amazing.
19:14nopromptsorry. heh, emacs makes me super excited.
19:14technomancyah youthful exuberance... it's so refreshing
19:15callentechnomancy: I was trying to ask you yesterday, have you read any of the Culture novels?
19:15technomancyhm; doesn't ring a bell
19:16callentechnomancy: Iain M. Banks?
19:16technomancyI have seen that name
19:16technomancyin bookstores
19:16callentechnomancy: they're excellent sci-fi, you should check it out.
19:16technomancycool
19:16callentechnomancy: starting with consider phlebas or player of games.
19:16technomancyI am reading the Cyberiad right now, which is hilarious despite being translated from Polish
19:17callentechnomancy: I haven't read any Lem, would you recommend that or something else?
19:17technomancyI've only read Solaris apart from this
19:17technomancyit's good but a lot more serious
19:18technomancyif you're in the mood for philosophizing
19:19technomancythe cyberiad is short stories, so maybe a better place to start
19:20noprompttechnomancy: i've never read Solaris, but the movie (the original russian version) is incredible.
19:20technomancynoprompt: it's on my list. I think I'd like it from what I've read.
19:20technomancyopinions appear to be mixed
19:20callennoprompt: have you seen Stalker?
19:20technomancycallen: I don't think so
19:20noprompttechnomancy: it's out of control with the goodness.
19:21callennoprompt: Tarkovsky did Stalker too, I really liked it.
19:21technomancynoprompt: I have a hard time imagining how it would transition into a film
19:21technomancywhich probably means I should stay away from the hollywood one and go with th emore unconventional take =)
19:21callentechnomancy: it's a different story though.
19:21nopromptcallen: no i haven't seen it but since you're reminding me i'm jotting it down.
19:22callentechnomancy: the focus is very different.
19:22nopromptcallen: that guy has a lot of really good movies.
19:22callentechnomancy:
19:22callenwoops
19:22callennoprompt: aye
19:22callennoprompt: if you like Russian cinema in general, Kidnapping Caucasian Style is silly and fun.
19:25nopromptso far most of the russian and eastern european material i've viewed has been very good. usually heavy on the philosophy. good stuff.
19:25ztellmantechnomancy: if you like Cyberiad, make sure all the other Lem translations you read are by Michael Kandel
19:26nopromptthere was a nice collection of movies called "The Masters of Russian Animation"
19:26ztellmanhe's less literal, and a lot truer to the spirit as a result
19:26nopromptsome of the animation in those movies on a technical level is just mind blowing.
19:26callennoprompt: KCS isn't philosophical, just fun. :)
19:27technomancyztellman: noted; thanks. I'm amazed how well the wordplay survives the translation.
19:27ztellmantechnomancy: I can't read Polish, but I've spoke to people who can, and they confirm it's very loose translation
19:28ztellmanstill, I think it captures something that a literal translation would trample all over
19:29technomancythere's always that tension
19:29ztellmanoh, also, if you like Cyberiad you'll probably like Jack Vance's Dying Earth collection
19:29ztellmanassuming you haven't already read it
19:29hiredmanhah!
19:30technomancyyeah, that's two votes in one day
19:30ztellmanoh, ha, did someone already say that?
19:30technomancyit was a while ago
19:30technomancyand possibly a different channel
19:30hiredmanit was in #emacs
19:31hiredmanjack vance passed away a few days ago
19:32ztellmanreally?
19:32technomancyfrequently bought with The Book of the New Sun, which I also had recommended to me recently
19:32ztellmanthat's sad to hear
19:32hiredmanyes, the 26th
19:32ztellmantechnomancy: yeah, was about to mention that too
19:32ztellmanvery different style/tone, though
19:51zoldarI'm trying
19:51zoldaroops
19:54dnolentechnomancy: I think both Solaris films work well, but I think the book is something else
19:54zoldarI'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:55nopromptdnolen: i never saw the newer one. is it any good?
19:55Bronsao
19:55dnolennoprompt: Soderbergh's no Tartovsky, but he's not bad
19:56nopromptdnolen: i think part of what put me off was clooney but maybe i'll give it a chance.
19:59dnolennoprompt: 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:01noprompt(bench (+ 1 1))
20:01nopromptWARNING: Final GC required 5.224976081480942 % of runtime
20:01nopromptuh? wut?
20:01noprompt:/
20:05noprompthmm... has anyone seen that happen with criterium before?
20:06ztellmannoprompt: yes, you're creating a bunch of Longs
20:07noprompthuh?
20:08noprompti can't bench anything though, it just locks up.
20:08Morgawrhow 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:08ztellmanoh, I thought that was just an initial warning
20:08noprompt(bench (Thread/sleep 1000))
20:08MorgawrI think I'm missing the namespace or something
20:08nopromptWARNING: Final GC required 5.305805923608734 % of runtime
20:08nopromptright out of the example in the README
20:09Morgawroh nvm, I had to use (load-file )
20:11noprompti'm not sure if i should report this or if it's something i'm doing wrong on my end.
20:12ztellmannoprompt: usually that warning is printed before a bunch of other stuff
20:12ztellmanare you killing the task too early, maybe?
20:13nopromptyeah 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:14nopromptah the with-progress-reporting macro makes it all clear now.
20:17Morgawrwell, 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:17Morgawrso I guess I'll be using a walk
20:17Morgawrtakes more or less double the time*
20:18mikethepurpleWow, didn't know that
20:21noprompttechnomancy: is it possible to automatically align docstrings in clojure-mode?
20:25dnolenMorgawr: yeah it shouldn't be that slow, looking at Clojure's implementation we could do better
20:25Morgawrdnolen: 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:26Morgawrit doesn't count for a lot but I think the difference is there
20:26dnolenMorgawr: I'm you're running those in the Rhino REPL
20:26dnolenI'm assuming
20:26Morgawryes
20:27dnolenMorgawr: Rhino is useless for benchmarking 100-1000X than modern JS engines
20:27dnolen100X-1000X slower
20:27MorgawrI was just looking at the difference between the two methods, not really looking at the numbers
20:27dnolengotcha
20:27Morgawrmore about the relationship between those two numbers
20:27Morgawrand yeah, it *is* a naive test :)
20:27dnolenMorgawr: even there it will be pretty misleading
20:27dnolenas Rhino is crap
20:28Morgawrbut 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:28dnolenMorgawr: V8 seems more analogous to JVM in terms of perf profile shape
20:43Morgawrmmm.. 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:43Morgawrdo I need to require all the namespaces used in my macros all the time or is there another way around it?
20:45onlynickleftAny ideas why (use 'difftest.core) in the repl says FileNotFoundException when lein-difftest is in my :profiles :dev :plugins?
20:46tomjackonlynickleft: plugins are loaded in leiningen's jvm, not the project's jvm
20:46onlynickleftMy plan is to write an auto-runner that just runs difftest manually via Clojure whenever some file changes in the project.
20:46onlynickleftOh.
20:46tomjackif you want it in your project put it in :dependencies
20:47onlynickleftHmm, I've done that too, and I still got this exception.
20:47tomjackthat would be because lein-difftest does not define a difftest.core
20:48tomjackoh, I see
20:48onlynickleftOh!
20:48tomjackthere's an inner support project
20:48onlynickleftIt's just difftest.
20:48tomjack[difftest "1.3.8"]
20:48onlynickleftConfusing.
20:48tomjackyap
20:48onlynickleftRight, found that on Clojars just now.
20:48onlynickleftThanks tom.. or is it jack.
20:48tomjackI presume lein-difftest loads that inside the project jvm
20:48onlynickleftYeah.
20:49onlynickleftLooks like lein-difftest is just a trampoline just a wrapper for difftest
20:49onlynickleftOops, didn't mean to paste that, meant to paste https://github.com/brentonashworth/lein-difftest/blob/master/src/leiningen/difftest.clj
20:49onlynickleftemacs copying things when I delete them is quite weird and I want it to stop.
20:50onlynickleftBut irregardless.
20:50onlynickleft>:)
20:52arohnerdoes slingshot not catch (throw (ex-info ...))?
20:55onlynickleftHow 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:56onlynickleftI 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:58weavejesteronlynickleft: The plugin system is actually pretty simple
20:59weavejesteronlynickleft: If you run "lein blah foo", it calls the function (leiningen.blah/blah "foo")
21:00onlynickleftOh, thanks. That is simple.
21:00onlynickleftweavejester: 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:01onlynickleftBecause I ran it just now and it exited immediately after the doseq.
21:01weavejesteronlynickleft: Right. It just returns a function that tells you what has changed since you last ran it.
21:03onlynickleftIs (while true ...) efficient and fine?
21:04onlynickleftAwesome! I just made an automatic test-rerunner. Now to figure out how to make it colorize its output via difftest.
21:04onlynickleftClojure is fun :)
21:12dnolenMorgawr: funny enough looking it to this makes me realize that Clojure's handling of keys / vals fns is particularly clever
21:19onlynickleftHmm, 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:22gfredericksprobably not an intentional feature
21:23gfredericksI don't know that clojure.test aims to control how the file is loaded
21:23onlynickleftAmbiguity! I call ambiguity on you!
21:23onlynickleftOh.
21:23gfrederickswhich would be the only way to provide that feature
21:23onlynickleftRight.
21:23gfredericksI don't know the clojure.test internals, but that's my guess
21:24gfrederickspresumably your test runner could wrap such things if it wanted to
21:24onlynickleftThat's my plan. Just a try/catch/println. Or TCP if you will, a la REPL.
21:25onlynickleftOr rather, try/catch/println (if printable), i.e. TCP/IP
21:27gfredericksTCP/IP is a good abbreviation for it
21:27onlynickleftSeems legit.
21:27gfredericks"The Clojure Parenthesis (is pretty)"
21:28onlynickleftDang. 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:29onlynickleftSome 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:29onlynickleftI guess I can just let it die upon exception.
21:30nopromptgfredericks: i absolutely love parens.
21:30nopromptlet the record show this.
21:31onlynickleftIs there a reasonable way to run another leiningen task within a normal Clojure function?
21:31onlynickleft(Besides shelling out.)
21:32noprompti'm going to start refering to fridays as "documentation fridays"
21:32onlynickleftThat bad eh?
21:32nopromptfor some reason i always find myself writing a lot of documentation and doing code clean up on fridays.
21:32nopromptonlynickleft: i don't think it's bad at all. i actually really enjoy it.
21:32nopromptthere's something wondeful about revisting a code base 5 months later and the code is clean and the documenation is clear.
21:33onlynickleftWouldn't know.
21:33noprompti really like the concept of literate programming too.
21:35nopromptwriting documentation and explaining your code can also help you refactor it.
21:35nopromptat least that's what i've discovered.
21:35noprompti dunno maybe i'm just a shitty programmer.
21:35nopromptor maybe i just give a shit.
21:35noprompt:)
21:35onlynickleftI'm constantly cleaning up my code.
21:36onlynickleftAnd other people's code.
21:36onlynickleftBut it's still always crap. No matter how much or little time passes.
21:36onlynickleftThe only code I like is the stuff I see in the stable Clojure tools. i.e. ring, compojure...
21:36nopromptnothing says "fuck you" like leaving beind a pile of undocumented, speghetti code.
21:37onlynickleftYep.
21:37onlynickleftPeople have been telling me "F U" quite a lot.
21:37onlynickleftFor months.
21:37tomjackwhy does fd/process-dom merge dom and domp in addition to the merge-dom stuff in logic.clj?
21:37noprompthaha, yeah. i've been going through one of the biggest "fuck you"'s of my career.
21:38nopromptit's a mangled pile of interpolated php and js.
21:38nopromptof course, to be fair, it was written 6 or 7 years ago during the close of the web dark ages.
21:39tomjackoh 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:39nopromptall i can say is thank god for the mysql workbench and foreign keys.
21:40noprompthad i not had those two things i would have been royally screwed.
21:49dnolenkeys/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:49dnolenMorgawr: thanks for pointing out the issue
21:51akhudekwow, dnolen you seem to be on an optimization tear lately
21:51dnolenakhudek: well I get annoyed whenever CLJS ops are ridiculously slow :)
21:52dnolenakhudek: I look forward to the day that you can easily predict the perf difference between CLJ JVM & CLJS
21:53dnolenakhudek: honestly most of my optimization boil down to "What did Rich do?"
21:53akhudekdnolen: there are many times I've been surprised by the jvm when trying to improve the speed of things
21:54akhudekdnolen: performance tuning can be really difficult
21:55dnolenakhudek: no argument there
22:00gdev_then compares tuning a piano with tuning an electric organ and everyone is suddenly enlightened
22:08tomjack,(do (defrecord Foo [^:bar bar ^{:baz :bing} bing]) (map meta (Foo/getBasis)))
22:08clojurebot#<Exception java.lang.Exception: SANBOX DENIED>
22:09tomjack(you get the metadata :D)
22:13gfredericksonly way to get the basis of a general record instance is reflectively?
22:17tomjackI'm probably just going to use a macro
22:18tomjacksince there are no anonymous ITypes anyway?
22:26gfrederickswhat is an anonymous IType?
22:29callengfredericks: deja vu
22:30gfrederickso_O?
22:30tomjacklike if you could reify a record type
22:30clojurebotThe use of COBOL cripples the mind; its teaching should, therefore, be regarded as a criminal offence. -- Dijkstra
22:31tomjackit's moot, I realized only working for deftype/defrecord would be silly anyway
22:32gfredericksdeftype doesn't have a basis does it?
22:33tomjackyeah it does
22:33tomjacknot that you probably should use it for anything..
22:34gfredericksoh weird
22:35nopromptboy this meta data stuff comes in handy. somehow i always for get about it :/
22:48callennoprompt: what are you using it for?
22:48callennoprompt: I usually use it to annotate functions.
22:51john2xcan't enlive's html-resource fn read html strings? i'm getting NPE when passing a string to it
22:51nopromptcallen: i have some files which contain data where the individual records aren't timestamped, however the files are.
22:52callenjohn2x: just check the code.
22:52nopromptcallen: the records are being imported in to a database and some of the data changes between files.
22:53nopromptcallen: i need to be able to compare the differences between the records in t--- File clojure/2013-06-01.log
00:49nonubyusing lein ring server in dev I have to create my own nrepl endpoint right?
00:50nonubyor thinking using :repl-options { init-ns project.repl } and define (defn start-server [] run-jetty .. join? false from there) then I get best of both worlds i.e. repl ?
00:52callennonuby: I usually have a "boot" function that inits the db connections and serves the app
00:53nonubymakes sense, I just want to make sure Ive not missed something and no one bothers lein ring server in dev as no repl?
00:54callentbqh, I just run lein ring server and boot a normal repl and do not run the app inside the REPL
00:55callenI'm generally testing functions and inspecting data in the REPL. I don't really need to see the request logs in there.
00:55nonubytrue, i guess this is problem xy, is probably testing at the right level I shouldnt need to push stuff in and out over the local http endpoint to validate my dev
00:56nonuby*rethinks*
00:56tomjackdnolen: I took a stab at removing the fd specificity: https://github.com/tomjack/core.logic/compare/generalized-domains
00:56tomjackI'm guessing we should probably leave fd/dom and fd/in intact, huh..
00:56callennonuby: that's precisely it. I try to keep neat little "models" functions that handle data access patterns that are easily testable
00:56callennonuby: the HTTP handlers are separate, and there's a separate template rendering function too.
00:57callennonuby: do you just want to see the app? It's a public website with a github repo.
00:57nonubysure!
00:57callennonuby: github.com/bitemyapp/neubite/ it's a simple CMS with authentication/admin
00:57callenuhm, just uh...ignore the request context magic.
00:57callenpersonal preference thing.,
01:01callennonuby: anyway let me know if you have any questions.
01:01callennonuby: it's built from a luminus template.
01:02tomjackif every domain ns defines its own in and dom then I guess removing the fd specificity is a much smaller patch
01:02callenwith differences littered throughout.
01:02callentomjack: which lib?
01:02tomjackwith no protocol changes needed
01:02tomjackcallen: core.logic
01:02technomancycemerick: duuuuuude https://github.com/technomancy/nrepl-discover
01:05technomancyin-flight hax
01:05cemericktechnomancy: righteous! :-D
01:05nonubycallen, thanks, will have a browse
01:06cemerickglobal namespace trawling FTW and all that
01:08cemericktechnomancy: I love it when a plan comes together.
01:10cemericktechnomancy: Still seems like some seriously-tight coupling between the server and client, re: overlays, etc
01:10Raynescemerick: Can I be a part of your A-Team? :D
01:10RaynesI'm a crafty little bugger.
01:10cemerickRaynes: dude, surely you're a founding member?
01:12cemericktechnomancy: do you really want to reinvent X11 over nREPL? ;-P
01:13cemerickRaynes: BTW, any more talk about you having a guitar in LA, and I'll assume that you'll be bussing dishes in a diner waiting for screenplay callbacks in three months
01:15callenthis is the hardest time I've ever had understanding the purpose of a library and I've used Haskell before.
01:16Raynescemerick: Man, I didn't even get to play it. I broke a string tuning the damned thing.
01:16Raynescemerick: I was trying to tune one string, but was tightening the wrong one.
01:16cemericknice
01:16RaynesSo I was like "Y U NO CHANGE TONE" and then POP
01:16cemerickI've been meaning to get my guitar out of the attic of late
01:17RaynesSo now I have to go to a guitar store and buy strings tomorrow.
01:17cemerickHaven't touched it since high school :-O
01:17callentechnomancy: so what does this help with in nrepl? I'm a bit dense and don't quite get it.
01:17callentechnomancy: searching docstrings in an ns?