#clojure logs

2012-04-13

00:07kennethso i've narrowed it down
00:07kennethhttps://gist.github.com/8df116ff0fbe53eef0a1
00:07kennethif i replace line 6 with the two lines commented out above, it doesn't work
00:07kennethcan't tell why
00:08devnFWIW i dont like using ->> in that context
00:08devn(dorun (pmap (map (line-seq (io/reader f ...)))))
00:09devnerr, you know what i mean
00:12kennethalright let me try it this way
00:12andyfingerhutpartition is adding a level of nesting that the final map doesn't handle
00:14andyfingerhutsorry, I was confused there for a bit. What do you mean by 'it doesn't work'? The result is different?
00:21kennethhmm, i though i was handling it with the two maps, andyfingerhut
00:21kennethdevn: here, tried it your way, and adding a with-open, https://gist.github.com/df78a51e447c3a7f80bf
00:21kennethit's still printing nil
00:22devnwhat is printing nil?
00:22devnyou dont have any (println) calls
00:23kennethdevn: i do, process-line printlns
00:23kennethdevn: pasted the whole code, same gist (reload)
00:23devnoh, sorry -- saw it was (str ...) earlier
00:23kenneththanks for the help btw, much appreciated
00:24devnkenneth: not a problem :)
00:25devnkenneth: do you mean to process the file in parallel? or to process lines in parallel?
00:26kennethi want to process the file in parallel, 10 threads at a time
00:27kennethsince there's some blocking i/o on the line processing, running 10 at a time ought to speed up the whole thing a lot
00:30devnkenneth: http://meshy.org/code/wf2-faster.clj
00:30devnthat's pretty ancient, so type hints and so on have changed
00:30devnas have the libraries
00:30jblomocan i change the Details section of a Jira ticke?
00:31jblomoticket
00:31kennethdevn: i think that's somewhat above my level right now
00:31kenneth:p
00:31devnkenneth: i felt the same way, but try to just skim it and look at the recipe
00:33devnkenneth: have you timed this without trying to parallelize it?
00:33devnare you optimizing prematurely?
00:34kennethi have not timed it, but i don't think it's too premature
00:34kenneththe script is meant to process a 140M line file, and i've run a php version of the script before and it ran almost 10x faster with 10 instances running
00:49kennethdevn: do you have any idea why this works (map process-line (line-seq r)), but this doesn't: (pmap #(map process-line %) (partition 10 (line-seq r)))
00:53Iceland_jackkenneth: #(apply map process-line %) ?
01:07kennethIceland_jack: hmm, could you explain that, i'm not sure i get it
01:09amalloykenneth: i think the reason you don't get it is that it's incorrect
01:09kennethhaha
01:10Iceland_jackHonest mistake amalloy
01:10amalloyanyway, your transformation to pmap looks fine except for the danger of using partition instead of partition-all
01:11amalloycompare ##(partition 2 [1 2 3 4 5]) to ##(partition-all 2 [1 2 3 4 5]) and make sure you're using the one you want
01:11lazybot(partition 2 [1 2 3 4 5]) ⇒ ((1 2) (3 4))
01:11lazybot(partition-all 2 [1 2 3 4 5]) ⇒ ((1 2) (3 4) (5))
01:11amalloyso at that point i'd ask you what you're doing that makes you think the pmap version doesn't work and the other does
01:11amalloy(it's probably laziness-related though)
01:12kennethamalloy: actually, does partition X create a collection with X collections, or a collection of collections of size X?
01:12muhoowow it's so weird dealing with a java api that has mutable state
01:12amalloy&(partition 2 (range 10))
01:12lazybot⇒ ((0 1) (2 3) (4 5) (6 7) (8 9))
01:13kennethoh shit. is there a way to do the opposite? split the collection in 10?
01:13kennethalso, here's what i'm doing: https://gist.github.com/df78a51e447c3a7f80bf
01:13amalloywell, one option would be to transpose the partitions: ##(apply map vector (partition 2 (range 10)))
01:13lazybot⇒ ([0 2 4 6 8] [1 3 5 7 9])
01:14amalloythat gets them out of order, of course, and has serious issues with incomplete partitions
01:14kennethi see, then that's probably a little dangerous for a lazy partition with 140M items
01:14amalloyif i wanted to do this, i'd use https://github.com/flatland/useful/blob/develop/src/useful/seq.clj#L51
01:15amalloybut you can't split into 10 equal-sized pieces lazily, how do you know how big to make the first one?
01:15kennethhmm, good question.
01:16kennethmaybe i'm thinking about this the wrong way
01:17kennethhere's my use case: i'm processing a huge file, and for each line process there's some blocking i/o (database write), so i want to run 10 at a time in parallel
01:18amalloyyou want seque
01:18amalloy&(doc seque)
01:18lazybot⇒ "([s] [n-or-q s]); Creates a queued seq on another (presumably lazy) seq s. The queued seq will produce a concrete seq in the background, and can get up to n items ahead of the consumer. n-or-q can be an integer n buffer size, or an instance of java.util.concurrent ... https://refheap.com/paste/2072
01:19amalloyso i think your function is just (defn process-in-parallel [items] (seque 10 (map process-blocking items)))
01:21amalloythough i wonder how that interacts with the chunkiness of map...
01:21kennethoh, sweet! i think that's what i'm looking for
01:21kennethmad kudos, amalloy :) you've cracked it i think
01:22amalloyyeah, i think that actually doesn't work well because of map chunking though
01:23kennethoh?
01:23amalloyi guess line-seq probably doesn't produce a chunked sequence, so you're fine
01:24amalloyyeah
01:24kennethso unrelated question: when i run `leon run` and it's done processing, it doesn't exit
01:24kennethdo i need to add some kind of exit statement at the end of my -main function?
01:24amalloy$google lein shutdown-agents threadpool
01:24lazybot[Issue #455: Shutdown agents after repl is disconnected ...] https://github.com/technomancy/leiningen/issues/455
01:25amalloywell, i was looking for http://stackoverflow.com/questions/8695808/clojure-program-not-exiting-when-finishing-last-statement
01:36jblomoahh thank you technomancy for a repl that works after being backgrounded :)
02:16aperiodicmuhoo: got a link for that presentation?
02:22aperiodicis this is his strangeloop talk?
02:25ibdknoxit was his ClojureWest talk
02:26aperiodicis that up?
02:26aperiodici've been kicking myself for missing that since lynaghk told me about it
04:02xumingmingva simple question, what type of thing is the *Exception* in a try/catch? https://gist.github.com/2374971
04:02xumingmingvnot a type hint, right?
04:11samaaronxumingmingv: I think it's just a java class
04:12xumingmingva java class in clojure? seems not so clojure..
04:14samaaronxumingmingv: Clojure is a parasitic language - it needs a host, and talking directly to the host language is idiomatic
04:17ChousukeYou should call it symbiotic rather than parasitic :P
04:17xumingmingvsamaaron: ah, thanks. is there any other similar usage? because i see type hint a lot, like ^Exception, but directly use Exception seems rare.
04:18samaaronxumingmingv: I think it's a fairly special case
04:18Chousukexumingmingv: the exception class is just part of catch syntax
04:19Chousukeyou have to specify what exceptions (or throwables) you want to catch
04:19Chousukea type hint just tells the compiler what class you expect a value to be, so that reflection can be avoided
04:21aperiodicsamaaron: ping
04:21xumingmingvChousuke: thanks
04:22samaaronaperiodic: pong
04:24aperiodicso, i tried the quil 1.0.0 release, and it didn't solve that weird def/defn problem i was having
04:25samaaronaperiodic: ok, shame - so remind me about the issue
04:25aperiodicsamaaron: it's summed up in the gist: https://gist.github.com/2341911
04:26aperiodicin one line, once i instantiate this java class, nothing i def/defn in the namespace can be cast to the core language interfaces
04:27aperiodici am rewriting that processing library to make it more palatable to use in clojure, and that'll remove the weird reflection stuff that it currently does to the applet that it's passed
04:28aperiodicwhich might solve this issue, but i don't know
04:28samaaronyeah, i'm staring at the code right now
04:31aperiodicmy current plan is basically just "wow, that's a weird exception i don't understand, maybe if i remove this reflection stuff i don't understand either, everything will be better?"
04:32aperiodicso i was hoping you might have some sort of clue as to why this is happening, cause i don't :)
04:37samaaronaperiodic: not that it helps, but i might restructure your code like this: https://refheap.com/paste/2075
04:38aperiodicoh, that is handy
04:39aperiodic(set-state!, that is)
04:39samaaronso I wonder what SimpleOpenNI does to the applet
04:39samaaronaperiodic: yeah, set-state! adds applet-specific state
04:39samaaronyou can only call it once though :-)
04:41aperiodicheh, fair enough
04:42aperiodicthe source for that SimpleOpenNI class is here: https://code.google.com/p/simple-openni/source/browse/trunk/SimpleOpenNI/src/p5_src/SimpleOpenNI.java
04:43aperiodicthe part that is unfamiliar to me is the stuff going on in getMethodRef, but it's not obvious to me why that would cause the cast exceptions
04:45clgv"quil kinect" sounds interesting
04:46amalloyaperiodic: to me it sounds like that class is probably mucking up your classloader somehow
04:46amalloybut i don't really know anything about a cause or a solution to that problem
04:47amalloyyou could probably verify by doing something like printing (.getClassLoader clojure.lang.IDeref) before and after the thing that breaks it
04:47aperiodicclgv: it's up on github (https://github.com/aperiodic/quil-kinect), but unfortunately right now you can only get the depth image out
04:48aperiodicoh man, classloaders, i've heard about these
04:49clgvclassloaders are mysterious fun when using some javalibs ^^
04:49amalloythey are deep magic. hopefully that's not the real problem
04:50samaaronaperiodic: sorry but i'm way out of my depth here - the code you've written seems good to me, but clearly the kinect lib must be doing some strange futzing
04:51aperiodicsamaaron: no worries! thanks for giving it the look-see
04:52aperiodicyeah, i'd always that i wouldn't run into a classloader issue, since that's farther down the rabbit hole than i think i want to be
04:52aperiodiclet me see if that's actually the case here
04:52aperiodics/always/always hoped/
04:57clgvaperiodic: what's the exception you encounter?
04:58aperiodicclgv: https://gist.github.com/2341911
04:59clgvaperiodic: wow thats weird
05:00aperiodicyeah, so it's the same classloader before and after the thing that breaks it happens
05:00aperiodicclgv: right?
05:00aperiodicthat's why i've been bugging sam to take a look at it for the past few days. i'm clueless.
05:01clgvaperiodic: as to classloaders - is the (-> (Thread/currentThread) .getContextClassLoader) still Clojure's DynamicClassLoader after importing?
05:02clgvyou can also check if there are uncommon changes to the classloader hierarchy via .getParent
05:03clgvaperiodic: the only thing that gets executed when loading should be that static-block
05:05aperiodicso the classloader is always "#<AppClassLoader sun.misc.Launcher$AppClassLoader@535ff48b>"
05:05clgvin your Clojure repl?
05:05aperiodicin the slimv buffer, yeah
05:05aperiodiceven when i don't import
05:05aperiodicwhich seems... impossible
05:06clgvin "lein repl" and CCWs repl I get Clojure's DynamicClassLoader
05:07aperiodici blame my not knowing how to use swank well at all
05:07aperiodici launched a lein repl and have the dynamic classloader
05:07aperiodicnow to import the class
05:07clgvand the bug as well?
05:10aperiodicthe classloader appears to be switched after the import, but before the functions in my namespace are called by quil
05:11aperiodici printed out the classloader in a top-level statement, and then before and after instantiating a SimpleOpenNI object
05:11aperiodiconly the top-level statement prints out the dynamic class-loader
05:12clgvso it breaks afte the constructor of the SimpleOpenNI?
05:12aperiodicno
05:12aperiodicit's already broken by that point
05:13clgvSystem.loadLibrary shouldnt break anything, I would guess
05:13aperiodicwell, i wonder if it's an interaction with anything quil might be doing in, say, defsketch
05:14wei_what's the good way to dynamically bind based on the value of a var? e.g. (binding [(symbol test-type "config") my-config] (do stuff))
05:14wei_that ^ gives me PersistentList cannot be cast to Symbol
05:15wei_is it because binding is a macro?
05:15clgvwei_: yeah. and it expects a symbol or destructuring form there
05:18aperiodicclgv: this is what i'm seeing now: https://gist.github.com/2375349
05:22ibdknoxVideo is recorded, blog post is written. Light Table will be making its debut tomorrow :)
05:23wei_would it be better to use a dynamic var for that? *config*?
05:24clgvaperiodic: hmmm. (setup) is called from within the quil-applet, so I think the AppClassLoader can be expected since its the one of the applet - but that is my limited knowledge about classloaders guessing here
05:24clgvor is it different without the import?
05:26aperiodicit's still the AppClassLoader without the import
05:27aperiodicso is processing's classloader is stomping all over clojure's?
05:27clgvthen it's probably not the spot to investigate
05:28aperiodicok
05:28aperiodichuh
05:29clgvoh. you are printing the ClassLoader of clojure.lang.IDeref not the one of the current thread inside (setup)
05:29clgvthe one of IDeref won't change
05:31senthiljust learned about clojurescript, seems interesting
05:32senthilis it just a fun side project of clojure?
05:33clgvsenthil: no it is maintained by the clojure team on github
05:34aperiodicclgv: if i print the current classloader, it's always the dynamic one, regardless of whether the class has been imported or the constructor has been called
05:35aperiodicit definitely seems like the constructor is the cause, since if i omit it, then the class cast exception does go away
05:35senthilclgv: how would you rate its popularity? (i'm new to clojure and want a benchmark)
05:36clgvsenthil: there are often development questions about it here but the project itself claims it's in an alpha stage
05:37ibdknoxit's gaining a lot of steam
05:37twem2there is quite a buzz around clojurescript
05:37aperiodicclgv: i should go to sleep, though. thanks for your suggestions; i hope i can bug you about this later, if it's still an issue after i remove everything that looks fishy from the constructor
05:38clgvaperiodic: good luck. combination of quil with kinect sounds interesting
05:40aperiodicyeah, i'd really like to get this working, since processing is pretty much the only code i wrote that's not clojure these days
06:01mccraigcemerick: i've got a case in friend i would like to behave differently : wondering about your favoured approach : i'm using interactive-form workflow, but i would like ::friend/redirect-on-auth? meta to be set false afterwards, so the handler gets called
06:02mccraigi'm happy to do a pull-request… maybe modify interactive-form workflow to take more config if that works for you ?
06:32senthilclgv: ah
06:33senthilclgv: thx!
06:33clgvsenthil: and like ibdknox said ;)
06:33FullmoonAm I overlooking something, or are there no named captures in clojure regular expressions? Would be lovely with deconstruction
06:34clgvFullmoon: Clojure's regular expression are implemented via Java's
06:38FullmoonI see... hm... then, is it possible to create a map from a vector with restructuring? Let's say a re function returns the triplet ["k=v" "k" "v"], and I want to create {k: v} via restructuring, doesn't seem to be able easily, right?
06:41clgvFullmoon: there is zipmap ##(doc zipmap)
06:41lazybot⇒ "([keys vals]); Returns a map with the keys mapped to the corresponding vals."
06:42clgvFullmoon: e.g. (zipmap [:kv :k :v] (re-find ...))
06:56Fullmoon clgv: Nice!
06:58mccraigcemerick: did it that way. pull request in the post
07:08dsabaninhi guys
07:08dsabaninI wonder what's the best and the simplest way to put clojure app in production?
07:09dsabaninI tried nohup lein trampoline run & but for some reason my noir app stops right away once I do that
07:20samaaronls
07:45cemerickmccraig: thanks, comment added
07:55mccraigcemerick: oops, sorry: sent u a new pull-request
08:35gfredericksjure
09:50huangjsany chance that I can use swank with clojurescript?
10:12BorkdudeI was wondering about macro's, is this one "idiomatic" Clojure? https://gist.github.com/2377114
10:15fliebelBorkdude: Looks fine, although I always forget what stuff like ~' does.
10:16Borkdudefliebel: I want literaly the symbol args, and not a qualified symbol
10:16fliebelMaybe that should be a gensym instead? I forgot the syntax for that too, I think it's symbol#
10:16Borkdudefliebel, yes how?
10:16fliebel&`(foo bar#)
10:16lazybot⇒ (clojure.core/foo bar__6687__auto__)
10:17Borkdudeah tnx
10:17Borkdudehttps://gist.github.com/2377114
10:18fliebelBorkdude: Why define an adder in the first place??
10:18lazybotfliebel: What are you, crazy? Of course not!
10:18Borkdudefliebel: good question, I just want an example of a customly defined macro, instead of showing one that's already present in clojure
10:18Borkdudefliebel: to show to students, but I can't think of a good example right now
10:18fdaouddefine an adder?
10:18fliebelBorkdude: If you want to over-engineer things, you should first define adder as a function, and the def-adder as a macro.
10:19fliebelI don't know, maybe??
10:19lazybotfliebel: What are you, crazy? Of course not!
10:19Borkdudefliebel: don't undestand your suggestion
10:19fdaoudanything with two question marks??
10:19lazybotfdaoud: What are you, crazy? Of course not!
10:19Borkdude??
10:19lazybotBorkdude: Uh, no. Why would you even ask?
10:20Borkdudefliebel: Any suggestions for a different macro that is not too difficult to understand, welcome.
10:23fliebelBorkdude: I improved that for you :D https://gist.github.com/2377174
10:24fliebelBorkdude: I think some control flow is very powerful.
10:25FullmoonWhat is the function that returns for (1 2 3) (a b c) all combinations? I mean 1a 1b 1c 2a 2b 2c.. ?
10:26fliebelFullmoon: Woudl a for loop do? ##(for [l '[a b c] n [1 2 3]] (str l n))
10:26lazybot⇒ ("a1" "a2" "a3" "b1" "b2" "b3" "c1" "c2" "c3")
10:26pbalduinomorning
10:28Borkdudefliebel: tnx.
10:28Fullmoonfliebel: Sure, but I could swear that there was a function that did just that.. or was that in Haskell perhaps.. hm
10:28Borkdudefliebel: what about this one, https://gist.github.com/2377228
10:28fliebelBorkdude: nice...
10:29fliebelFullmoon: Maybe it was called permuations, and lived in contrib.
10:29jkkramerFullmoon: there's https://github.com/clojure/math.combinatorics
10:29babilenFullmoon: Something like lazy-cross from https://github.com/flatland/useful/blob/develop/src/useful/seq.clj ?
10:29babilenFullmoon: (or just cross if you don't need lazyness)
10:30FullmoonAh interesting, thanks
10:30fliebelBorkdude: You could go full ruby style. There was this aprils fool joke, with had all these different if statements, to read like english.
10:31TimMcnever go full ruby
10:32S11001001a version of let that provides setq for each binding
10:33fliebelTimMc: As an example of how to define things like whenever and notwithstanding in Clojure ;)
10:33Borkdudefliebel: do you have a link?
10:33fliebel$doc setq
10:33fliebelBorkdude: I'm googling. Was on HN.
10:34S11001001fliebel: http://www.xach.com/clhs?q=setq
10:36fliebelBorkdude: Found! http://nathan.ca/2012/04/introducing-sdfry-the-modern-programming-language/
10:37Borkdudefliebel: tnx :)
10:38fliebel(assuming (= 1 2) (+ 2 2)) => ???
10:38lazybotfliebel: How could that be wrong?
10:40pbalduinofliebel: have you any code sample of this sdfry?
10:40fdaoudI guess lazybot doesn't like multiple question marks, right??
10:40lazybotfdaoud: Uh, no. Why would you even ask?
10:41fliebelpbalduino: Look at the publishing dat
10:41timvisherhey folks
10:41pbalduinofliebel: thx ;-)
10:42timvishercould anyone point me to why the haskell folks consider full currying vs. partial applicability to be important?
10:43fliebelBorkdude: You could implement prolog! (def foo 2) (def foo 3) => No
10:44Borkdudefliebel: haha, then I would first have to explain prolog to them
10:45fliebelBorkdude: Prolog is just a programming language that talks back to you, and has a soul.
10:45Borkdudelogic doesn't have soul
10:46fliebelBorkdude: Then how do we explain that robots in storage stand together, instead of where we left them? ;)
10:46Borkdudefliebel: lol
10:46Borkdudefliebel: maybe because of magnetic forces?
10:47clgvfliebel: "I Robot"? ;)
10:47S11001001timvisher: because point-free programming is cool, and calling partial over and over is tedious
10:48Borkdudefliebel: clgc I actually have that Asimov book here, but I never read it
10:48fliebelCan someone point me to the difference between the two itseld?
10:53fliebelah http://stackoverflow.com/questions/218025/what-is-the-difference-between-currying-and-partial-application
10:54fliebelHey, that'd be nice for a macro. exploding a function to pieces, and the stick it back together again.
11:03ibdknoxAnd here it is! http://www.chris-granger.com/2012/04/12/light-table---a-new-ide-concept/
11:04TimMcBlah, can't play the video.
11:04ibdknoxaw
11:04ibdknoxthat's the best part!
11:04TimMcNot your fault, Adobe's.
11:05ibdknoxah
11:05ibdknoxCan a few kind souls vote the HN post up from here: http://news.ycombinator.com/newest
11:05ibdknoxI have it on good authority what activates the voting ring nonsense is the direct link
11:05ibdknoxTimMc: I added lots of pictures!
11:05ibdknoxTimMc: does youtube work for you? I uploaded it there too
11:06fliebelBorkdude: https://gist.github.com/2377464
11:09pandeiroibdknox: is there a crate/jayq syntax that lets me create and bind html elements at the same time?
11:09ibdknox(crate/html ...)
11:09TimMcI figured out the vimeo link (http://vimeo.com/40281991) but it wants me to log in to download...
11:10Borkdudeibdknox: I vote
11:10Borkduded
11:10ibdknoxthanks :)
11:10ibdknoxTimMc: youtube: http://www.youtube.com/watch?v=H58-n7uldoU
11:10pandeiroibdknox: sorry those will be DOM elements though right? no way to have them as jq selectors?
11:10Borkdudefliebel: cool
11:11ibdknoxpandeiro: not sure I understand
11:11ibdknoxTimMc: fwiw, everything I cover in the video is in the post too I think
11:11Borkdudeibdknox: it already made its way in to the @newsycombinator twitter account
11:11pandeiroibdknox: me neither :)
11:11pandeirosorry let me get my throughts straight
11:12Borkdudegotta go, bye folks
11:13scriptorhah, I was just about to paste the light table link
11:13jimdueyibdknox: Nice work on light table. Having a fn be the smallest unit of code rather than files is something I've wanted for a long time.
11:14clgvibdknox: ah you carried on the ideas of code bubbles. interesting
11:14ibdknoxjimduey: we built code bubbles for VS over a weekend
11:14ibdknoxpeople were mostly uninterested at MS
11:14jimdueyYou did code bubbles? I thought that was a great idea.
11:14ibdknoxthey saw value in the debugging case, but not much else
11:14ibdknoxah, no some guy from brown did the original in Eclipse
11:15ibdknoxthe day after it came out, I got a few of our devs together and made it happen for VS :)
11:15clgvibdknox: is that "Light Table" running in a browser for ClojureScript only?
11:15ibdknoxthat was a neat little project
11:15ibdknoxclgv: actually it's JVM clojure
11:15scriptordamn, the real-time evaluation think seems really slick
11:16TimMcibdknox: thanks
11:16clgvibdknox: but the rendered game is cljs?
11:16ibdknoxclgv: ah yeah
11:17ibdknoxTimMc: didn't you post stuff on reddit last time?
11:17TimMcyeah
11:17clgvibdknox: you have the running demo as a github project, I guess?
11:17ibdknoxclgv: I haven't released the code
11:17ibdknoxI'm not sure what to do about it quite yet
11:18ibdknoxmy prototype is decently robust, but it has a lot of rough edges and isn't necessarily that useful in practice (it doesn't even let you save :)
11:18clgvibdknox: oh ok. a live testing would have been great ;)
11:18timvisherS11001001: recommend anything i could read on point-free programming?
11:18ibdknoxclgv: I agree, unfortunately, trying to put that on the internet would be a disaster ;)
11:19clgvibdknox: maybe in some months ;)=
11:19TimMcibdknox: Yes, and I'll probably post this one as well unless someone beats me to it.
11:19ibdknoxTimMc: as you are far more familiar there, should you believe it merit's it - feel free to plop it on there :)
11:20timvisherRaynes: should tryclj.com be down?
11:21jsabeaudryIs there a way to have an incremental "lein uberjar" so that not everything is recompiled everytime when only 1 file changed?
11:23S11001001timvisher: http://www.haskell.org/haskellwiki/Pointfree
11:23ibdknoxlol: 880 people on the site right now
11:24TimMcibdknox: It's more a matter of my internet connection and reddit both being up at the same time. :-(
11:25ibdknoxTimMc: haha
11:25ibdknoxthe differences between HN and reddit traffic are interesting
11:25scriptorTimMc: tried http://www.downforeveryone.com/?
11:28timvisherS11001001: thanks!
11:30scriptorwait, is the light table demo up anywhere?
11:31ibdknoxscriptor: couldn't put it up as a website, the world would've destroyed that server in seconds
11:32ibdknoxplus the real-time bit of it sucks with latency
11:32scriptorah, cool
11:33hhutchibdknox: this is very very cool
11:35ibdknoxhhutch: :)
11:37ibdknoxin its completed state it would address the "getting an env set up for Clojure" issue nicely
11:37ibdknoxyou'd just download a jar, run it, and open a browser
11:39scriptoribdknox: have you thought about how lein/cake integration would work?
11:39ibdknoxI don't think you'd need to do anything special really :)
11:40hhutchibdknox: so it is clj->cljs stack, I can't wait to play with it :)
11:40ibdknoxI would just use lein like I do with vim
11:40ibdknoxthere are lots of things I didn't talk about in that post/video though
11:40scriptoryou're a vimclojure user?
11:40ibdknoxlike the idea of having access to all of the projects on your machine
11:40ibdknoxscriptor: yessir
11:42Bronsaibdknox light table seems insananely cool.
11:42Bronsa*insanely
11:45TimMcBronsa: insananananananana
11:46ibdknoxlol
11:46Bronsalol
11:48dnolenibdknox: impressive!
11:49ibdknox:)
11:52pbostromibdknox, I'll add to the chorus that this is indeed awesome. You're a pretty prolific dev, just curious, when do you find time to get all this stuff done? 20% time at work? nights and weekends?
11:54TimMcibdknox: Got a question for you over on the reddit page: http://www.reddit.com/r/programming/comments/s80qs/_/
11:54scriptortime machine
11:54ibdknoxTimMc: just answered :)
11:54TimMcThat fast!
11:55ibdknoxpbostrom: it was nights and weekends until fairly recently :)
11:59ibdknoxwow
12:00dnolenibdknox: ?
12:00ibdknox200+ points in an hour - didn't expect that
12:01lynaghkibdknox: if you think that's a lot of points, you should try pinball =P
12:01ibdknoxhahaha
12:01ibdknoxI *love* pinball
12:02dnolenibdknox: haha, it's a pretty sick video - definitely something that resonates - our tools could be way better.
12:02autodidaktoOooo, ooo, wutcha playin?
12:02devnibdknox: i want light table. i want it so bad.
12:03devnibdknox: awesome work man.
12:03hoeck1and the top comment is of course: 'the smalltalk guys did this stuff back in the 80ties'
12:03scriptorof course
12:03autodidaktoThat's what she said
12:03scriptorI guess this is how normal programmers feel when the top comment is about lisp doing it already
12:04hoeck1I'm wondering if such environments will succeed this time (hoping so)
12:04dnolenhoeck1: sometimes it takes a long time for old ideas to really catch on.
12:04dnolenhoeck1: at JSConf I presented right before Dan Ingalls. It was a Lisp Smalltalk double whammy.
12:04autodidaktodnolen: link!
12:05dnolenautodidakto: whenever JSConf releases the videos
12:05autodidaktogotcha
12:05hoeck1dnolen: maybe, also the hardware is way better now than 20 years ago, big screens and such
12:06dnolenhoeck1: heh, that too. GCs come a long way, people actually know how to make dynamic languages fast at runtime, etc.
12:07ibdknoxwe needed a lot of things to happen before something like this could come into being and actually catch on, I think
12:07ibdknoxwe needed more programmers and bigger programs, for one thing
12:08scriptorwould this eventually be a stand-alone editor or be integrated into existing stuff?
12:08hoeck1ibdknox: would you use a lib to render clojure datastructures directly to html, for example in order to render the code in lighttable?
12:09hoeck1If shuch a thing would exist?
12:09lynaghkibdknox: I think there's a lot of value for something like LightBox in just debugging and exploring other people's code. When I was diving into core.logic a while back I would have loved to just see a visual trace of the execution paths and values.
12:09autodidaktodnolen: which video were you talking about just now?
12:09ibdknoxscriptor: I'm not sure how it could be integrated, putting it *in* something kind of defeats the point
12:09ibdknoxhoeck1: not sure I understand, like to show results?
12:10ibdknoxI have a little ipad prototype that lets you drag things around and code - it does something sort of like that
12:10dnolenautodidakto: my Lisp presentation at JSConf, and Dan Ingall's far, far superior one on Lively Kernel.
12:10scriptortrue, I was trying to think of any editor that could let you completely change its behavior like that
12:10ibdknoxlynaghk: totally
12:10muhoois "lein cljsbuild auto" required in order to use cljs-template built projects?
12:10ibdknoxmuhoo: no
12:10devnibdknox: everyone in the office is saying "minority report"
12:11devni dont want that necessarily, but fwiw, that seems to be a common response to seeing it
12:11dnolenlynaghk: one dream I've had for a long time - a tracer that can graphically show the core.logic search nodes. Mozart/Oz has this.
12:12lynaghkdnolen: the thing that scared me away from that project is getting the data/internals. If we can figure out a nice way to do that for core.logic traces or general clojure execution debugging, I'd be happy to kick together some UIs.
12:12ibdknoxdevn: haha, a bit :)
12:13dnolenlynaghk: that would be beautiful.
12:13hoeck1ibdknox: http://pastehtml.com/view/bun1zr4o7.html
12:13dnolenlynaghk: I just need to think some about how to get the hooks in there.
12:14lynaghkdnolen: Sure. Maybe in a month I'll take a week or two off and go on holiday somewhere to hack on funsies projects only.
12:14hoeck1ibdknox: needs more work, currently a dead and unreleased project
12:14ibdknoxgah
12:14ibdknoxdoes anyone remember how to make lists in HN markup?
12:14ibdknoxI seem to have done it wrong
12:14ibdknoxlol
12:16winkwow,
12:16winkthat looks ace
12:20cemerickibdknox: nice presentation :-)
12:21ibdknoxcemerick: you should've seen me, I was doing the voiceovers and at the very end iMovie adjusted all my clip lengths - I didn't notice until about halfway through. Not a happy camper. Hopefully I don't sound angry in the last few clips lol
12:22lynaghkibdknox: have you tried ScreenFlow?
12:22cemerickibdknox: seriously, screenflow :-)
12:22lynaghkIt's $100, but it's an AWESOME piece of screencasting software
12:22ibdknoxI haven't
12:22ibdknoxoh
12:22ibdknoxhm
12:22ibdknoxmight need to look into that then
12:22lynaghkand since you're killing it on HN every few weeks now, might be worth it
12:23cemerickibdknox: does lighttable mean I'm 5 days further away from medical record salvation? ;-)
12:25ibdknoxcemerick: yeah... got distracted. Though for good reason - needed some time to think. A YC company magically appeared doing the same thing, so had to figure out what course corrections needed to happen :)
12:25cemerickHuh. Well, don't be swayed just by the brand.
12:26ibdknoxnot at all
12:26ibdknoxthe problem is they have a serious head start
12:26ibdknoxI think I've come up with a clever way to win though :)
12:26ibdknoxSame problem, just a different way to get there
12:26cemerickgood :-)
12:29ibdknoxlol I was actually worried I didn't do a good job selling it
12:30ibdknoxin the video at least
12:30ibdknoxI kind of glossed over the last bit, which I think is by far the most interesting
12:31dnolenibdknox: you could probably do a KickStarter for LightTable and retire.
12:31ibdknoxlol
12:31RickInGAibdknox: don't listen to dnolen, you should never retire, just keep building things for the rest of us to use
12:31winkonly if it's not clojure-only though :P
12:31ibdknoxI thought about it, but I'm not sure. What people don't know (and probably isn't that apparent) is that implementation isn't necessarily that interesting to me
12:32ibdknoxwink: I'd build it for JS
12:32wink:(
12:32ibdknoxthat's easily worth millions done correctly - VS was a billion dollar business :)
12:32winkok, JS means money, but doesn't make me happy :P
12:32ibdknoxhaha
12:32ibdknoxme neither :p
12:32ibdknoxI'm really a designer by trade
12:33winkibdknox: you just reused noir's CSS, right? :P
12:33lynaghkibdknox: your coding hobby seems to be working out
12:33ibdknoxnot graphic, but in general - the design of things, whether they be code, interfaces, products, whatever
12:33ibdknoxthat's what's interesting to me
12:33ibdknoxwink: every damn time ;)
12:34winkunique enough to instantly recognize it
12:34lynaghkibdknox: have you met Bret Victor? That was the impression I got from reading his stuff, Magic Ink in particular. That's up there with Tufte, in my book.
12:34muhooibdknox: if you don't like implementation, there's enough money in this for you to hire a team to do that part
12:35ibdknoxlynaghk: I haven't, though I probably should. I think he's the closest example to a person I'd like to be like
12:35ibdknoxit's one of the reasons I want to make sure I end up at StrangeLoop
12:35muhoobut then you'd be stuck doing icky business crap, not necessarily fun.
12:36lynaghkibdknox: yeah, I feel similarly. We'll have to get him to spill the beans on all the secret cool stuff he must have worked on in Apple R&D.
12:36ibdknoxyeah :D
12:37wkmanireibdknox: I'm watching your presentation. Neat ideas.
12:37cemerickmuhoo: the business crap *is* the fun part a lot of the time for some of us ;-)
12:38wkmanireibdknox: I'm always hesitant to mess with new IDEs because I'm addicted to emacs keybindings. Namely for movement, "copy and paste", deleting lines etc...
12:38dnolenibdknox: you should definitely try to get into StrangeLoop, I wouldn't sell your talk as ClojureScript specific. I think you have a lot to say - Clojure/Script just made implementing it easy (though that's worth mentioning)
12:38wkmanireibdknox: Even IDEs that have emacs keybindings always fall short in that regard, for me at least.
12:39muhoocemerick: it takes a special kind of person to actually enjoy dealing with vc's, making pitches, managing people, dealing with accounting stuff, hiring, interviewing, dealing with lawyers, dealing with the press, etc.
12:40dnolenibdknox: ahaha https://twitter.com/tlberglund/status/190839949921234944
12:40RickInGAibdknox: does light table do macro expansion?
12:40lynaghkmuhoo: that's *startup* crap. Good business is just meeting people, convincing them you can solve their problems, and then high fiving and taking their money
12:40RickInGAdnolen: haha
12:41rickbeerendonklynaghk is right :)
12:41muhoolynaghk: true, but if you were starting up a company to make a new ide, that'd be your life for 5 years or so
12:42ibdknoxdnolen: lolol
12:42muhooor more if it succeeds
12:46ibdknoxRickInGA: not a visual of it, though it could be added in
12:46ibdknoxI haven't decided what I'm going to do with this yet, but if I ultimately carried it forward, I'd write it in such a way that new elements for the canvas could be really easily added
12:47ibdknoxthere's lots I didn't talk about in that post and they'd require some interesting extensibility mechanisms to make them possible
12:50pandeiroibdknox: do you use any additional abstraction on top of jayq/js for custom events?
12:50ibdknoxnope
12:51pandeiroso your webapps follow the controller-less noir approach?
12:51pandeirosorry i mean client-side apps
12:55ibdknoxyeah, I mostly use statemachines and such
12:56mrb_bkdnolen: fucking with cljs today
12:56dnolenmrb_bk: sweet!
12:57mrb_bkdnolen: yeah it's "hack day" here, playing with a client side parser for a quick NLP experiment
12:57dnolenmrb_bk: nice, it's still pretty wild west - you're a brave soul.
12:58mrb_bkdnolen: i ain't scurred
12:59mrb_bkactually i'm a little scurred
13:00dnolenmrb_bk: ha, thought so.
13:00RickInGAibdknox: sorry for slow response, 2 yr. old nephew visiting the office today... re:macro expasion, I was thinking of your function that showed the functions that were called and the values they were passed, might apply to macros too
13:00gfredericksmy group is having spooki issues with the compiler crashing while trying to read input files
13:00ibdknoxRickInGA: totally could make it happen
13:02pandeiroibdknox: i think the answer to my unclear questions earlier about crate/jayq lies in jayq.core/->selector ... hadn't really understood that until now, that's why i was doing weird things with partials and on/delegate/etc
13:12sadgerhello clojarians or whatever the term is. I'm trying to get started with clojure and vim any suggestions the best way to integrate with using a repl, i tried some clojure-vim plugins that use the nailgun server but they seem a little outdated especially when using the contrib since it has been split up
13:19dnolensadger: there's a few VIM users have you looked at the getting started confluence pages for vim?
13:19sattviksadger: Well, there are two major options: VimClojure, which uses nailgun and is maintained, and SLIMV, which uses the same swank-clojure back-end as does Emacs.
13:20sadgerdo you have a link dnolen ?
13:21dnolensadger: http://dev.clojure.org/display/doc/Getting+Started+with+Vim, comments seem informative
13:21sadgerthank you
13:22sadgerperhaps my issue was not with the nailgun server but how I can use the latest contrib with nailgun
13:22dnolenibdknox: it looks like you're well on way to doubling your HN karma w/in 24 hours ;)
13:22sadgerfrom what I understand you add the jars to the classpath of the nailgun server and it can then use them in the repl
13:22ibdknoxlol
13:23wkmanireHow can I pull the doc string of a function from the REPL?
13:23dnolensadger: sadly can't offer more help - I used Emacs & Sublime Text 2 for my Clojuring.
13:23sattviksadger: Are you using Leiningen? That's probably the easiest way to deal with the classpath issues.
13:23ibdknoxdnolen: I'm still surprised to be honest - I figured people would see Clojure and be like "meh, doesn't work for me"
13:23sadgerdnolen: emacs is the devil! ha ha, thanks anyway
13:24ibdknoxsadger: https://github.com/ibdknox/lein-nailgun
13:24sadgersattvik: Not at the moment, I think I used an old way to install clojure, just run the jar etc, so then nailgun didnt work because of that
13:24ibdknoxsadger: run that in any leiningen project, it will include all your classpath and such for you
13:24ibdknoxand you'll be good to go
13:24wkmanirenvm
13:24wkmaniredoc
13:24jkruegeri have successfully migrated people to emacs with one of the vi modes
13:25sadgerright ok I will have a look at this later on this evening, appreciate your help guys
13:25sadgerjkrueger: vi mode isn't vim though!
13:25ibdknoxFor those interested, there have been approximately 17,000 uniques to the site. Hovering at a constant 850 +/- 50 people since I posted it
13:25ibdknoxit has been a little over 2 hours
13:25RickInGAsadger: all clojure getting started instructions should begin "install leiningen"
13:26sadgerRickInGA: I will probably learn that shortly, from what I gather it just used to be run from the jar
13:26dnolenibdknox: nice. btw, if we can get this column stuff into 1.5, we should push to adapt the CLJS analyzer for that and make it a real stand alone contrib lib.
13:26sadgerBut appreciate the help guys I will go make some dinner and be back and fix it perhaps :)
13:27sattvikibdknox: Is that the best/most maintained version of lein-nailgun? It's actually kind of confusing to figure out which version is the one to use.
13:27ibdknoxdnolen: I agree, I didn't want to take the time to do that quite yet, but absolutely. We'd need to change a couple things (the names of functions have . prepended)
13:27ibdknoxsattvik: I use Clojure all the time and I only use VIM (for now), so it's a decent bet :)
13:28RickInGAibdknox: you may be diehard vim for now, but if that guy that's working on it ever finishes lightbox, I bet even you will switch
13:29sadgerRickInGA: I saw that it looks pretty, vim all the way
13:29ibdknoxRickInGA: I dunno, not really a fan of the guy to be honest. ;) And I would totally add vimbindings
13:29sadgeribdknox: do you use pentadactyl or vimperator?
13:29jimdueyibdknox: That bodes well for having VIM keybindings in light table.
13:29sadgerintegrate vim as the editor
13:29sadgersorted
13:29sadger:)
13:29ibdknoxsadger: vim's UI layer isn't powerful enough
13:30ibdknoxjimduey: there's actually a vim plugin for codemirror
13:30ibdknoxand emacs one too
13:30sadgersattvik: aww
13:30sadgerooops
13:30sadgerwrong person damn autocomplete
13:30ibdknoxI'm sure with some more work they could be dramatically improved :)
13:30sadgerand so they should be, I have seen sort of vim embedded in eclipse
13:31sadgerbasically gvim stripped of the bars
13:31scriptorthe bars?
13:31sadgertoolbars
13:31sadgerthat you can remove anyway
13:31scriptorah
13:31scriptorso, like vim in a console?
13:32sadgeryeah essentially just the pane where you edit text in eclipse is vim
13:32sadgerbut you lose all the eclipse mouseover and completion etc
13:32sadgerso
13:32sadgernot really worth it
13:32sadgera better plugin just adds vim keystrokes
13:40dnolenibdknox: heh some heavyweights retweeting Light Table, just saw one from Ajaxian founder then retweeted by Paul Irish from Google.
13:40ibdknoxdnolen: I suck at twitter
13:40ibdknoxDon't even really know how to figure that out in a reasonable manner
13:40ibdknoxlol
13:40ibdknoxI just look through everything every once in a while
13:41scriptorit's getting several tweets a minute
13:41dnolenibdknox: between Paul Irish & Dion Almaer that's showing up in like 50,000 twitter streams.
13:41ibdknoxsweet :D
13:42ibdknoxI guess we can call it viral :) It's staying at over 1000 people now
13:42ibdknoxhopefully we'll get some new Clojure devs!
13:44scriptorshoulda plugged the irc channel!
13:44pandeiroibdknox: i think you took down vimeo too or something b/c i still can't watch the demo
13:44scriptoralthough it'd just be a stream of people joining and asking for the demo/source
13:44scriptorvideo works fine for me
13:45pandeirohuh lemme try firefox
13:45scriptorhmm, using chrome on osx 10.6.something
13:45scriptorhere
13:45pandeirooops i forgot i didn't have flash installed :)
13:45pandeirojust set up this OS
13:46pandeiroi thought chromium had flash builtin though
13:46scriptordon't think so
13:47pandeirohow many more years til youtube and vimeo & co will be embeddable with video tags?
13:48dnolenibdknox: haha, did you have a chat with al3x about Clojure?
13:48ibdknoxyeah at ClojureWest
13:49ibdknoxI told him fundamentally there are two differences, one that matters short term and one that matters long term
13:49ibdknoxshort - overall complexity of the language is much lower (the book for Scala is huge)
13:49ibdknoxlong - you simply can't create the same level of abstraction in Scala
13:50ibdknoxthe latter is by far the most important, because that's all programming is
13:53ibdknoxdnolen: ^
13:54ibdknoxHe seemed to really like our community
13:55irc2samushi guys, why does partition and partition-all return an infinite list of empty lists when you pass zero as argument?
13:55irc2samusI mean, I understand the idea of "if you partition on chucks of zero elements..." but isn't it useless? and dangerous
13:56dnolenibdknox: I pretty much agree w/ your analysis.
13:56AimHereirc2samus, it's kindof the logical behaviour, and clojure sequences are all about infinite lists of things
13:56AimHereIt's no more dangerous than ANY use of the iterate function, for instance
13:57RickInGAI went to a Scala user group meeting last week, where they showed a demo of lift. Made me like Noir even more
13:57irc2samusAimHere: it's way different, with partition and partition-all you're not generating anything, you're splitting
13:58AimHereYou can split up an infinite sequence with partition just as easily as a finite one
13:58irc2samusI suppose if you ask to partition an infinte list you'll get another infinite one, but that has nothing to do with the size of each chunk
13:58irc2samusin fact I would never expect to get an infinite list when partitioning a finite one
13:58AimHereWhat behaviour would you like instead, that wouldn't surprise the programmer?
13:58irc2samusan error
13:58mknoszligirc2samus: unless the chunk size is 0 :)
13:59irc2samusbut that's the point, partitioning by zero is an error
13:59AimHereIt's not an error
13:59AimHereIt's the logical behaviour
13:59irc2samusI don't see how that ebhaviour could be more useful that actually failing
13:59irc2samusno it's not
14:00mknoszligirc2samus: chunk size -1 would be an error, i'd agree there ... for chunk size 0 an empty seq sounds logical...
14:00AimHereSure it is. you partition your set into (/ count #{ ... } n) sets of size n; if n = 0, it's obvious what you get
14:01irc2samusit sounds like an error, this is programming not set theory and here if you want an infinite sequence of empty lists you'll ask for that right?
14:01irc2samususing this method to achieve that isn't actually useful
14:01AimHere(partition 0 <foo>) is one way of asking for that
14:01irc2samusand pretty much will happen on actual errors
14:02irc2samusAimHere: you're missing the point, that is not the way to do it it is instead A way to do it (now) which I find useless and dangerous
14:02irc2samuswill you really do that in your code?
14:03mknoszligirc2samus: fwiw, using -1 returns the empty list
14:03irc2samusmy point is, it's more important to prevent possible errors that to follow philosohical reasonings about what "makes sense"
14:03irc2samusand also, it "makes sense" as a logical reasoning, not as a programming one
14:04AimHereI think not violating programmer expectations is the way to prevent possible errors
14:04mknoszligirc2samus: i'd say that's a matter of opinion...
14:04irc2samussure it is, but I wonder if there's actually a valid use for it
14:04irc2samusas for expectations, I would expect an error
14:04AimHereAnd if you keep your functions logically consistent, then it's easy to build up a fair set of expectations
14:04AimHereYou're basing your expectations on what you get from other programming languages though
14:05irc2samusspecially since code that generates that value might end up getting zero and that would definitely be unexpected
14:05irc2samusit's not about other languages, it's about a useless feature imho
14:06irc2samuswhich WIL cause bugs if you don't guard against
14:06irc2samus*WILL
14:06mknoszligirc2samus: the utility of the feature is determined by context i'd say...
14:06AimHereSo guard against them yourself, if you're worried
14:07irc2samusI would like to see an actual example of its usage
14:07irc2samusAimHere: you're proving my point
14:07AimHereWhy?
14:07clojurebotAimHere: because you can't handle the truth!
14:07irc2samus(fwiw this isn't important to me, I noticed it and am curious but nothing else)
14:08AimHereI mean, if you've got code that barfs on an infinite stream of empty lists, you guard against it
14:09irc2samusAimHere: because that infinite list shouldn't be there in the first place, no one will expect that
14:09irc2samusnot even you guys, you've reasoned it after I asked, but even the guess for -1 was incorrect
14:09dnolenirc2samus: there are many functions that don't validate inputs.
14:09irc2samusthat's definitely not meeting expectations
14:09irc2samusit seems so
14:10AimHereWhen you asked, you stated what happened, so it's a bit unfair to accuse us of not getting it
14:10ibdknoxdnolen: lol I just got asked if I want a phd :p
14:11dnolenibdknox: HAHA
14:11dnolenibdknox: why not man?
14:12dnolenibdknox: hammock time on someone else's dime I say.
14:12ibdknoxbut being a student sucks :p lol
14:12ibdknoxdnolen: that *is* true
14:13dnolenibdknox: WHOA, props from Avi Bryant!
14:13dnolenibdknox: you blowing up man!
14:13dnolenibdknox: don't forget the small people, k?
14:14RickInGAibdknox: I knew I should have gotten your autograph when I had the chance!
14:14ibdknoxhaha
14:14ibdknoxfunny what such a short amount of time can do
14:33wkmanireHelp, newb question. (def m { :wat "wat" }). (m :wat) returns the same value as (:wat m).
14:33wkmanireI read that :wat is a function that looks itself up in a map.
14:33zakwilsonYes, that is intended behavior.
14:33wkmanireThat made sense
14:33wkmanirebut are maps functions that take keys?
14:33wkmanireas well as a data syntax?
14:33Bronsayes
14:33wkmanireAh... ok
14:33wkmanireThanks.
14:34zakwilsonKeywords are special here. A string key won't look itself up in a map.
14:35jondot1hi all. is there any way to improve error reporting from clojure? im trying to figure out where is my error but i get a blunt stack trace
14:36dnolenjondot1: 1.3 has better stack traces but no tools I know of expose it.
14:36wkmanirezakwilson: (def m { "wat" "wat!" }). (m "wat") -> "wat!". ("wat" m) -> java.lang.ClassCastException
14:36wkmanireunderstood.
14:36jondot1i see. i was wondering if there is a debug or verbose flag to turn on
14:37zakwilsonAlso, I think the compiler optimizes the keyword-as-a-function case, so (:wat m) is faster than (m :wat)
14:37wkmanireI sure hope my learning curve starts getting exponential pretty soon.
14:37wkmanirezakwilson: That's good to know.
14:37zakwilsonIt might. What's your background?
14:37dnolenjondot1: I suggest bugging the maintainers of the particular tool you use - better, submit a patch
14:38wkmanirezakwilson: OOP.
14:38wkmanirezakwilson: .Net, Javascript, Python etc...
14:38jondot1dnolen: well currently using compojure
14:38wkmanirezakwilson: Very little Java
14:38dnolenjondot1: even better would be patch to Clojure that exposes this stuff as a rich map so tools can present whatever they want.
14:39wkmanirezakwilson: I'm working out of cemerick's book.
14:39lynaghkcemerick: I just added friend 0.4.0 to my clojure 1.3 project and am getting an unzip error.
14:39wkmanireI'm chomping at the bit to get the point that I can start a web app with clojure and clojurescript.
14:39zakwilsonwkmanire: well... you have a bit to learn then. Clojure is pretty different.
14:40wkmanireI just watched a slide show illustrating how clojurescript uses the closure compiler in advanced comp mode.
14:40ibdknoxwkmanire: have you looked at my overtone-ipad thing?
14:40wkmanireI've used google's closure before so all in all, very enticing.
14:40ibdknoxthere's a video of me building it
14:40wkmanireibdknox: Have not.
14:40ibdknoxand it's an easy project to get started with
14:40ibdknoxeven easier now that cljs-template exists
14:41ibdknoxwkmanire: http://www.chris-granger.com/2012/02/20/overtone-and-clojurescript/
14:41wkmanireibdknox: I was just about to ask for the link. Thank you!
14:43wkmanirezakwilson: Functional programming is like an alien planet to me, not just clojure. I'm understanding everything I'm reading so far though.
14:43wkmanireThis channel has been excellent at answering all of my questions too.
14:44wkmanirezakwilson: I have a feeling that the experience is going to be like learning chess. You learn the rules quickly but it takes a long time to get good at the game.
14:44zakwilsonwkmanire: glad to hear it. Python, JS and many .NET languages support some degree of FP, but it's not the default paradigm.
14:44sadgerwkmanire: I know it's probably a bit of a tangent but learn you a haskell is very good at intro level to the functional way of thinking
14:44sadgerwkmanire: The joy of clojure has a section on thinking functionally actual
14:44sadgeractually*
14:44wkmaniresadger: Yeah, I've gone through lyah once. Haskell was a bit too hardcore for my spare time.
14:45sadgerwkmanire: get your hands on the joy of clojure
14:45wkmanireThe plan is to get my footing with clojure and then pick up Haskell after not everything about it is differnet.
14:45wkmaniredifferent*
14:45wkmanireto me that is.
14:45scriptorwkmanire: it's definitely worth a reread, but you have to go through it slowly and not just read through the whole thing in one go
14:45AimHereSICP has a fun way of dealing with FP. They introduce you to programming, and don't bother doing anything imperative until about page 160 or so
14:46scriptorone trick I found really useful was to try and implement a function when it describes one, before it shows you the source
14:46AimHereAnd even then, it's a kind of necessary evil to make some problems easier
14:46zakwilsonHaskell is very mathy. That's not to say it isn't practical, but Clojure is entirely focused on practical concerns where Haskell is also focused on research.
14:46wkmanireYeah, and I'm not a researcher.
14:46wkmanireI have bills to pay.
14:46wkmanire:D
14:46wkmanireI was recommended clojure by several people in #python.
14:46zakwilsonI've written a little non-trivial Haskell. I ported most of it to Clojure. It was the right decision.
14:46wkmanireSo far it's been great.
14:46sadgerwkmanire: maybe they wanted rid of you :D
14:46ibdknoxClojure ftw
14:47wkmaniresadger: Probably, I babble a lot.
14:47sadgerwkmanire: Might I suggested going to #php I hear it's great
14:47wkmanireBut I'm (arguably) good at Python.
14:47sadgermy typing is fail
14:47wkmanireIts fun being a newb again.
14:47wkmanireIt's*
14:47sadgermy fail typing is contagious it seems
14:47zakwilsonThough if I wanted to transcode some structured text data, I think I might still reach for Haskell. Parsec just makes it so easy.
14:47wkmaniresadger: We've just met and you're already telling me to go to hell?
14:47Wild_Catwkmanire: remember, #python is watching you. :p
14:48sadgerwkmanire: in some way yes
14:48sadgerha ha
14:48sadgerI jest
14:48wkmanireWild_Cat: Yes, I'm sure it is.
14:48emezeskeibdknox: I'd just like to state for the record that, wow. (re light table).
14:48sadgerI am a java programmer (well use it in my research) but starting with haskell and now clojure probably left haskell for the same reasons as wkmanire
14:48ibdknoxemezeske: :)
14:49zakwilsonibdknox: are you making cool toys instead of working on libraries to make my life easier?
14:49ibdknoxmaybe
14:49ibdknox:p
14:49zakwilsonThis is not acceptable.
14:49emezeskezakwilson: his cool toy might also make your life easier
14:49ibdknoxI was thinking of mocking up meteor, how about that?
14:49RickInGAzakwilson: he is making cool toys to make your life easier
14:49sadgeris raynes still making a lyah style book about clojure?
14:50ibdknoxsadger: yeah
14:50sadgernot heard about it in ages
14:50sadgersee I know him from dreamincode
14:50ssideris_emezeske: light table?
14:50sadgeror OF him at least
14:50emezeskessideris_: Yeah
14:50zakwilsonOh, I see. That's a code editor. I was thinking of a homebuilt MS surface clone or some such when I heard "light table".
14:51Wild_Cathow do hexadecimal escape codes work in Clojure? I want a string that contains a NUL character, how do I do that?
14:51RickInGAI was talking to somebody the other day who wants to do Clojure on a Surface table, not sure exactly what he had in mind, but I bet it will be cool
14:51zakwilsonThis might be acceptable. I like Emacs and Slime... but it doesn't really have anything on a Lisp Machine from 30 years ago.
14:52ibdknoxRickInGA: I have lots of thoughts there
14:52ibdknoxif only microsoft would give me a surface... ;)
14:52hiredman*shrug*
14:52RickInGAibdknox: actually, I think he said he was submitting a proposal to you, GSOC, his name was Eric Caspray
14:52ibdknoxoh yeah
14:52ibdknoxhe did
14:52hiredmanI played with a surface a little, it was not very impressive
14:53zakwilsonI thought you could buy them.
14:53ibdknoxhiredman: because of the software though, right
14:53ibdknox?
14:53ibdknoxzakwilson: they're like 10k
14:53ibdknoxdon't care *that* muc
14:53hiredmanthe whole thing
14:53zakwilsonThat's like two prototypes.
14:53ibdknoxhaha
14:53hiredmanit was in a little table
14:53zakwilsonI'm curious - did that work?
14:53hiredmanat some the NERD cetner
14:53hiredmancenter
14:53ibdknoxif I could have a drafting table sized surface...
14:53ibdknoxthat would be awesome
14:53solussdibdknox: do you pronounce sqlkorma s-q-ljorma, or sequalkorma ? :)
14:54solussd*korma
14:54ibdknoxsolussd: it's just korma
14:54solussdcrap, right. :)
14:54ibdknoxsqlkorma only because I couldn't get korma.com :)
14:54hiredmanbut, like, I navigate and do everything via the keyboard, which lets me swizzle stuff around as good as the surface, and I can do it without looking
14:54RickInGAthat's what you get for naming things pinot, noir and korma... already taken
14:55wkmanireibdknox: http://www.internic.ma
14:55wkmanireThe kor domain is available.
14:55locojayhi sry it's my first clojure day. why do i get a list of objects when doing json-str on a clojure map.
14:55ibdknoxwkmanire: haha, not sure I care that much :)
14:55locojayusing clojure via zmq to talk to some python code via json.
14:55wkmanire:D
14:56ibdknoxhiredman: I want both. In no way would I try to replace the keyboard with it
14:56ibdknoxhiredman: for the very things you're talking about
14:56wkmanireibdknox: Besides, if you tell someone kor.ma, they're going to remember you having said "korma.com"
14:56ibdknoxyeah
14:56zakwilsonI rarely remember domains anymore. I google things.
14:57zakwilson"clojure korma" gets me what I want.
14:57ssideris_wow@light table (just watched the video)
14:57ibdknoxzakwilson: me too
14:57ibdknoxlol
14:58ssideris_so does it exist at all?
14:58zakwilsonAnd now I'm looking at light table when I should be finishing learning Django.
14:58ssideris_even as a prototype?
14:59zakwilson(and why would I do that? because it has a bunch of pre-built apps so I can get certain kinds of client work done really fast)
14:59RickInGAzakwilson: Django?
14:59ssideris_oh it does
14:59zakwilsonRickInGA: are you asking what it is? Why I would use it? If I'm crazy?
15:00RickInGAzakwilson: I am putting together a 'real quick' thing, and I am doing it in C#, becuase my clojure skills are not there yet. I already regret that decision. I want my clojre data structures!
15:00ssideris_ibdknox == cgrand?
15:00ibdknox== chris Granger
15:00ssideris_this is an amazing prototype
15:01ssideris_I really really like the drafting table metaphor
15:01zakwilsonRickInGA: I understand. I default to Clojure when it makes sense. I don't think it really does for a generic brochure website + cms + e-store. Using something already built and customizing as little as possible makes sense to me.
15:01raekcgrand = Christophe Grand
15:01ssideris_I think it would take a lot of work to make the navigation easy for drafting tables, but it would really be worth it
15:01ssideris_where do I enlist to help with this? ;-)
15:02ibdknoxonce I figure out what in the world I'm going to do with it
15:02zakwilsonSell it on ebay!
15:02RickInGAzakwilson: yeah, I think the issue is, I can still get work done in C#, I just can't enjoy it anymore :)
15:02ibdknoxI thought it would make a splash, but I didn't expect it to drain the water from the pool :p
15:02muhoonever underestimate the power of a good idea, perfectly timed
15:02zakwilsonRickInGA: I know what you mean. I felt that way last time I used Rails.
15:03zakwilsonEvery step of the way, I was thinking "this is not simple".
15:03wkmanireI'm reading about destructuring. (def v [1 2 3]). In the expression (let [[x _ z] v]) (+ x z)), "_" just the goto variable name for place holders or does it have a special meaning syntactically?
15:03alexyakushev625 points in 3 hours for Light Table post on HN. That is pure win.
15:03ssideris_ibdknox: the other obvious thing (altough I
15:03wkmanireis "_" just the....
15:04eggsbyhey light table
15:04raekwkmanire: it isn't treated specially
15:04ssideris_ibdknox: the other obvious thing (altough I'm sure you're being bombarded with ideas) is examples from clojuredocs along with the online help
15:04eggsbyibdknox: is this inspird from that bret victor talk? :p
15:04zakwilsonOh, good. It's above "a year with mongodb". Die, mongodb, die.
15:04raekit's just a convention
15:04wkmanireraek: If it is used repeatedly is it going to be reassigned?
15:04ibdknoxeggsby: some, more from my time on VS
15:04raekwkmanire: you cannot mutate local variables in clojure
15:04wkmanireraek: Same as destructuring (let [[x x x] v]...
15:04wkmanire?
15:04eggsbyit looks very cool either way ibdknox
15:05wkmanireraek: I know that.
15:05raek&(let [[_ _] [1 2]] _)
15:05lazybot⇒ 2
15:05ibdknox30k uniques
15:05wkmanirelazybot gave my client a character it couldn't interpret.
15:05muhoo"You release an album, one you quite like, and you wake up the next morning to find the entire rock press has sewn its tongue to the back of your trousers" -- review of "OK Computer", 1997
15:05ibdknoxso far
15:05solussdibdknox: light table looks awesome- where do you find the time for noir, korma, table table, etc ?
15:06ssideris_ibdknox: and search to include clojars. with the option of loading the libs with pomegranade. I think I'm having a nerdgasm
15:06ibdknoxstill averaging 800+
15:06ibdknoxsolussd: I'm quickly running out of it haha :)
15:06wkmanireraek: Ok, I've got it. Thank you for the clarification.
15:06jondot1whats the correct construct to say "I want to map in parallel, but only return a subset of the mapped-on collection" ?
15:07zakwilsonCombine pmap and filter in the appropriate manner.
15:09jondot1zakwilson: you mean filter identity pmap (and return nil from pmap) ?
15:09zakwilsonjondot1: I don't know what you're trying to do, so... maybe.
15:11solussdwait a tick… 1. the ability to generate or load code at runtime coupled with centralized repos (clojars/maven) and potentially runtime dependency management/fetching (reader + pomegranate)… did we give clojure programs everything they need to construct skynet?
15:11jondot1zakwilson: well im validating a list of items, using pmap. however i'd like items that are not valid by definition not to appear in the result list
15:11zakwilsonMaybe you want to filter it first. Maybe you have a big collection and you need to chunk your pmap (I wrote a library function for that - see https://github.com/zakwilson/zutil-clj)
15:11Wild_Catother question: I have a string with a significant number of literal double quotes and backslashes inside it. I don't suppose Clojure supports "nicer" forms of quotation, e.g. Python's raw strings or single-quoted/triple-quoted strings?
15:12zakwilsonSo what you really want is a parallel version of filter.
15:13wkmaniresolussd: It still doesn't have my boots, my jacket or my motorcycle.
15:14jondot1zakwilson: yes
15:15zakwilsonjondot1: (filter identity (pmap ...)) is probably the easiest route to that. Be advised that pmap doesn't work very well if the sequence is long and f is fast.
15:16Null-Aibdknox: are you planning to implement light table?
15:16jondot1zakwilson: yes, is what i'm doing currently. hoping to verify that its good enough
15:17zakwilsonjondot1: see my above link if you don't get a roughly linear speedup from pmap over map.
15:17zakwilson(specifically zpmap in util.clj)
15:20wkmanireWow. This is addictive.
15:20wkmanireYou get a piece of code you don't understand and you just start (doc foo) and re-reading.
15:20wkmanireeventually it makes sense.
15:21Null-Awkelly: clojuredocs.org
15:21Null-Awkmanire: *
15:21wkmanireNull-A: tab completion failure.
15:21Null-Aaigh
15:22Null-Aclojure code is actually really readable even without comments I find
15:22wkmanireNull-A: Perhaps if you're familiar with the different FP strategies and core library functions.
15:22wkmanireI know neither. he he he
15:22wkmanireSo these docstrings are awesome
15:22wkmanireI wish I had a REPL like this in VB.Net land.
15:23Null-AFP is definitely a big learning curve
15:23Null-Ait'll change the way you write in all programming languages
15:23Null-Amy python looks more like clojure code now
15:23cduffyIs there a way to terminate a sequence generated through iterate? I notice that returning nil doesn't.
15:24Null-Acduffy: (take 5 (iterate inc 0))
15:24Null-Ait's a lazyseq
15:24Null-Aif your logic for termination is a function, you can use take-while
15:24jkruegercduffy: or in your case (take-while (complement nil?) (iterate ...))
15:26cduffyNull-A: ...yar, I realize that; just seems a shame to put the burden on the consumer
15:26Null-Acduffy: did jkrueger's solution meet your criteria?
15:27cduffyNicely.
15:30zakwilsonwkmanire: you think (doc ...) is awesome? Try Slime. Go to a symbol, C-c C-d C-d and you have its docs in a buffer.
15:31wkmanirezakwilson: Does this work from an inferior-lisp buffer?
15:31AimHereAha
15:31zakwilsonWant to see where it's used? There are a bunch of cross-reference functions for that too.
15:31AimHere(doc ...) works from inferior lisp
15:32AimHereI didn't know about C-c C-d C-d until now
15:32clojurebot#<ExecutionException java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: Could not initialize class clojure.lang.RT>
15:32S11001001AimHere: try M-. on a function name
15:32AimHereSo I was annoyed that (doc ... ) didn't work in slime
15:32wkmanirezakwilson: What is slime exactly?
15:32zakwilsonwkmanire: Slime has its own repl buffer.
15:32wkmanirezakwilson: I was able to install clojure-mode.
15:32zakwilsonwkmanire: slime is... an IDE of sorts based on Emacs and the idea of talking to a running Lisp process.
15:32AimHereSlime is a lisp mode for emacs, able to handle multiple lisps
15:32wkmanirezakwilson: But I wasn't able to get the slime plugin installed. I'm unfortunately learning clojure from a windows box.
15:32wkmanirenot slime
15:32wkmanireswank
15:33AimHereLisp mode as in inferior-lisp, not a lisp programming mode
15:33zakwilsonThe server component is called Swank, and there's a Clojure port of that.
15:33zakwilsonhttps://github.com/technomancy/swank-clojure <-- read all about it. I know nothing about using it on Windows.
15:33lynaghkcemerick: ping
15:33zakwilsonI'd answer questions, but I must be off to the store before it closes.
15:34wkmanirezakwilson: Yeah, that won't install for me.
15:34cemericklynaghk: pong
15:34wkmanirezakwilson: I already spoke with technomancy about it, he isn't sure why its failing either.
15:34wkmanirezakwilson: I'll pick your brain another day, you'll permit me that is.
15:34wkmanire:D
15:34wkmanireHave fun at the market.
15:34wkmanireif you'll permit me
15:34zakwilsonwkmanire: there may be alternative ways to make it work, like using leiningen. I'll be back in half an hour or so, but I'm no expert on this.
15:35lynaghkcemerick: I'm just kicking the tires on friend 0.0.4. I think the credential-fn option in friend/authenticate isn't getting called.
15:35wkmanirezakwilson: Okeydokey.
15:35wkmanireMy english grammar is going to hell. man. What is happening to me? I'm not just making typos, I'm literally forgetting entire words.
15:35lynaghkcemerick: moving the key to the first (and only) workflow works, but it doesn't get called if it's at the toplevel map.
15:35emezeskewkmanire: No problemo, signor.
15:35scriptorthat's not grammar, wkmanire, :p
15:36wkmanireemezeske: señor?
15:36wkellyscriptor: case in point!
15:36cemericklynaghk: Hrm, ok. Note that the app used in the lib's functional tests uses a top-level :credential-fn.
15:36emezeskewkmanire: Ah, si, si.
15:36cemerickNot that that's a bulletproof example. :-)
15:37scriptorwkmanire: signor is italian, I think
15:37cemericklynaghk: is the usage small enough to paste?
15:37lynaghkcemerick: yeah, that's where I'm taking it from. If you put a "throw" in it though, everything runs fine, which suggests that it's not getting called.
15:37cemerickwhoa
15:37wkmanireemezeske: Tá tentando falar em español comigo?
15:37wkmanireemezeske: ÇD
15:38lynaghkcemerick: yeah, let me whittle together a minimal example.
15:38emezeskewkmanire: No recuerdo mucho espanol, para quiero comprehendo tu
15:39wkmanireemezeske: Yeah, same here.
15:39emezeske^_^
15:39wkmanireemezeske: But that was portuguese, not spanish. :P Now if only I could speak clojure.
15:39RickInGAyo tambien
15:39cemericklynaghk: FWIW, changing the :credential-fn in mock-app to this dumps all the credentials to *out* during the tests:
15:39cemerick(comp (partial creds/bcrypt-credential-fn users) #(do (println %) %))
15:40emezeskewkmanire: I always fail at telling the difference :(
15:42wkmanireemezeske: Well, I made a typo in my sentence to you. It should have been espanhol. Portuguese doesn't use ñ, and as far as I know spanish doesn't use ç, or at least not often.
15:42lynaghkcemerick: https://refheap.com/paste/2098
15:42wkmanireemezeske: But the indefinite verb forms are the same, -ir, -er, -ar, so sometimes it can be really difficult to tell if you don't understand the sentences.
15:43cemericklynaghk: so what happens when you try to log in?
15:43lynaghkcemerick: that returns 302. If the credential-fn was actually called, it should return 500
15:44lynaghker, 400.
15:47cemericklynaghk: fiddling w/ your paste now
15:48lynaghkcemerick: thanks.
15:51RickInGAI had a situation that I couldn't figure out how to solve without mutating state... I built a little slide show that showed each picture for 5 seconds and then when it got to the end, it started the loop over
15:52RickInGAI set a variable that had the index to display, and incremented it each time
15:52RickInGAI figured there was some way to do it with vector and cycle, but I wasn't sure how
15:53lynaghkcemerick: inside friend.clj#authenticate* the credential-fn isn't being used anywhere
15:54lynaghkcemerick: at least, the default you've provided isn't. Presumably the kwarg map config is getting processed downstream as part of the request.
15:54cemericklynaghk: yeah, it's only used in workflows; the top-level is available via the config attached to the request via ::auth-config
15:57cemerickoh, hah
15:58cemericklynaghk: handler/site needs to be outside of friend/authenticate; no params are being parsed out
15:58lynaghkcemerick: ah!
15:58lynaghkcemerick: yeah, I was just looking at that stuff. Thanks
15:59cemerickhandler/site or handler/api should generally be the last bit of middleware you apply.
15:59lynaghksite includes file serving from public, yeah?
15:59lynaghkit's been a while since I've been on the, er, serverside = )
15:59cemericknope
15:59cemericksite ~= session, cookies, params
16:00cemerickapi is just params
16:00ibdknoxnoir ftw :p
16:01ibdknoxthat was obligatory
16:01cemerickI'll bet this is going to be a common oversight. Maybe friend/authenticate should just compose in the param middlewares.
16:01lynaghkibdknox: I'm actually using a noir-free fork of Fetch on this project =P
16:01wkmanireI have to admit, I really don't like the way certain expressions can end with "))))))".
16:01cemerickibdknox: see, now you need to swap out noir's ad-hoc auth stuff :-P
16:02wkmanireIf your editor doesn't do paren matching for you, it could be really difficult to deal with that.
16:02gfrederickswkmanire: well see that's where you're wrong. you DO like it.
16:02emezeskewkmanire: You need to have your editor match parens. Oh, and rainbow parens are helpful too.
16:02wkmanireemacs matches parens thanfully.
16:02wkmanirethankfully*
16:02ibdknoxlynaghk: whyyyyy
16:02gfredericksalso I think it's true that any instance of )))))) can be flattened with ->>
16:03gfredericksthough that would probably be obnoxious
16:03wkmanireemezeske: rainbow parens == different color for each level of nesting?
16:03emezeskewkmanire: yeah
16:03Iceland_jackaka Lisp on acid
16:03lynaghkibdknox: I wanted to use it as a super minimal API layer. All of my apps are static files
16:03wkmaniretechnomancy: I really really like your clojure-mode, and rainbowparens sound sexy....
16:03ibdknoxah
16:03wkmanire:D
16:04wkmaniregfredericks: what is ->>?
16:04gfrederickswkmanire: a macro that, along with ->, can clean up deeply nested s-expressions
16:04lynaghkibdknox: yeah. Once instant literal stuff gets sorted out in CLJS I might make a proper public fork and contribute back, if you'd be willing to take those patches. I think Fetch should work without Noir though.
16:05gfredericks(foo (bar baz (bang (gee (whiz (man)))))) becomes (->> (man) (whiz) (gee) (bang) (bar baz) (foo))
16:05jkkramer,(->> (range) (filter even?) (map inc) (take 5))
16:05clojurebot(1 3 5 7 9)
16:05wkmaniregfredericks: What does that do? curry them together?
16:05Iceland_jackwkmanire: it's just list manipulation
16:05gfredericksit sticks each form at the end of the next form
16:05wkmanireIs this used commonly?
16:05gfredericksI think so
16:06wkmanireIs it reserved for special circumstances?
16:06lancepantzibdknox: dude, i may have missed the conversation, but light table looks amazing
16:06solussdibdknox: ok, so bret victor's video was inspiring, light table looks like it couple become real for clojure… so… when?! :D
16:06lynaghkcemerick: so basicially this app is going to have a login route and then an authorization required fetch route to serve XHR. From the CLJS I should just be able to POST to the former, and on success use the latter as usual. Does that sound reasonable?
16:06gfrederickswkmanire: nope; it's a macro, so it works at the syntactic level
16:06gfredericksthe only concern is readability
16:06cemericklynaghk: assuming you've got the session middleware up in front (via handler/site or otherwise), yes
16:07lynaghkcemerick: awesome. Thanks again for putting this library out there. I'm glad I saved this part of the project to the end, because the timing worked out = P
16:08wkmaniregfredericks: Thanks for the explanation. And what is ->?
16:08gfrederickswkmanire: inserts in the second position (first argument) instead of at the end
16:08gfredericks,(-> 8 inc dec (+ 10) str)
16:08clojurebot"18"
16:08gfredericksI guess that example would do the same thing with ->> :/
16:09wkmanireWow, that knocked out most of the parens.
16:09gfredericks,(-> 8 inc dec (+ 10) (str "foo"))
16:09clojurebot"18foo"
16:09Iceland_jack,(->> 8 inc dec (+ 10) (str "foo"))
16:09clojurebot"foo18"
16:09gfredericksyeah; whenever you would have a list with a single element you can leave the list part out entirely and the macro adds it back for you
16:09zakwilson-> often feels like method chaining.
16:10gfredericksyeah
16:10gfredericksand ->> ends up being more useful with collections, due to the argument orders in the api
16:10gfredericks,(->> [1 34 8] (map inc) (filter even?) (clojure.string/join " -- "))
16:10clojurebot"2"
16:11wkmanireWell, I need to write some notes and then hang up clojure for the day. Otherwise I won't get anything else done. I haven't had this much fun with learning a new language in a long time.
16:11zakwilsonI agree, and Clojure wasn't my first Lisp.
16:11cemericklynaghk: Sure; ping me if you hit any further bumps. :-)
16:12lynaghkcemerick: will do.
16:12lynaghkthanks
16:12wkmanireHow do I leave a message on the lazy bot?
16:12wkmanireI've forgotten.
16:12lancepantzpaging amalloy
16:12amalloy$help mail
16:12lazybotamalloy: Send somebody a message. Takes a nickname and a message to send. Will alert the person with a notice.
16:13wkmanire$mail zakwilson I had to take off. Hopefully you'll be able to help me get swank working another day.
16:13lazybotMessage saved.
16:14wkmanirelater folks.
16:15kastermaI am trying to understand (some #{2} [2 3 4]), practical clojure doesn't seem to have #{} and I don't know how to google for it.
16:15gfredericks#{} is a set
16:15gfredericksclojure sets are also functions that return the argument if the argument is in the set
16:16gfredericks&[(#{2} 2) (#{2} 1) (#{3 4 5} 5)]
16:16lazybot⇒ [2 nil 5]
16:16kastermaAhh, thx, gfredericks! Explains it all.
16:16gfredericks(some #{2} [2 3 4]) is essentially equiv to (some #(= % 2) [2 3 4])
16:16gfredericksfor that purpose anyways
16:17kastermaThat is the purpose I had, and now I realize I should have (class #{2})
16:17kastermaThat would have given me the answer.
16:20lancepantzibdknox: will you create a lighttable channel where we can all harass you about it in the same place?
16:21edwtechnomancy: Do you know if clojure-jack-in works with lein2?
16:24gfrederickshow do I give defaults when destructuring a map?
16:24gfredericksoh it's :or not :defaults I bet
16:28Null-Alancepantz: i harassed him first
16:28Null-Ahe still hasn't answered my question
16:31edwtechnomancy: clojure-jack-in does not work with lein2, is that correct?
16:31Null-AInteractive development is not realistically feasible in most languages besides clojure because you need strong support for concurrency if you're going to have one thread executing your program and another thread changing state while the program is running
16:31llasramedw: Works fine for me
16:31edwHuh.
16:32llasramedw: Are you using the new lein-swank plugin?
16:32Null-AOnce this IDE gets developed, Clojure will have yet another compelling argument why to use it
16:32edwllasram: What is "new"?
16:32edw1.5? 1.4?
16:33llasramWell, maybe it was just new-to-me. I was running swank-clojure with lein1, running lein-swank 1.4 now
16:33llasram(with lein2)
16:34edwOK, I'm hacking at clojure-mode.el let me configure it with a specific lein binary so I can switch between 1.7 and 2, and it's dying when I run lein2.
16:34llasram?
16:34llasramclojure-swank-command didn't work?
16:35llasramEr, setting it, it being a variable and all
16:36livingstonis there any way to get a backquoted expression to read a symbol without a namesapce short of this mess `(~'x)
16:37gfredericksprobably not...what do you need it to "read a symbol" for?
16:38livingstonsymbols as data
16:38dnolenlivingston: then why not '[x] ?
16:38gfredericksit's not easy to do because it's not normally what you want to do when defining macros, which is backquote's most common use
16:39gfredericksso without knowing your higher-level purpose it's hard to suggest anything else
16:39livingstondnolen: because I need to have some other things evaluated and spliced in with ~ and ~@
16:39livingstonyeah it's not for a macro, I just need to cons up some s-expressions as data
16:39dnolenlivingston: no, there's no way to clean that up since syntax-quote is generally used for macros, and ~' is not the common case.
16:40livingstonis there a way to specify the null or no namespace e.g. what you might expect if this was legal: /x
16:41dnolenlivingston: not in a syntax-quoted expression.
16:42livingstonmost of my symbols are ns qualified, I just have a few "special" ones that don't need a ns, but I might have to give them one to avoid this :(
16:42scriptorhmm, getting some weird indenting issues with vimclojure
16:42livingstonthe reader accepts it, but is "?" a valid namespace? as in ?/x
16:42gfrederickslivingston: maybe it'd be easier to de-qualify them with clojure.walk afterwards?
16:43scriptorit seems to keep adding an extra level of indentation, but only when there shouldn't be any identation at all
16:43dnolenlivingston: the guarantees are enumerated here http://clojure.org/reader
16:43dnolenyou can't depend on behavior not explicitly described there.
16:43livingstongfredericks: I can. and will if I must. I'm just trying to do as little as possible and make the reader work for me, so that I don't have something I have to maintain
16:44gfredericksI wonder if backquote being turned into a macro would help out this situation
16:45livingstonso it looks like the namespace "?" is valid, as I'm reading the constraints on symbols.
16:47livingstonthis could be a huge sweeping re-write, but in the long run it might actually help a lot... *sigh* not the thing to discover friday afternoon.
16:47gfredericksat least it's friday the 13th
16:47hiredmanhttps://github.com/hiredman/syntax-quote
16:48gfredericks,(read-string "[~foo ~@bar]")
16:48clojurebot[(clojure.core/unquote foo) (clojure.core/unquote-splicing bar)]
16:49gfrederickshiredman: why do you def your own versions of those ^?
16:50hiredmanno, I have differently named things
16:50livingstongfredericks: oh so it is
16:51hiredmanand it wouldn't really matter if you did, because the current implementation of syntax quote is in the reader
16:51hiredmanso the macroexpander wouldn't get a chance to do anything
16:51gfredericksthe purpose is to get ` without the symbol expansion, right?
16:51gfredericksmaybe not
16:51gfredericksI don't know what this is for
16:51hiredman,[(clojure.core/unquote-splicing [1])]
16:51clojurebot#<IllegalStateException java.lang.IllegalStateException: Attempting to call unbound fn: #'clojure.core/unquote-splicing>
16:52livingstonyes backtick with no symbol expansion would be ideal in this case.
16:52gfrederickshiredman: if the usage didn't include a literal backtick I would think it could work
16:53gfredericks,'(foo ~bar ~@baz)
16:53clojurebot(foo (clojure.core/unquote bar) (clojure.core/unquote-splicing baz))
16:53gfredericksmacro just has to process that ^
16:53gfredericksbut again that doesn't seem to be the purpose of this lib
16:54hiredmanthe problem is expansion
16:54hiredmane.g. if you are just passing this through the reader macros will not get expanded
16:55hiredmanso you may as well just write a pre processor
16:55hiredmanwhich is really what you should be doing anyway
16:55lynaghkcemerick: woo, I have it all working now. I feel like I'm hacking around your framework and/or HTTP though---I'm using the "interactive-form" workflow with :redirect-on-auth? false (just serving "success: true" JSON on the POST /login route) and my own handler that serves "success: false" JSON on failure.
16:55hiredmanbefore you actually start in on the data you scan it for pattern X and change it to pattern Y
16:56gfredericksI don't understand, but I don't want to bother you further about it
16:57cemericklynaghk: That may be a common workflow for non-refreshing frontends, for all I know.
16:57cemerickYou should just use HTTP codes to indicate success and failure, though. :-)
16:57hiredmangfredericks: are you talking to me?
16:57gfrederickshiredman: yes, sorry
16:57cemerickanyway, it's hardly hacking around HTTP or the library, though.
16:58hiredmanthe purpose of my syntax-quote is to rewrite syntax-quote as a macro so it could/can be moved out of the reader
16:59lynaghkcemerick: yeah, I have no idea what non-refreshing frontends do. I kind of get the impression everyone just hacks it together somehow, but I'll dig into it and see what's what.
16:59lynaghkcemerick: and yeah, status codes sound good. If only because they're a great excuse to look at http://httpcats.herokuapp.com/
17:00cemerickthat's the only way I use 'em :-)
17:01gfrederickshiredman: and I was talking about isolating the sexp-templating part of the functionality and trying to implement that by itself. as far as I understand things it could be done with a macro that's compatible with the unquote syntax; if that's what you were objecting to, then I don't understand why "the reader macros will not get expanded" -- everything I'm thinking of happens after read-time
17:02kennethhey, so i
17:03kennethso i'm working on a clojure script to process and import a massive dataset into a mongo db, and i have a simple php script that does the same thing to benchmark it against
17:03kennethit runs orders of magnitude slower: the php script did 100k items in 12s, clojure has been running for 15min on 100k items and is still not done. what am i doing wrong?
17:03kennethhttps://gist.github.com/df78a51e447c3a7f80bf
17:04hiredmankenneth: you are doing it sequentially
17:05kenneth(also couldn't figure out how to use cli params on a `lein run` so i had to hardcode the filename in the script)
17:05kennethhiredman: in php i'm doing it all in one big while loop, sequentially, i even tried to parallelize in clojure using (seque 50 …)
17:05hiredmanseque does not parallelize
17:06hiredman(doc seque)
17:06clojurebot"([s] [n-or-q s]); Creates a queued seq on another (presumably lazy) seq s. The queued seq will produce a concrete seq in the background, and can get up to n items ahead of the consumer. n-or-q can be an integer n buffer size, or an instance of java.util.concurrent BlockingQueue. Note that reading from a seque can block if the reader gets ahead of the producer."
17:06franks42Need some help understanding what it would take to implement a meta-data protocol for classes/deftype... (http://dev.clojure.org/jira/browse/CLJ-304)
17:07hiredmankenneth: clojure.data.json is also the *slowest* clojure json library I've seen
17:07franks42Is the idea to define an interface/protocol to meta-data for the java.lang.Class class and store the meta-data map in a java-annotation?
17:08y3diomg this granger do some cool shit again
17:08kennethhiredman: i thought that that would let the new seq get ahead of the current item by 50, ie. it'd always process 50 concurrently, ie. wouldn't wait for item 1 to be finished processing before starting 50
17:08hiredmankenneth: no
17:10kennethhmm, crap. okay might have to revisit that, then. do you think that's why my performance is laughably bad?
17:10franks42chouser: are you around? would you mind to momment on http://dev.clojure.org/jira/browse/CLJ-304 ?
17:13septominso is ibdknox's thing real or just a faked demo (trollface)
17:13hiredmankenneth: I think mongo is junk, so who cares how fast you can write to it
17:13dnolenseptomin: real.
17:14dnolenkenneth: regardless of hiredman's opinion of Mongo, it's very hard to say w/o profiling. If you can't load the data as fast as PHP something is up.
17:14kennethhiredman: i quite like mongo. it can be a bitch to scale effectively.
17:14kennetheither way, though, mongo is not the issue in this case, since the same php script that does the same query on the same file runs 100x faster
17:14hiredmanhttps://github.com/dakrone/cheshire note the SPEED section
17:15hiredmankenneth: if it doesn't scale well then what is the point? just use a nice sql database
17:16hiredmanyou just gave up the power of the relational model for nothing
17:17kenneththat's a huge controversial debate and there's good points on either side. for us, the trade off was worth it, and we've managed to scale quite effectively, even though there was some pain
17:17hiredman*shrug*
17:18kennethbut we serve > 1B requests a month on mongo effectively, so it works out alright
17:18hiredmanso?
17:18gfredericks,(/ 1000000000 (* 30.5 24 3600))
17:18clojurebot379.47783849423195
17:19kennethhttps://github.com/mmcgrana/clj-json -- is this a good option?
17:19Wild_Catwe have Mongo running 2500+ queries per second and it works out all right.
17:20dnolenkenneth: it uses jackson so it's pretty fast.
17:21kennethok script just finished, 13m in clojure, 12s in php
17:21kennethgonna try to use the other json lib
17:21dnolenkenneth: you can keep trying libs or profile.
17:21kennethdnolen: i have no idea how to profile clojure. do you have a link / direction?
17:22dnolenkenneth: http://visualvm.java.net/
17:22dnolenkenneth: you can attach to the Clojure process.
17:23dnolenkenneth: if a sequential Clojure version doesn't take < 12s then something is wrong.
17:23pjstadigkenneth: you want to parse JSON on JVM Clojure?
17:24jsabeaudrykenneth, keep us updated, I'm still trying to figure out why ajax request on my local server take up to 200ms for trivial stuff and the JSON might play a role
17:26dnolenkenneth: also there's no guarantee that monger itself is tuned for perf. looks like they use clojure contrib JSON.
17:34kennethok, is there an efficient way to keep a mutable count of how many items have been processed?
17:35dnolenkenneth: use an atom.
17:35cemerickMan, this JDK 1.5 thing is getting to be a real drag.
17:36ibdknoxwhat'd I miss?
17:36cemerickibdknox: REPL stuffs killing on 1.6, and bombing hard on 1.5.
17:37ibdknox:(
17:37ibdknoxseptomin: totally fake, I'm pretty sure he has the most elaborate mirror setup you've ever seen.
17:38dnolenibdknox: :P
17:38septomini heard there was actually a guy in a box behind the screen, moving the variables around
17:39ibdknoxthese are not the vars you are looking for
17:39septominso are you working on this "for real" then?
17:40ibdknoxI'm not sure to be honest
17:40ibdknoxI'm a bit surprised at the response
17:40ibdknoxand I've got lots of interesting people to talk to it sounds like
17:40septominit's just a thing that seems obvious we should have and yet don't
17:41septominthat tends to get people interested!
17:41ibdknox:)
17:42alexykwhat's the status of incanter? I see some pull requests merged but not much activity from @liebke
17:45kenneth,(deref (atom 10))
17:45clojurebot10
17:48raekkenneth: it's even more efficient if you can manage to keep the count in a function parameter or a loop binding and recur
17:48raekbut then it's not really mutable
17:48kennethdnolen: hmm, visualvm seems to be a GUI app. is there anything CLI? i'm running this on a fire walled server cluster with no GUI
17:49dnolenkenneth: I'm only familiar with VisualVM and YourKit
17:50arohnerkenneth: there's jconsole, which has some of the same functionality, but not a complete replacement
17:50arohnerX forwarding is another option
17:51amalloykenneth: most reasonable profilers connect to remote apps. so you probably want to forward a port through the firewall and run the gui remotely
17:53kennethok i'll give that a shot
17:53kennethyour kit any good?
17:54dnolenkenneth: your use of dorun is suspect. you probably want doseq. Your script might be thrashing in GC if it's that slow.
17:54kenneth(doc dorun)
17:54clojurebot"([coll] [n coll]); When lazy sequences are produced via functions that have side effects, any effects other than those needed to produce the first element in the seq do not occur until the seq is consumed. dorun can be used to force any effects. Walks through the successive nexts of the seq, does not retain the head and returns nil."
17:54kenneth(doc doseq)
17:54clojurebot"([seq-exprs & body]); Repeatedly executes body (presumably for side-effects) with bindings and filtering as provided by \"for\". Does not retain the head of the sequence. Returns nil."
17:55dnolenkenneth: also you should start the script with the server flag set and a good amount of memory.
17:57kenneth(doc doall)
17:57clojurebot"([coll] [n coll]); When lazy sequences are produced via functions that have side effects, any effects other than those needed to produce the first element in the seq do not occur until the seq is consumed. doall can be used to force any effects. Walks through the successive nexts of the seq, retains the head and returns it, thus causing the entire seq to reside in memory at one time."
17:57dnolenkenneth: https://gist.github.com/e0fb72743c3c9d94d646
17:59dnolenkenneth: http://groups.google.com/group/clojure/msg/1b45c27dc4627b99
18:01kennethhmm
18:01dnolenkenneth: if that gist doesn't work for you after giving the JVM a reasonable amount of memory and setting the -server flag - then I'd take serious look at a profiler.
18:02dnolenkenneth: whenever people show up asking why Clojure is orders of magnitude slower than X it boils down to 2 things.
18:02dnolen1) GC thrashing
18:02dnolen2) Reflection
18:02hiredman(also using line-seq when you where advised against it)
18:03pipelinethat particular example
18:03pipelineis one of the places old school CL implementations are good
18:03pipelineyou never doubt how much one function implementation versus another conses in cmucl
18:03pipelinebut we're on the jvm, so, live with jvm tools :\
18:04alexykso anybody using in canter nowadays here?
18:06kennethok, so i've got it down to executing the whole thing minus the mongo part both in clj/php. clj does it in 2.3s, php in 1.2s. seems acceptable
18:07dnolenkenneth: did you try CongoMongo?
18:08kennethi did not, will try
18:08hiredmankenneth: how are you timing this?
18:08kenneth`time php …`
18:08kenneth`leon repl; (time (import-file "…"))`
18:10dnolenkenneth: and how are you running the Clojure?
18:12kennethdnolen: what do you mean?
18:12kennethalso i haven't figured out how to do the server flag / set max memory yet, trying to look that up. lein doesn't like flags on the cli, and uberjar gives me a jar that exceptions out when run (can't find importer.core)
18:19dnolenkenneth: if you're using lein run - you're probably seeing the cost of starting JVM compiling all of Clojure and your script - then running it. so the actually time spent doing work is probably a small slice of 2.3s.
18:20kennethwell i'm doing (time …) in clojure in the repl
18:20kenneth`time lein run` is actually 7.5s or so, with 5s of start the hvm
18:20kennethdnolen: ^
18:20dnolenkenneth: ah k.
18:27kennethcongomongo doesn't seem to support upsert
18:27kennethdoes it?
18:32mdeboardIs clojure-hadoop the standard lib for working with hadoop still?
18:33amalloyof course it does
18:33amalloyit's true by default iirc
18:34jayunit100http://en.wikipedia.org/wiki/JSONP this makes me think about macros
18:36jayunit100mdeboard : Unless your doing something complex you don't really need a custom lib for doing hadoop via clojure - i would consider using the standard lib and calling the java functions. They are easily callable from clojure b/c the m/r api is pretty simple. Alternatively, use streaming.
18:36mdeboardEh I like the ease of the defjob abstraction
18:37mdeboardStreaming isn't an option
18:45sritchiemdeboard: have you used cascalog?
18:45kennethif the doc says: ([collection old new {:upsert true, :multiple false, :as :clojure, :from :clojure}])
18:45kennethis the correct syntax (update! :collection {old…} {…} :upsert true)
18:45kennethor (update! :collection {old…} {…} {:upsert true})
18:45sritchieit's a much higher level abstraction over Hadoop
18:46sritchiejayunit100: even for simple stuff, it's much easier than setting all these damned formats, etc --
18:46sritchietuples and tuples
18:46sritchietuples and taps, ratehr
18:46sritchierather*
18:46mdeboardsritchie: Well, I'm just learning about Hadoop and mapreduce jobs in general. I know what Cascalog is and what it does, but I'm still fumbling around with general concepts of hadoop
18:47sritchiemdeboard: cascalog sort of protects you from all of that jank
18:47sritchieand eases you in slowly :)
18:47sritchiebut go for it, good to get a handle on the low level
18:47mdeboardsritchie: In what way?
18:47sritchieyou don't have to cast your problem in terms of manipulations of key-value pairs
18:48sritchieyou can use tuples of multiple fields, group on those fields without writing custom comparators, etc
18:48sritchieit's really hard to do that stuff in MR
18:48sritchiealso, you can use any clojure function and data structure out of the box w/ cascalog
18:48mdeboardYeah, I'm trying to parse some log files as an exercise, it's kind of hurting my brain
18:49sritchiemdeboard: I definitely recommend cascalog for that
18:49sritchiegot an example, 1 sec
18:49kennethexcellent, switching to congomongo fixes the performance issues
18:49kennethi have the whole thing running in 14s, which is almost as good as php's 12s
18:49sritchiehttps://gist.github.com/7627b0c9cdf4c9e551b7
18:49sritchiemdeboard: ^^
18:49mdeboardI started with cascalog but it kind of seemed like I was missing something so I went for a dive into lower level stuffs
18:50mdeboardhm
18:50mdeboardhuh
18:50mdeboardsritchie: Thanks, this is actually really helpful
18:51sritchienp
18:51sritchiehappy to help w/ anything
18:51sritchiefeel free to head over to #cascalog
18:52bbloomi'm going through some #clojure logs looking for a faster way to build sorted sets. in particular i found this conversation: http://clojure-log.n01se.net/date/2010-02-04.html#11:01
18:53bbloomi'd like to be able to quickly save/load reasonably large sorted sets for a database-index-like operation i'm doing
18:54bbloomi can use transients or something when loading vectors, which is much faster, but it doesn't seem like there is an efficient way to load pre-sorted data
18:56kennethif anybody can find more stuff to critique in my new code: https://gist.github.com/df78a51e447c3a7f80bf
18:56kennethi have the performance to be almost as good as the equivalent php script, but not completely. i'm okay with this though
18:57hiredmanbbloom: have you considered using an embedded sql server?
18:57kennethi'd be interested in hearing if you have any ideas of how to implement parallelism / concurrency, so i can process, say, 10 lines at a time
18:58bbloomhiredman: nope. once my datastructures are in memory, everything is fast and simple & nice… the issue is loading a saved sorted-set is slower than i'd like
19:00bbloomideally, i'd like to serialize the internal structure of the sorted-set… so that no rebalancing etc needs to happen on load
19:00hiredmanbbloom: sure, but switching to something like derby or hsqldb (which can persist data to disk) might be easier than figuring out how to store a sorted set
19:01jayunit100i want to try cascalog to we need a query language thats more dynamic than hive.
19:02bbloomhiredman: and bring along a lot of other stuff i don't want or need :-P
19:03hiredman*shrug*
19:04gfredericksI am using the aleph http client and having trouble when the request has a body; the effect is that the result channel gets nil enqueued for some reason
19:04gfredericksno explicit failure that I can tell
19:09devnhow can I scroll to the bottom of the page using clojurescript + google closure?
19:19dnolenbbloom: you could re-implement PersistentTreeMap in Clojure and support that. would simplify getting that into ClojureScript as well ;)
19:19bbloomdnolen: haha i was just thinking about that
19:20bbloomi'm reading PersistentTreeMap.java
19:20dnolenbbloom: it's not crazy amount of code and we definitely want that in CLJS :D
19:22bbloomdnolen: yeah, looks like this file is 1,000 lines and doesn't have any real dependencies
19:22wei_I'm sending a series of http requests, and I want to block until either I receive a response (via callback function) or 1 second has passed. what's the clojurey way to do this?
19:22bbloomwhat I really need is a way to get to the private red black tree & the private constructor which accepts such a tree node
19:23wei_the callback function lives inside a proxy- so I think that complicates things a bit
19:24bbloomdnolen: cljs just got persistent hash maps right? no one is working on persistent tree maps?
19:24dnolenbbloom: so probably means 450 lines of CLJ tops ;)
19:25dnolenbbloom: yes mmarcyk is working on PHMs. We still need to assess.
19:25dnolenbbloom: probably stick w/ ObjMap for small sizes and bump up to PHM when update time dominates ObjMaps
19:26bbloommakes sense
19:27bbloomis there any stance for or against migration of core data structures form java to clj ?
19:27bbloomfrom* java
19:28bbloomignoring cljs for a moment
19:28dnolenbbloom: not really beyond low priority since we already have them working in Java.
19:28bbloommakes sense. and we'd expect the perf to be comparable? i've gotten good perf out of clj, but don't know relative to java "natively"
19:29dnolenbbloom: case where you might get more response - new better stuff. Like RRB-Tree in CLJ
19:29wei_^ just looping back.. I think I can do that with a promise
19:29dnolenbbloom: perf should be competitive, all the tools are there to accomplish this, see gvec.clj
19:30dnolengvec.clj is a bit of complex case since gvec can store types beyond objects. But it shows competitive perf w/ Java is possible.
19:30eggsbyaleph looks interesting
19:30dnolenbbloom: certainly if you want to get something into CLJ I think it would need to be as fast as if you'd written it Java.
19:31bbloomdnolen: what exactly is this gvec file?
19:31bbloomwhat uses it?
19:31dnolenbbloom: clj/clojure/gvec.clj
19:31bbloomyeah, i have it open
19:31bbloombut i also have PersistentVector.java open
19:31bbloom:-)
19:31dnolenbbloom: nothing uses it, but people can use it if space dominates.
19:33dnolenbbloom: a gvec of bytes, char will be much smaller than the standard PV
19:33bbloomah, i see vector-of
19:34bbloominteresting
19:42bbloomdnolen: I could also just do a little bit of evil reflection to get at the Node implementation and the constructor i'd need… heh
19:44bbloomit's a shame that the serialization format wouldn't really be general enough. the reader would need to be able to read the comparator
19:44bbloomfor a sorted-set, that is
19:46bbloom=> (binding [*print-dup* true] (println (sorted-set-by #(compare (:foo %1) (:foo %2)))))
19:46bbloom#=(clojure.lang.PersistentTreeSet/create [])
19:46bbloomsadly loses information
19:46hiredman(hypersqldb...)
19:47bbloomheh
19:49bbloomhiredman: i have a very particular query pattern that i'm optimizing for. i got much better results out of intersecting zsets on redis than i did out of postgres. i'm getting comparable results in memory with clojure, avoiding the complexity of another networked server for durability
19:49dnolenbbloom: thus I think constructing a new type to do this better instead of trying to bend what exists to your will.
19:49dnolenbbloom: it's an interesting idea to explore, I think has some neat implications for CLJS, higly optimized loading of data structures.
19:50dnolenbbloom: but trying to reuse the existing data structures for this is a waste of time IMO.
19:50RaynesI am in West Hollywood. :D
19:50bbloomdnolen: the issue is that i don't want to throw out some of the really nice core libraries that are hard coded against clojure.lang.Sorted — subseq for example
19:51bbloomalthough i just started thinking about this
19:51bbloomi guess i could implement Sorted :-P
19:51dnolenbbloom: yep
19:51dnolenbbloom: your new thing can interop with everything because that's how Clojure was designed.
19:51bbloom:-)
19:51amalloyhey Raynes, welcome
19:52Raynesamalloy: :D
19:55bbloomdnolen: i think i'm just gonna ignore optimizing loads for now & see how far i can get without it… if it gets too slow, i'll investigate rewriting PersistentTreeMap&Set in clj. If I do that, I'll make sure it runs on cljs. Note that there are a lot of "IF"s in that sentence
19:56muhoowhat is #= and where is it documented?
19:56dnolenbbloom: sounds like a plan ;)
19:56dnolenmuhoo: it's not documented and probably won't be.
19:58muhoowhat does/did it do though?
19:59bbloommy understanding is that it's a reader macro used by *print-dup* for ensuring the loaded type matches the printed one
19:59muhooah, thanks
19:59bbloom,(binding [*print-dup* true] (print-str {}))
19:59clojurebot"#=(clojure.lang.PersistentArrayMap/create {})"
20:19muhoowhy would one use ::foo instead of :foo?
20:20muhooi understand what's different-- ::foo is really :user/foo-- , but my question is, why would you use it?
20:21dnolenmuhoo: to prevent clashes.
20:21dnolenmuhoo: keywords are also used to create hierachies for multimethods.
20:22muhoothanks
21:03kennethwhoops
21:03kennethaccidentally added 10 million records to the wrong db
21:03kennethdamnit congomongo
21:07muhoodamn hammer keeps hitting me in the thumb :-)
21:18rhcsorry for the noob question, but how do you switch from the repl buffer to the clojure buffer in emacs? i'm trying C-c C-z like this says https://github.com/technomancy/swank-clojure/blob/master/README.md
21:18kastermaC-x b is the switch buffer function.
21:19rhcah, thanks
21:19rhcfigured it was finally time to learn emacs :)
21:25muhooit's good to know emacs, but you can use clojure from a bunch of other editors/ide's too, fyi
21:28muhoohuh, that's weird. org.openid4java:openid4java-consumer:jar:0.9.6 supposedly depends on org.apache.maven:super-pom:pom:2.0, but super-pom 2.0 is not in maven central?
21:30kennethwoohoo
21:30kennethall this work has paid off
21:31kennethmy clojure importer is getting like 2x the performance than the php script did
21:31septomin_kenneth: what were the main bottlenecks?
21:32kennethin clojure or php?
21:32septomin_in the clojure version
21:32kennethi was getting 100x worse in clojure when i started
21:32kenneththe json parsing library i was using was ridiculously slow
21:33kenneth(data.json from contrib)
21:33muhoooh, that's old. you've switched to cheshire?
21:33kennethno, using clj-json
21:33muhoosupposdely cheshire is e'en better
21:33kennethseemed equivalent from the mechmark on cheshire's page
21:34kenneththe other thing was monger is also ridiculously slow
21:34kennethno idea why, but switched it for congomongo
21:34kennethand had to rewrite some funky code, i think i was not understand (seque …) right
21:34kennethso i'm doing it sequentially now, instead of attempting to parallelize
21:34muhoogreat, good to know!
21:37alex_baranoskyif I want to call a private function I can just access the var
21:37kenneththis is the final code btw. i'm sure i could probably shave off a couple more issues if i tried, but i don't know enough to—https://gist.github.com/df78a51e447c3a7f80bf
21:37alex_baranoskythat approach seems to be failing me when trying to use a private macro
21:38gfredericksalex_baranosky: if you do it that way you end up calling the macro as a function, right?
21:38gfredericksat runtime rather than compile-time?
21:38gfredericks,(#'and false false true)
21:38clojurebottrue
21:38alex_baranoskyyeah I figured... Is there any way to get at this code without copy-n-paste?
21:39alex_baranosky,(#'let [x 3] x)
21:39clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: x in this context, compiling:(NO_SOURCE_PATH:0)>
21:39gfredericksyou might be able to def a local macro that defers to the other one
21:39alex_baranoskylet me try that
21:40gfredericksor maybe there are some plumbing commands for macroexpansion that you could call manually... :/
21:40gfredericksalex_baranosky: be careful that you pay attention to the first two args, which are special
21:40gfredericks&env and &form I think?
21:40lazybotjava.lang.RuntimeException: Unable to resolve symbol: env in this context
21:41alex_baranoskydon't see &env and &form being useful here
21:41gfredericksalex_baranosky: right but the first two args to a macro are those two things
21:41gfredericksthus ##(#'and false false true)
21:41lazybot⇒ true
21:41gfrederickswhereas ##(and false false true)
21:41lazybot⇒ false
21:42alex_baranoskyoh, funky
21:42alex_baranoskyI see
21:43alex_baranoskygfredericks, there seems to always be something new to learn
21:43gfredericksso you could maybe pass them through (though not sure which order), but since your private macro probably doesn't use them it probably doesn't matter
21:43gfredericksalex_baranosky: heck yes there does.
21:44muhoosorry for the stupid question, but why not make the macro public then?
21:44alex_baranoskyI didn't realize you could call a macro as a function like that
21:44gfredericksusually I learn by saying something and then amalloy corrects me
21:44gfredericksmuhoo: probably not his code
21:44alex_baranoskyyeah, dude's a machine
21:44alex_baranoskynot my code
21:44alex_baranoskyI could copy and paste
21:44alex_baranoskybut I hate doing that
21:44alex_baranoskyplus, I'm learning stuff now :D
21:45gfrederickscalling a macro as a function might be secret unsupported behavior; but if you're trying to call private things that's probably not something you care about
21:45alex_baranoskyI'm doing somethign wrong
21:45gfrederickswut ur macro look like
21:46alex_baranosky(defmacro defnilsafe2 [a b c]
21:46alex_baranosky (list #'incubator/defnilsafe nil nil a b c))
21:46gfredericksI think if you remove the word list it'll work
21:46gfredericksyou're probably trying to emit code that calls the other macro, when you really want to actually call the other macro
21:46gfredericksand return the result of that from your macro
21:46alex_baranoskythat makes sense, since it is happening at compile time
21:47alex_baranoskyBAM!
21:47gfredericksBAM!
21:47alex_baranoskythanks
21:47alex_baranoskythat did the trick
21:47gfredericks~bam
21:47clojurebotPardon?
21:47gfredericksclojurebot: bam is BAM!
21:47clojurebotAck. Ack.
21:47gfredericks~bam
21:47clojurebotbam is BAM!
21:47muhooemiril iin the house
21:47gfrederickshmmm
21:47gfredericksI've forgotten how to make him leave off the first part
21:47alex_baranoskyfeels great to learn that new piece of Clojure tonight
21:48gfredericksclojurebot: forget bam
21:48clojurebotGabh mo leithscéal?
21:48alex_baranoskydo you know if &form or &env comes first?
21:48gfredericksnope
21:48gfrederickseasy to find out though now that I think about it
21:48muhoocloujurebot never forgets :-)
21:48gfredericksform then env
21:49alex_baranoskyI'm adding nilsafe arrows to the swiss-arrows project
21:49gfrederickswtharetheswiss-arrows
21:49alex_baranoskyfinal macro: (defmacro defnilsafe2 [docstring non-nilsafe nilsafe]
21:49alex_baranosky (#'incubator/defnilsafe &form &env docstring non-nilsafe nilsafe))
21:50alex_baranoskygfredericks, https://github.com/rplevy/swiss-arrows
21:51gfredericksoh man I've wanted some tricked out arrows before
21:51alex_baranoskyI'm falling in love with the diamond wand
21:53gfredericksoh crap that diamond wand is slick
21:54gfredericksI was imagining you'd give an index but that was a terrible idea
21:55alex_baranoskyI feel like it makes code like this clearer: https://github.com/marick/Midje/blob/master/src/midje/ideas/facts.clj#L80
21:55alex_baranoskyI don't think it is the normal solution, but sometimes ->>/-> aren't as easy to read imo
21:56gfredericksyeah I think otherwise you'd use an outer (->) with a single ->> on the fourth line
21:56alex_baranoskyor wrap a funciton in #( ... % ...)
21:56gfredericksyeah it's ewy :(
21:56alex_baranoskyand even then in long forms like that it becomes confusing where the arguments are getting put
21:57gfredericks<<- looks interesting too
21:57muhooi am very glad to have <> for cases where i can't gerrymander the args i want to thread into the first or last
21:57muhoothough, i have to say, rhickey seems to have put a LOT of work into making functions threadable by either first or last arg
21:58gfredericksthere are some things arrows can buy. for everything else, there's the diamond wand.
21:58alex_baranoskyI agree I do -> then ->>, then -<> when the first two don't look clean
22:00gfrederickswelp. I'm using this from now on.
22:01alex_baranoskyI just submitted a pull requesto adda nilsafe wand, -?<>
22:01gfredericks-<?> will have some other behavior presumably
22:01gfredericksperhaps questionable behavior
22:02alex_baranosky-?< would fork to a random path
22:02gfredericksyeah I was just thinking of a randomized version
22:04gfrederickslisp has existed for decades but we still don't have vertical lists
22:29jayunit100howcome you cant dereference a list outside a macro ?
22:29jayunit100 @(list 3)
22:29jayunit100,@(list 3)
22:29clojurebot#<ClassCastException java.lang.ClassCastException: clojure.lang.PersistentList cannot be cast to clojure.lang.IDeref>
22:30jayunit100ooops i meant
22:32jayunit100the thingy where you "unlist" a list... i.e. bring all its elements up one level.
22:32gfrederickssplice-unquote?
22:32alex_baranoskyyou can
22:32jayunit100splicing yup
22:32alex_baranoskyit just has to be done inside of syntax quote:
22:32gfredericks,`(foo bar ~@[4 5 3] haha)
22:32clojurebot(sandbox/foo sandbox/bar 4 5 3 ...)
22:32alex_baranosky,`(~@[1 2 3])
22:32clojurebot(1 2 3)
22:32jayunit100hmm okay i was doing '
22:33alex_baranosky' is quote
22:33jayunit100(~@'(list 3))
22:33jayunit100,(~@'(list 3))
22:33clojurebot#<IllegalStateException java.lang.IllegalStateException: Attempting to call unbound fn: #'clojure.core/unquote-splicing>
22:33alex_baranoskyquote is much less complicated
22:33alex_baranosky,'foo
22:33clojurebotfoo
22:33jayunit100,(~@(qoute (list 3)))
22:33clojurebot#<CompilerException java.lang.RuntimeException: Unable to resolve symbol: qoute in this context, compiling:(NO_SOURCE_PATH:0)>
22:33yoklov,`(~@'(list 3))
22:33clojurebot(list 3)
22:34yoklov,`(~@(list 3))
22:34clojurebot(3)
22:34jayunit100Ah oops okay
22:34alex_baranoskymisspelled quote there jayunit100
22:34jayunit100:)
22:34jayunit100yup
22:36jayunit100Why do we need that syntax quote.
22:36jayunit100I mean, in a normal macro it makes sense, but in this case, I would think that the splicer should still work
22:36jayunit100macro or not, splice should... splice ? right.
22:37ibdknoxit is
22:37ibdknoxwhat does that splice turn into?
22:37ibdknox(list 3) => 3 :)
22:37gfrederickssyntax quote and normal quote are two different kinds of quoting
22:37gfredericksthe difference between them is independent of whether or not you're using them in a macro
22:38gfrederickssyntax quote has splicing, normal quote doesn't
22:38ibdknox~@(list 3) => list 3
22:38clojurebotNo entiendo
22:38ibdknoxand then you wrap it in parens
22:38ibdknoxcausing it to execute
22:40ibdknoxnm, that's not really true
22:51alex_baranoskyibdknox, so how far is LightTable from being usable :)
22:52gfredericksand what will be the monthly cost for using HeavyTable
22:54alex_baranoskyalso, will it come with paredit?
23:00yoklovwait, syntax-quote is different than quote?
23:00yoklovi thought it was just like quasiquote
23:00yoklov(from scheme)
23:00yoklovoh, it also resolves symbols?
23:01gfredericksresolves symbols and does the insertion thing and also the foo# symbols
23:01gfredericks&['foo# `foo#]
23:01lazybot⇒ [foo# foo__6774__auto__]
23:01yoklovoh, didn't know the foo# only worked in syntax quote
23:03yoklovstill makes lists though.
23:04yoklov(unlike rackets syntax-quote, which make syntax objects, which are like lists but the compiler yells at you _much_ more)
23:05gfredericksthat sounds...strange
23:23yoklovits really annoying, to be honest. it's for hygene, i guess.
23:26yoklovanother reason i'm happy to be writing clojure :p
23:53muhooibdknox: congratulations, you win HN today