#clojure logs

2010-06-22

00:38riddochcA point of trivia: a google search for java logging over-engineered gives me "About 125,000 results"
00:39maelol
00:47riddochcAnybody tried buildr for clojure projects?
00:51riddochc(not implying that it's either a good or bad idea, I've not used it.)
04:02alexykhow do we cutely sum a seq ([x y] [x' y'] ...) into [(sum x x'..) (sum y y' ...)]?
04:03Chousukealexyk: (apply map + seqs)
04:04Chousukewith a vec in front to convert to a vector if you really need to
04:05alexykChousuke: why does this work? :)
04:05Chousukealexyk: well
04:05alexyk,(apply map + [[1 2][3 4]])
04:05clojurebot(4 6)
04:05Chousuke,(map + [1 2] [1 2] [1 2])
04:05clojurebot(3 6)
04:05Chousukeso just use apply to get the args from the seq
04:06alexykright; it's late and I don't click with + getting into each positional sum
04:06TheBusbyit's a cool feature of map
04:06TheBusbynot exactly intuitive though
04:07alexykTheBusby: so how do you intuit it?
04:07alexykit's reduce in fact
04:07Chousukeit's as intuitive as mapping over more than one seq can be :)
04:07alexykarrgh!
04:08alexykah ok got it
04:08TheBusbyChousuke: very true
04:08Chousukeit's very useful though so even if it's not obvious it's good that it's there :P
04:08alexykbrrr... I leaned Haskell in the last two weeks and translated my Clojure project into it and also OCaml. A grandiose shootout will come.
04:08alexykteh amazing result is, Clojure holds its own
04:09TheBusbywhen I discovered that property of map I instantly loved it
04:09Chousukedid you also try to make the haskell code idiomatic?
04:09alexykChousuke: it was helped by other folks and killed Haskell's runtime.
04:09Chousukeusing currying and composition is much more common in haskell than in clojure.
04:09Chousukeheh
04:10alexykJVM is a pretty valuable thing, it turns out, when GC is involved
04:10ChousukeI like haskell, though I haven't invested much effort into it
04:10alexykOCaml is usually much faster, but not quite here
04:10Chousukehaskell's just good for the concepts
04:11Chousukeand the type system is just awesome
04:11TheBusbyhehe, haskell makes you a better clojure developer
04:11Chousukecertainly.
04:11Chousuke(and probably the reverse applies too)
04:11alexykChousuke: you're saying that Scala makes one a better Clojure developer then :)
04:11alexyksince Scala is ML on JVM in a way
04:12eevar2scala is too large and bloated ;)
04:12Chousukealexyk: I dunno, does scala have type classes and currying and monads? :P
04:12alexykeevar2: can something be bloated but not too large? :)
04:12alexykChousuke: like, yeah? :)
04:13alexykeevar2: or, too large but not bloated? (well a healthy elephant can be)
04:13ChousukeI know next to nothing about scala
04:13alexykand a small frog can be bloated but not too large
04:13eevar2alexyk: how about lazyness and purity?
04:13Chousukeexcept that every code example I've seen has scared me :P
04:13eevar2like harrop?
04:13alexykeevar2: lazy you can be, and pure too!
04:14alexyklazy is explicit keyword, Stream's a seq, and all containers are either imperative or pure, you pick
04:15alexykeevar2: you'd kill jdh with that analogy :)
04:15alexykin any case clojure's an amazing little mouse
04:15alexykonce I'm done checking, I'll post the code so you guys can speedify it even more
04:15alexykhaskell, ocaml and clojure to start with; only for FP langs
04:16alexykscala will come later when I get time
04:16TheBusbynot doing factorial are you?
04:16alexykTheBusby: Twitter graph mining mind you
04:16TheBusbyOoooooh
04:16alexykyou'd need a 64 GB box to compete
04:16alexyk32 GB min
04:17TheBusbyI'll definitely be interested in this then
04:17alexykTheBusby: I'll post to the clojure group soonish :)
04:17alexyklater...
04:17TheBusbythank you, I'll be looking forward toit
04:55serp_.commadns
07:47sparievhi, is it possible to change log level per thread with log4j ?
07:47Licensergreetings spariev and I'm sorry I don't know
07:47sparievnot really clojure-related question, sorry
07:47sparievhi Licenser
07:48Licenserno reason to be sorry, people here are usually more friendly and more helpful then in #java :(
07:51cemerickspariev: you can bind a log4j logger, and set whatever level you want on it. That's not a per-thread log level, but achieves the same result.
07:52cemerickJust make sure the logger's prefix is such that it finds the parent logger you'd like to have its messages flow through
07:53cemericksomething like (Logger/getLogger (str (.getName *ns*) \- (.getName (Thread/currentThread)))
07:53Licenserit seems 95% of the clojure proects are either wrapper libraries (making java stuff clojury) or in she rare cases that are not java interfaces they are data heavey (as in list vecs maps) or string heavy
07:54sparievcemerick: very cool, thanks, I'll try it
07:54cemerickLicenser: trying to find some testcases for the numerics changes?
07:54sparievjava logging frameworks never cease to amaze me
07:54Licensercemerick: yes, mostly I want to get my hands one some code that would be actually benefit from the changes and that is really hard
07:54cemerickspariev: indeed, they're quite flexible ;-)
07:54LicenserI don't have any and about every
07:54Licenser#
07:55Licensernamed clojuran seems not to have any either - at least not on github
07:55cemerickwe've got a fairly large body of math-heavy code, but I'm nowhere near it at the moment
07:55Licensercemerick: what I want to do is to actually see how the changes (either direction) would impact people
07:55Licensercemerick: how much have you optimized it? because if it is already optimized then there'll be hardly any changes I fear
07:56cemerickI didn't write it, so I can't say. :-)
07:56Licenserbut if you get near it and it is open enough that I could get a copy for playing with it I'd be very grateful
07:56Licenserheh
07:57Licenserwhat I'd love for some tests is code that A) does some math but isn't purely math B) is benchmarkable C) isn't optimized too much
07:57LicenserI know that is much to ask for but oddly enough I have problems to find anything that at least satisfies A
07:58LicenserI slowly get the feeling that noone will actually notice the changes, whatever they are since it is not what clojure is used for
07:59LicenserI see a lot of working with seqs, transforming data, sometimes string manipulations, tons of java interop but in many projects you've a hard time to find a + at all o.O
07:59cemerickPeople that do math-heavy things are unlikely to be releasing it as open-source, unless they're just tinkering.
07:59Licenserand if you do it is so rare and in so unimportant places that it does not seem so irrelevant that the impact is minor
07:59karmazillacemerick: be careful about get'ting log4j loggers with generated names
08:00Licensercemerick: might be, then again I don't look for math heavy I am already hapy with math at all
08:00cemerickkarmazilla: hrm, do they hang around in perpetuity?
08:00karmazillayes
08:00LicenserI think about our every day work not the few special cases
08:01cemerickGood to know. If the generated names are namespace + thread name, that's not a very large set of generated names. *shrug*
08:02cemerickLicenser: I think it's pretty safe to say that there's a lot of math going on, given the survey results. Math is often close to where real money is made though, so people are far less likely to share from that department.
08:02Licenser*nods*
08:02Licenserbut it's hard to reason about if people don't share
08:03LicenserI've seen claims that things are 10% faster, but I didn't found any examples for it. The one incanter example I found that actually took some time even got 10% slower with the equal branch
08:05cemerickAs you said, stuff that's already in a loop body and hinted properly isn't going to get any boost -- that stuff was already essentially running at Java speeds.
08:06Licenser*nods*
08:06cemerickit's the cross-fn stuff that'll benefit most, and presumably there'll be less cognitive overhead in order to get optimized behaviour across the board.
08:06Licenserwell the cross fn stuff will be boxed anways as I understood unless you hint the fn's too in which case you don't see a change since it would be fast already right?
08:06lpetithello there
08:06Licenserhi lpetit
08:07cemerickLicenser: no, if the fns are :static and hinted, then boxing should be avoided, which was never the case before.
08:07lpetityou guys seem ready to push google groups to its limits regarding the number of posts for the same thread :)
08:07Licenserah okay
08:07Licenserlpetit: working on it
08:08lpetitI see :)
08:08Licensercemerick: ah I see true, but this isn't affected by things like primitive literals or not boxing math ops then
08:08cemerickright, those are orthogonal issues
08:08Licenserwhat I'm looking for is the 'out of the box (aka w.o. optimisation)' speedup
08:09LicenserI know I tried to say that :P
08:09cemerickwell, whether that happens depends on which defaults rhickey chooses
08:09Licenserbut that is what the whole argument in the goroup is about
08:09Licensercemerick: *nods* and what I would like to do is to measure the changes in real cases since I think it is somthing that is missing yet in the entire discussion
08:10Licenserwe have claims from both sides which is better in the end but I've not seen any real measurements that are based on reality :P
08:10Licenserthe thing they call science I think.
08:11cemerickYou're never going to get a good enough sample size to do real science on this.
08:11cemerickBesides which, there's taste and personal preferences mixed up in it.
08:11rhickeyLicenser: there are huge classes of things that don't yet exist in Clojure because these optimizations aren't there. For instance, you'll find no helper methods that take primitives, no competitive versions of the alioth shootout stuff etc. Essentially, there are things for which Clojure wasn't suitable (maybe possible but too hard) for which it now is
08:12Licenserheh
08:13Licenserrhickey, cemerick what I wanted to try is to bring some hard (at least harder then most of them in the discussion now) facts into the discussion.
08:13rhickeycemerick: yes, not useful in and of itself, but not being there leave the 'Scala is faster than Clojure' meme wide oper
08:14cemerickrhickey: yeah, I know -- good numbers there are good PR. I guess I'm just not in the mood this morning. :-)
08:16rhickeyLicenser: count the number of (int some-literal)'s in gvec.clj. Missing any one of them, performance would suck terribly versus the vector written in Java. Every time I wrote one, I thought 'this is stupid', and whle I was willing and able to fo that correctly, most people won't be
08:18rhickeyAnyone who is consuming Clojure and simultaneously saying primitives aren't important is blind, or just conceding writing things like Clojure to other languages
08:18rhickeyI wrote Clojure to replace Java in my work, not Ruby
08:18cemerickheh
08:19rhickeyRuby was never a contender for the kind of work I do, nor for the work of people like me
08:19cemerickrhickey: you're always good for a quotable
08:20Licenserrhickey: I'd have to shamefully admit I don't know what work you do aside from writing clojure :P
08:20clojurebotclojureql is http://gitorious.org/clojureql
08:21cemerickNow I just need to get over primed operator fns and such.
08:21LicenserI tried today how bad it would be to have non boxing + catch the overflow and 'greacefully' go down to boxing +. Sadly this seems not an option :(
08:21rhickeycemerick: well, there's still the BigInteger contagion option I first produced
08:22rhickeycemerick: with that, there's substantially less need for primed ops
08:22LicenserI think if it would be possible to do this fast it'd be great
08:22cemerickrhickey: and it's still contagious even with the current fast ops, no?
08:22rhickeycemerick: no, right now everything is fully reduced
08:23cemerickI wonder if both could be present -- primed ops as well as contagious bigs.
08:23rhickeywhich means yo ucan't drive the result size through the input type
08:23rhickeycemerick: yes, they would, but as I said, you'd rarely need the primes since you could say (foo 1N)
08:24rhickeyas it stands now, people need to make a choice to use primed ops inside, with contagion use of normal ops would work well with bigint input
08:24cemerickIt seems a lot of people like the primed ops, just for clarity, but I suspect those that don't do a lot of math would get confused by primed ops and would be far happier with general advice of "append an N on your literals to get 'correct' math".
08:25rhickeycemerick: agreed, the tradeoff is on the equality issue, as with contagion it would be more likely to have 42 and 42N in the same program
08:26rhickeyyou really need to go back to equiv = in order to not have that be maddening
08:26cemerickrhickey: I thought you were favoring dropping equiv in general?
08:26rhickeyOTOH, equiv = allows you to box all non-bigints as Longs, which I think will be more escape-analysis friendly than the smallest-box method
08:27rhickeycemerick: I just put all of the things that interact on the table, switching back and forth is easy
08:28rhickeyBut while everyone has an opinion, there are real engineering tradeoffs here. My sensibilities don't like equiv =, but I might take it to make all of the other pieces fit
09:16fyuryudnolen: I saw you forked clj-processing on github. Planning to make work with prim branch?
09:18dnolenfyuryu: heh I thought there was a bug so I forked it, but I saw that I was just out of date. I haven't seen issues with the prim branch I don't think, have you ?
10:03fyuryudnolen: I tried a couple examples and everything worked fine. But I was thinking about adding ^:static to some (most?) fns and benchmark a bit
10:19AWizzArd,(class (byte-array 1))
10:19clojurebot[B
10:20AWizzArdIs ^[B the type hint for byte-arrays then?
10:25chouser^"[B"
10:26chouserI think ^bytes works in a lot of cases too
11:14chouserhehe. But I want my gazelles to be *slow* so I can eat them more easily.
11:20lpetitchouser: :)
11:36mattreplhrmm, I'm seeing an IllegalStateException with a message stating that a var is unbound when used within a deftest
11:38cemerickMan, peanut galleries are rough.
11:39mattrepl(something else going on, nm)
11:49Licenserthere is something I'm not sure about with the non auto promoting math will (+ 1 (num 1)) be a long or a Number?
12:11dnolenLicenser: + doesn't return primitives if it can't return primitives
12:25Licenserdnolen: but it could return primitives :P
12:58dnolenhmm
12:58dnolenso clojure.contrib.json still converts the strings keys to Clojure keywords
13:05cemerickdnolen: which was made the default recently
13:07joshua-choi,(class (seq "aa"))
13:07clojurebotclojure.lang.StringSeq
13:07joshua-choi,(class (next (seq "aa")))
13:07clojurebotclojure.lang.StringSeq
13:08joshua-choiQuestion. Does a StringSeq hold its entire source string in memory?
13:08dnolencemerick: huh, seems odd since "foo bar" is a valid JSON key, but read-json will produce bad output from that.
13:08joshua-choiIf it's next-ed, etc.
13:09cemerickdnolen: the attractiveness of keywords-as-keys is hard to resist for most :-)
13:10cemerick(read-json content false) will avoid the keywordization.
13:10dnolencemerick: oh! nice
13:10cemerickdnolen: yeah, an option was always there, the default was just flipped for 1.2
13:11dnolencemerick: sweet, thx!
13:11cemerickmy problem is that I now tend to produce maps with keywords containing dashes, which you can't get with obj.slot notation in js :-/
14:27bigwavejakewhat does the -> operater do?
14:27bigwavejakeit's hard to google for "clojure ->"
14:28Hunevaluate forth style
14:28Hun,(-> 5 (+ 3) (* 4))
14:28clojurebot32
14:28bigwavejakewhere can I find the doc for it?
14:28qbg,(doc ->)
14:28clojurebot"([x] [x form] [x form & more]); Threads the expr through the forms. Inserts x as the second item in the first form, making a list of it if it is not a list already. If there are more forms, inserts the first form as the second item in second form, etc."
14:29chouseralso here: http://richhickey.github.com/clojure/clojure.core-api.html#clojure.core/->
14:29bigwavejakeok... thanks!
15:06systaywhat does this mean? "java.lang.IllegalStateException: Var src.www.controller/post is unbound. (NO_SOURCE_FILE:0)"
15:06chouserit means the var was declared but never given a root value, and then you tried to use it
15:07chouserlike: (def foo) foo
15:09systayhmm... that makes sense. it's just that I did give a value...
15:09systaywell, obviously I didn't... :)
15:11chouser:-)
15:11chouserhow do you think you gave it a value?
15:11chouserwith def, binding, or what?
15:14systaygit://gist.github.com/448916.git
15:14systaysorry, http://gist.github.com/448916
15:17chouserhm. you have two things named post -- a var holding a fn and a local holding whatever new-node returns
15:17systayouch
15:18systaythat must confuse clojure, yes...
15:18chouserwell, it's more likely to confuse you. :-)
15:18chouseris 'relate' a macro?
15:18systayI thought that the inner post, since it was defined in the "let"m wouldn't show up outside
15:19systayrelate is from neo4j
15:20chouserI don't see a with-tx in neo4j
15:20dnolensystay: are you using clojure-neo4j for creating a blog?
15:21chouserI see a with-neo and a tx macro
15:21systaydnolen: well, I need a real project to try things out on
15:22systaychouse: I'm using bobby's fork of neo4j
15:22systaychouse: of the neo4j bindings, that is
15:22chouseranyway, if that's not the problem, I'm not seeing it. relate should be getting the new-node result, and I don't know what else would be using the name 'post'
15:24LicenserI for once don't care how fast the gazelle is I eat, as long as it is tasty, I when it comes to that by all means I take the turtle gazelles they are easier to catch!
15:26chousersystay: what line is the exception pointing to?
15:27systaychouser: solved it...
15:28systayI hadn't closed the def above post...
15:28systaydamn you parenthesis!
15:28chouserheh
15:29dnolenit would be cool if someone made something like Gremlin for clojure-neo4j
15:50systayis there any way to expand exceptions? I'd love to see the stacktrace of some of the exceptions I see
15:51TimMcNo you wouldn't. :-(
15:51chouser(.printStackTrace *e)
15:52systaynope, I wouldn't :(
15:53chouserThey're chock full of useful details!
15:55TimMcI don't know *what* I'd do without the clojure.lang.Compiler.eval lines!
15:55TimMcBut more importantly, all the "invoke"s.
15:56Chousukeclojure.stacktrace has a pretty-printer
16:01cemerickIt seems like stacktrace (or something similar) should really get bolted into the REPL. Yesterday wouldn't have been too soon.
16:04chouseralways showing only the root-cause isn't acceptible.
16:05chouserthat sounded harsher than I meant
16:05cemerickI know I was offended.
16:05cemerick;-)
16:05chouseralways showing only the root cause will sometimes obscure the most important information.
16:06chousercemerick: I knew you would be
16:06cemerickI think, as a first pass, filtering out all clojure.* frames in intermediate causes would help a lot.
16:07cemerick35 LazySeq.seq calls aren't fun, etc.
16:07cemerickBut regardless of the right tradeoffs, error reporting is probably the #1 gripe at the moment.
16:08chouserit'd be worth experimenting with some filtering/reporting options and see what seems to work well over time
16:08TimMcMaybe a Bayesian spam filter for stacktraces. :-P
16:08chouserheh
16:08chouserwith a rhickey profile and a cemerick profile available by default
16:09cemerickha!
16:11chouserhuh. clojure.main already treats compiler exceptions differently from others.
16:15KirinDavesilent consumption still?
16:16dnolenMy least favorite exception is "No message"
16:17KirinDaveAka, "We're sorry Programmario, but your macro is in another castle."
16:17chousereh
16:17chouserer, heh
16:17KirinDaveSeriously, that is the worst part of clojure macros.
16:17KirinDaveI really miss plt-scheme's system.
16:18dnolenKirinDave: think it could be ported to Clojure?
16:19chousercljure.main/root-cause is the same (but slightly tighter code) as clojure.stacktrace/root-cause
16:19KirinDavednolen: It'd be tough to do it properly. You could do an MBE system, but the symbol scoping stuff requires a lot of work.
16:41alexykhey guys: I plan a shootout between clojure, haskell, and ocaml processing huge twitter graph. I have all code already. Each lang gets its own repo. Haskell's called husky and ocaml's called clams. I need a short anumal name for clojure. Any idea?
16:41alexykI leaned towards mouse as clojure is really small. Anything better?
16:41alexykor moujure
16:41alexyk(kidding)
16:41alexykany animal with clo- or -jure will be considered.
16:43chouserhedjhog
16:43rfgbadjure
16:43jkkramercockatoo
16:43chouserbadger is cool
16:43alexykchouser: rfg: awesomer and awesomester!
16:43alexykbadger is good
16:43alexykjkkramer: cockortoo?
16:44alexykjkkramer: that's for coq projects
16:44alexykrfg: badjure is a Grisham novel. Runaway badjure.
16:45alexykGoodjear tires...
16:45jkkrameri was thinking of the bird angle, for twitter
16:45alexykjkkramer: ah! deep
16:47lancepantzooo
16:47lancepantz Subject: [Clojure] Milestone "Release 1.2" updated
16:51Chousukebadger is a good name, because http://www.youtube.com/watch?v=c81bcjyfn6U
16:52miner49ralexyk: a conure is kind of parrot
16:52rfgor http://www.youtube.com/watch?v=bzHlDxyO8SI
16:53rfg:)
16:54qbgWe're here tracking the Clojure in its native habitat. As you can see, hiding beneath its small exterior is a powerful beast...
16:57Licenserthere is an odd problem with all things using threads - it does not quit :( how does this come?
16:58Licenserthe moment I use future or pmap my program won't stop any more
16:58alexykbeneath its small leiningen we see a seething maven...
16:58chouseronce the agent pools are used, the repl will not quit automatically unless you shutdown-agents
16:58rfgLicenser: I had an issue the other day where I failed to cancel a future.
16:58alexykits repl is sharp and forked
16:58Licenserah thanks
16:58alexykand its swank's plumage is colorful
16:59qbgIt's full of slime!
17:06StartsWithKhi
17:07StartsWithKfound a small problem with clojure.walk, http://paste.pocoo.org/show/228702/
17:07TimMcWatch as it parens its feathers!
17:07StartsWithKit removes all the metadata while walking
17:12TimMcalexyk: Lungfish, because it is a Lisp that lives in Java land?
17:12qbgNo, Clojure is the Borg
17:14StartsWithKwhere do i report the bug? i don't see a link on assembla to open a new ticket
17:15mmarczykStartsWithK: you'd better post to the mailing list first, but for the record, there's a link to open a new ticket on this page: http://www.assembla.com/spaces/clojure/support/tickets
17:17StartsWithKmmarczyk, it says i have to be a watcher.. i don't want to pay for assembla just for one bug
17:17StartsWithKbut yes.. i'll post on ml
17:18StartsWithKoh.. they have a free plan :)
17:18mmarczykStartsWithK: you don't have to pay to register, or indeed to use it for foss projects, you'd only need to pay if you needed stuff like private repos etc.
17:18Licenser,(byte \a)
17:18Licenser$(byte \a)
17:18sexpbotjava.lang.ClassCastException: java.lang.Character cannot be cast to java.lang.Number
17:18Licenser$(int \a)
17:18sexpbot=> 97
17:18Licenser^- odd behaviour
17:20Licenseris there a difference between (count "abc") and (.length abc)?
17:20mmarczykisn't a byte too narrow for a char?
17:21TimMc$(int \✩)
17:21sexpbot=> 10025
17:21mmarczykoh, cool star character! need to learn to type those!
17:22Licensermmarczyk: I'm not sure
17:22qbgLicenser: Yes, the first one works ;)
17:23Licenserqbg: I ment under the assumption that I didn't forget the ""
17:23mmarczykLicenser: um, see above; JVM chars are 2 bytes long (UTF-16)
17:23Licenserand the second one could work to if I def'ed abc as "abc" :P
17:23Lajlammarczyk, have you missed me?
17:23LajlaAfter all, together we are the second and fifth best programmers in the world.
17:24Licenserhmm me bing the best?
17:24mmarczykLicenser: note that I'm not claiming that this explains why the exception message you quoted makes sense ;-)
17:24Lajlalicenser, no the microsoft chief software architect
17:24Licensermmarczyk: Agreed
17:24LicenserLajla: ah okay
17:24qbgLicenser:
17:24Licensercan't beat that guy, after all he manages to keep is job despite of windows
17:25qbgUsing count is less hosty
17:25Licenserheh
17:25LicenserI figured that but will count convert it into a seq first and then actually count stufF?
17:26mmarczykLicenser: nope, it's backed by a static method of clojure.lang.RT which does the sensible thing for all arguments
17:26qbgAnd if the compiler doesn't know it is going to be a string, there is reflection overhead
17:27mmarczykactually the reflection overhead is there for .length too
17:27Lajlammarczyk: http://codepad.org/2NUYHYWp
17:27Licenserah okay
17:27qbg(I was talking about .length)
17:27Licensersmart rhickey!
17:27LajlaIt is possible for an algorithm to detect tail-recursion lexically and then rewrite code, right?
17:27LajlaI still don't understand why it is not possible, I mean, there should be a reason, but I don't see it.
17:27mmarczykLajla: um, we've been through this already :-P
17:27Licenserthe reflection is there only for lenght isn't it?
17:27Lajlammarczyk, and we haven't answered me!
17:28mmarczykLajla: I must say I enjoyed that conversation in many ways, if that answers your previous question :-)
17:28Lajlammarczyk, but tail-recursion is lexically _decidable_!
17:28mmarczykwhat does not at all follow is that I want to reiterate the same stuff again
17:28LajlaSurely it can be algorithmically re-written to a form using loop/recur by a praeprocessor?
17:28mmarczyklook, nobody's claiming that you can't decide tail-recursion
17:28mmarczykwell of course not
17:29Lajlammarczyk, why not?
17:29LajlaI don't get it.
17:29LicenserLajla: I think tail recursion can be the case even if it is not lexically decidable
17:29LajlaI wish for you to explain it.
17:29mmarczykyou could rewrite *local* tail calls, say within a single function, by inlining any locally declared "subfunctions"
17:29mmarczyketc.
17:29Licenseras in you can decide a sub case of the problem but not all
17:29Lajlalicenser, then it is not deciding of course.
17:29mmarczykwhich is something I mentioned last time round
17:29mmarczyk*but* for general tail recursion to work
17:30LajlaBut I believe that Steele and Sussman proved that tail recursion is lexically decidable with lexical scope.
17:30mmarczykyou need to be able to handle a tail call to an arbitrary function
17:30LajlaAfter all, how else could they require it in Scheme?
17:30mmarczykScheme controls its own stack discipline
17:30LicenserLajla: I think the point is, rhickey does not want to say 'we have tail recursion' when the truth is 'in some cases we have tail recursion'
17:30mmarczykClojure doesn't
17:30LajlaHmm, maybe that's it.
17:30qbgTCO is easy to implement (for simple cases at least) if you are doing everything yourself
17:30LajlaBut tail-recursion is only a special case of tail-call optimization anyway.
17:30mmarczykLicenser: that's not accurate, he really *can't*, for fundamental reasons, have tail recursion *and* have Clojure functions be called through the JVM calling convention
17:31TimMcLajla: What happens here? (defn foo [bar] (bar))
17:31mmarczykLajla: well with this terminology, Clojure does give you tail recursion with recur
17:31LajlaI shall not praetend to understandthese JVM calling conventions.
17:31Licensermmarczyk: I realize that, what I ment is clojure could have a automatic TCO for the simple cases but doing this would give the false impression clojure would do TCO for all cases
17:31mmarczykLajla: I can see multi-level recur -- "nested loops" -- as possible, though I'm hardly expert enough to want to claim this as a certainty
17:31cemerickLajla: relevant to this discussion, each method call consumes stack, full stop.
17:31TimMcLajla: The call to bar is in a tail position, but I don't think the compiler can do much about it.
17:32LajlaTimMc, I see your point.
17:32mmarczykLicenser: ah, as in "we could have TCO'd self calls" -- true, I misunderstood you
17:32LajlaYou mean calling (foo foo) right?
17:32TimMcSure, that's one possibility.
17:32mmarczykLajla: Clojure function calls are ultimately Java method calls
17:32Licenser*nods* and I think the decision made was: Either we have automated TCO or not, we don't go half way just to have a buzz word
17:32LajlaWell then I see your point.
17:33Licenserand I actually like it since it forces you to realize when you have TC's and when not
17:33mmarczykLajla: there's nothing you can do about TCO-ing Java method calls
17:33Lajlammarczyk, I guess.
17:33mmarczykLajla: and I said all that last time round! :-P
17:33LajlaI would have implemented it via a CPS though
17:33LajlaYou didn't
17:33LajlaYou said you loved me and wanted to stroke my hair.
17:33mmarczykLajla: we have quite significantly different recollection of that conversation :-P
17:34Lajlammarczyk, the nihilists have won, sorry.
17:34LajlaReality is not objective.
17:34cemerickLajla: I think kawa uses CPS, and gives you full TCO. It's brutally inefficient though.
17:34LicenserI double Lajla, that was actually what mmarczyk said
17:34LajlaTo say that one person is insane is saying that same as that all other people are safe that person.
17:35Licensersclala code looks so ugly to me :(
17:35RaynesIs there another MongoDB library (a la http://github.com/somnium/congomongo) that isn't ancient?
17:35Lajlacemerick, kawa targets the JVM?
17:35cemerickyes
17:35RaynesI'm considering forking the FleetDB client library and updating it to make it 1.2 compatible tonight. Don't have many options.
17:35LajlaThe only reaosn I can think for Scheme compilers not targeting C-- is that they are ignorant of its existence.
17:35LicenserRaynes: do you want to cheat on me!
17:35RaynesLicenser: Too many StupidDB instances!!! Too many!!!
17:35Raynes:p
17:35mmarczykLajla: see http://clojure-log.n01se.net/date/2010-06-09.html#01:21d and around
17:36TimMc$(int \丏)
17:36sexpbot=> 19983
17:36LicenserRaynes: there should only be one! or at least one per file
17:36RaynesPlus I'm bored, and have never used a db that isn't Stupid.
17:36Raynes:p
17:36LajlaI am on the internet, I am famous.
17:36RaynesThere is one per file.
17:36Licenserwhich is fine!
17:36RaynesWhich is a *lot*.
17:36TimMcCurious. When I ran (int \丏) in `lein repl`, I got 15.
17:36RaynesWhen about 5 sexpbot plugins run a db.
17:36Raynes:p
17:36Licenserso?
17:37Licenserthey are working aren't they?
17:37mmarczykTimMc: using a funny terminal encoding?
17:37TimMcProbably.
17:37RaynesI mostly just need to try out different things though. I'm almost a db virgin.
17:37RaynesIndeed, they work. I need to see how much of an effect they have on memory consumption.
17:37LicenserRaynes: try couchdb
17:37Licensermongodb sucks
17:37mmarczykLicenser: why'd you say that? :-)
17:38Licensermmarczyk: because they refuse to support SPARC hosts
17:38RaynesGood idea.
17:38LicenserI whine to them once a month and they keep refusing
17:38Licenserwhich reminds me
17:38mmarczykLicenser: oh... that's really awful :-( ;-)
17:38Licenserno it actually is really awful
17:38Licensersince I loved mongodb but I can't use it
17:39Licensersince I run on sparc
17:39mmarczykum, wait
17:39RaynesOh boy.
17:39mmarczykdo you, right now, chat with us from a sparc machine?
17:39Rayneshttp://github.com/danlarkin/clojure-couchdb DB people just hate being up-to-date, don't they?
17:39Licenserno, I chat with you from a intel, but my server runs on sparc
17:39danlarkinHmm, I thought I deleted that :)
17:40LicenserI could chat from the spark too if I'd install irssi, but I kind of like the clicky stuff from my mac
17:40mmarczykLicenser: ah... well, still, that's cool :-)
17:40Licenserso I've two more sparc systems next door
17:40Licensermmarczyk: it is, ask Raynes they aren't even that bad :P
17:40TeXnomancydanlarkin: github needs a "this repo is deprecated; please see $FOO" marker
17:40RaynesSparc's cool. It runs sexpbot. :D
17:40Licenseris stupiddb the only db that runs well with 1.2? :P
17:41Licenseractually clojure runs darn well on sparc
17:41danlarkingaha, now it's really deleted
17:41RaynesLicenser: It's the only one I can find that's purposely compatible with 1.2
17:41Licenserthat is terrible in a funny way
17:41mmarczykLicenser: and does CouchDB currently offer a reasonable way of running non-system-wide instances?
17:41mmarczykLicenser: ...should have said "private instances" actually...
17:42mmarczyksth like desktop-couch, I guess
17:42Licenserhmm good question, but since there are solaris zones which are darn cheep I don't realy care :P
17:42LicenserI can spawn one for every person who is on the system if I'm boored
17:43mmarczykdnolen: same question then...?
17:43dnolenmmarczyk: what do you mean by system-wide?
17:44Licenseralso couchdb runs on erlang, that alone is cool
17:45mmarczykdnolen: well, the standard story for running CouchDB seems to be as a service started, say, with an /etc/init.d script
17:45mmarczykit binds to a port ~5.9k, I think? then if you can cram however many dbs you like in there
17:46dnolenmmarczyk: you can start it directly, though you'll probably have to do some tweaking to specify which port to run the new instance.
17:46dnolenmmarcyzk: but one running instance of CouchDB can have multiple DBs
17:46dnolenfrom what I've heard it can handle many concurrent connection just fine, that's it's strong point
17:46mmarczykdnolen: which I'm liable to do something unpleasant to with my "fooling around" code
17:47mmarczykor maybe not, but anyway, makes me feel uneasy to work alongside "production" data, even on my own box
17:47dnolenthe most powerful aspect of CouchDB is replication, you can do fun stuff with that.
17:47dnolenCouchDB won't corrupt your data it uses MVCC
17:48dnolendifferents versions of a document preserved
17:48Lajlammarczyk, the JVM, does it allow jumps?
17:48mmarczykthe Canonical people seem to believe it necessary to have a separate desktop-couch project for spawning per-user instances for config data
17:48mmarczykLajla: nope
17:48LajlaI find it abstract that a virtual machine has 'method calls'
17:48LajlaAH
17:48LajlaThat explains it.
17:48mmarczykdnolen: yeah, I know about their storage model
17:48LajlaYou told me this JVM was as simple as the average CPU instruction set. =(
17:49LajlaYou lied to me.
17:49mmarczyk(about CouchDB) that's why I think Couch is super-cool
17:49mmarczykjust haven't got 'round to understand how I'm actually supposed to use it :-P
17:50mmarczykLajla: yet another case of differing perspectives on "simple" ;-)
17:50mmarczykbut I have told you explicitly that there are no jumps :-P
17:51LajlaThis is an outrage!
17:51mmarczykexcept through return, break/continue (multi-level) and throwables
17:52mmarczykouch, you're a vicious person :-P
17:52TeXnomancyno jumps unless you're using John Rose's crazy experimental JDK branches: http://blogs.sun.com/jrose/entry/tailcalls_meet_invokedynamic
17:53qbgI think you have goto
17:53mmarczykTeXnomancy: wow, that's crazy :-)
17:53Lajlammarczyk, well, you are quite tasty-legged.
17:54Lajlammarczyk, anyhow, you must have some respect for the fact that I ask such theoretical quaestions before I even decide whether or not to learn a language.
17:54mmarczykLajla: pleasure to be of use
17:54LajlaI like people that like to be used, it's my masculine side.
17:55KirinDaveSome joke.
17:55mmarczykqbg: in Java? nope
17:55qbgI'm talking at bytecode level
17:56KirinDaveLajla: You don't mind if I take that out of context and put it up on my website, do you?
17:56TimMcYes, the bytecode supports goto.
17:56KirinDaveHow could it not?
17:57mmarczykqbg: ah, well, that's true then
17:57Lajla'Like most virtual machines, the Java Virtual Machine has a stack-based architecture akin to a microcontroller/microprocessor. However, the JVM also has low-level support for Java-like classes and methods, which amounts to a highly idiosyncratic memory model and capability-based architecture.'
17:57LajlaKirinDave, not at all.
17:57LajlaNo idea of which you speak, but information is free as far as I'm concerned.
17:57KirinDaveLajla: I'm sort of sad that you said you don't mind. But it won't deter me.
17:57mmarczykqbg: but you can't use it funky ways -- even if you write your bytecode by hand -- because it won't get past the bytecode verifier when you try to load it
17:57Licenserif I don't have lein and want to build one single clojure file w/o anything else what would be the command for it?
17:58LajlaKirinDave, of what are you speaking anyway?
17:59LajlaWhat are you putting on which site of yours?
17:59KirinDaveLajla: http://idisk.me.com/dfayram/Public/Pictures/Skitch/clojure_%28irc.freenode.net%29-20100622-145517.jpg
17:59LajlaAhaha
17:59LajlaWhat client is that?
18:00Chousukelooks like colloquy
18:00Licenseryap looks like it
18:00Chousukeeh :P
18:01mmarczykLicenser: you mean compile?
18:01Licenseryes
18:01mmarczykLicenser: there's a compile function in clojure.core
18:01mmarczyksee docstring for details
18:02LicenserI know but starting a repl isn't really fun :P I'd enjoy a lot if I could just call something like clojure.compile <file>
18:02mmarczykNB. you'll need to have your output directory for .class files on your classpath
18:02mmarczykwell you can use clojure.main -e "(compile ...)"
18:02mmarczykor maybe wrap it in binding to set the output path
18:03mmarczykhm, I think the syntax was -e "...", I hardly ever use that though
18:04LicenserI tried that but didn't really work - I think
18:04Licenseractually did
18:09mmarczykhm
18:12dnolenanybody else messin with clj-apache-http ?
18:13stuartthecolhi guys - I think I'm having some classpath trouble with leiningen. I made a new project with lein new foo, run lein swank, but then when I connect with slime and run the auto built core.clj file, it gives me No such namespace: foo.core. any ideas?
18:14mmarczykLicenser: strangely enough, with 1.1 at least, -e "(compile ...)" throws an exception for me, but *after* producing a .class file
18:14Licensermmarczyk: it seems to work
18:14mmarczykLicenser: ah, good
18:14mmarczykLicenser: I was rather hoping there was something funny with the one-off "project" I'm using for this :-P
18:14Licenserrhickey's comment this morning about 'with the new changes clojure at least stands a change in the benchmark shootouts' got me thinking and I figured I'll write a few of the shootouts :P
18:15cemericklooks like the hinting available to definterface isn't there for protocols yet?
18:19rhickeycemerick: protocols are ordinary fns, and don't take specific types (yet)
18:19rhickeythe prim work is the path to that
18:19cemerickrhickey: OK, so definterface + extend-type is idiomatic for now
18:20rhickeycemerick: this to get an interface for Java?
18:20cemerickyeah
18:20cemerickI figured I'd just reuse the protocol-generated one, but alas :-)
18:20rhickeybut you want the interface to reach a Java type you don't own?
18:20cemericknope, I own the whole stack
18:21cemerick(trying to be 100% clojure these days, as much as I can anyway)
18:21rhickeyso definterface + deftype/defrecord
18:21cemerickright -- well, almost -- the implementing class *is* in Java. Probably the 2nd-gnarliest thing I've got, 7 years old now. :-/
18:22cemerickso, extend-type :-)
18:30rhickeycemerick: no, extend-type can;t be used to make an interface reach a non-derived type
18:31Licenserhmm is unchecked-inc gone?
18:32rhickeynow unchecked-inc-int/long specific
18:32Licenserah thanks!
18:34rhickeybbl
18:35Licensertake care rhickey
18:42Licenserbed time for me see you tomorrow poeple
19:09quidnuncI keep getting "let: File exists: /home/me/.emacs.d/elpa/clojure-mode-1.7.1/clojure-mode.el" when trying to install clojure-test-mode from elpa in emacs. Anyone have a similar problem?
19:14lancepantzwhen i do a C-c C-d C-d, can i close the description buffer inline when i'm done, without having to switch to it?
19:16jkkramerquidnunc: http://groups.google.com/group/clojure/msg/4d2814711fa732a8
19:25quidnuncjkkramer: Thanks (not quite working yet, I think I have to restart emacs).
20:10rntzwhat does it mean for a symbol in a parameter list to begin with &, as eg &form, &env do in: (fn [&form &env name & args] ...)?
20:11cat26hi...
20:11cat26someone has a clue how to call a method from a class generated on clojure from coldfusion?
20:11lancepantzrntz: it's optional and anything past the & will be rolled up
20:11lancepantzrntz: oh, i'm sorry, i misread
20:11lancepantzignore me
20:12lancepantznever noticed it at the beginning of a symbol
20:15cat26instead of coldfusion, more generic, from java itself
20:17mmarczykrntz: the & has no special meaning
20:17mmarczykrntz: &form and &env are implicit arguments received by all macros
20:18qbgcat26: Like any other java method
20:18mmarczykrntz: &form holds the entire form which triggered the macro transformation and &env contains the compilation-time local environment in the context of which the macro is being expanded
20:19cat26well, the problem is that cf loads the object, but apparently has no methods
20:19qbgcat26: How are you generating the class?
20:20cat26when -main should return a string, cf prints only the name of the class plus a id
20:20cat26with gen-class
20:23stuartthecoldoes anyone know why paredit would work correctly with () and []'s, but not {}'s? it won't auto close them, but it also won't let me delete unmatched ones
20:23tomojwhich version of paredit
20:24stuartthecol20
20:24tomojget 22
20:24tomojhttp://mumble.net/~campbell/emacs/paredit-beta.el
20:25stuartthecolcool, thanks
20:25tomojclojure-mode will fix {} if it sees that you're using 22
21:12ttmrichterhttp://kirindave.tumblr.com/post/726735921/special-kind-of-asshole
21:12ttmrichterPlease tell me that was faked.
21:13lancepantznope
21:14lancepantzits odd, that's actually not the first time he's brought up beating women
21:15ttmrichterI see.
21:15ttmrichterEvery time I question my decision to leave the industry, I stumble over reminders of why I did.
21:19defnugh, don't get mstarted on that guy
21:19defnme*
21:19RaynesYou guys realize he is here, right?
21:19defnyes...
21:19RaynesLast thing #clojure needs is a IRugment.
21:19Raynes:p
21:20defnhe'll likely bring one of those whether we say any of this or not
21:20defnthat's his MO
21:22defnI think it just might be an epic informed troll...
21:22lancepantzworse, a scheme troll
21:22defnD:
21:23RaynesD:
21:23defnAnyways, moving on... I had an interview today and as usual the "people" side of the interview went sort of meh
21:23nDuffgood coworkers are hard to find
21:23defnbut the technical side was epic. reason? this guy writes clojure.
21:23nDuffheh :)
21:23defni almost leaped over the table to hug him
21:24lancepantzhaha, thats awesome
21:24defni was like: you? wait... you said... are you? you write clojure!
21:25nDuff...just as an aside, last time I interviewed with a small, profitable startup with a bunch of brilliant people (and accepted their offer over a potentially more lucerative alternate), it got announced the day after I accepted that they were getting bought by Dell.
21:25defnoh...shit...
21:26nDuff...that said, a fair number of the brilliant people stuck around, so it wasn't entirely a fiasco
21:28nDuffupside: great health plan, hands-off immediate management (yes, we use Clojure)
21:28defnuntil they transformed the culture into a nice filthy sewer water id imagine
21:28nDuffdownside: evil corner-cutting facilities department (they took away our espresso machine, those bastards!)
21:29defnwe used to have free soda
21:29nDuff...at one point they took away our trash cans and made us walk our own trash to the hall
21:29defnnow it's a quarter
21:29lancepantznDuff: i would imagine you would lost some upside though, as your stock hadn't been granted?
21:29defnwe used to have really awesome vacuum packed coffee, now we have cheap flavored crap
21:29lancepantzoptions imean
21:29nDufflancepantz, ehh, most of the equity was owned by VCs anyhow
21:29nDufflancepantz, ...I wasn't really in this one for the options
21:30defnbackground: we got bought out by a fortune 500, which then was bought out by an even larger company
21:30lancepantzfair enough
21:30defnso basically, my highest level manager, is one of the lowest in the company
21:30defnand we dont get anything we want
21:30defn*facepalm*
21:31nDuffugh.
21:31defnc'est la vie -- they're going to lose me in a few weeks along with everyone other smart person here eventually
21:31defns/everyone/every
21:31defnkind of a wasted investment on their part :\
21:32nDuffwe're finally losing some good people, but they managed to keep things reasonable and sane for over 2 years; that's longer than I expected
21:32defnnow that people arent buying gold bullion in anticipation of the apocalypse a lot of people have been jumping around
21:32defnfrom what ive read
21:33lancepantzdefn: are you tied to wisconsin?
21:33defnlancepantz: hell no.
21:33defner, well, wait -- how do you mean?
21:33nDufffrankly, I'm a bit conflicted; despite the Dell name we have lots of fun and interesting projects to work on, and the pay is much better than I can get from most of the folks I know running startups right now (unless I'm willing to take my chances on equity, and I've been down that road a time or two already)
21:33lancepantzyou should move
21:33defnoh yeah... i was surprised you knew i was in WI
21:34lancepantzi think there are alot more clojure jobs on the coast
21:34lancepantzi think its in your host or something
21:34defnyeah i really wanna move to SF, but i need to let my girlfriend get through college (one more year)
21:34lancepantznope. must have been a blog or something
21:35lancepantzthe perks are alot better out here :)
21:35lancepantzi'm in la now though
21:35nDuffokay, not unfriendly compared to LA
21:35defn:D
21:35lancepantzi like austin
21:35lancepantztraffic here though is nuts
21:35defnive heard nothing but awesome stuff about austin
21:35nDuffalso the cost of living difference
21:35lancepantzi work weird hours though, so its tolerable
21:35defnbut man...id feel weird calling TX home
21:35nDuffdefn, it's not Texas, it's *Austin*!
21:36nDuffdefn, ...nothing in common but the weather :)
21:36defn:D -- yeah yeah, just not ready to move to the south pole of North America
21:36defni need to go in between before i can settle down that low
21:36defnhence SF
21:36defni would kill for the music in austin though
21:37defnlancepantz: i probably wouldnt have a car, probably would sell it to pay my rent! ;)
21:37nDuffheh; there's a lot going on, but I just never get downtown to enjoy it. Cousin-in-law runs a bar downtown right next to La Zona Rosa (one of the local music venues), and I've rarely ever been.
21:37lancepantzi haven't bought one since i moved down from sf
21:37lancepantzprobably will next month or so, been putting it off
21:38defnif i move to texas there's the temptation to be a coyote, which i dont need
21:38defni wonder if i could use clojure to improve the ratio of immigrants i could get across the border
21:38nDuff<plug type="shameless">re: transport in high-density living areas where garaging is expensive, the folks over in #bikefriday make some damn fine folding bicycles</plug>
21:39defni ride a fixed gear, mainly because im 25 and a hipster
21:39nDuffpah
21:40defnlike the old schwinns?
21:40lancepantzoh jesus
21:40defnthose things are a bear to put together...
21:40lancepantzif i had admin i would kick you on principle defn
21:40nDuffa Rohloff on the big bike, a SRAM i-Motion 9 on the Tikit (the folder), a Nexus on the old shaft-drive commuter
21:40rntzthere are a lot of swank-clojure repos on github. which one should I be using?
21:40defnlancepantz: :D
21:40defnlancepantz: track stands are cool!
21:40defnrntz: use technomancy's
21:41nDuffdefn, "those things" meaning internally geared hubs? I'm too much of a wuss to overhaul them myself; that's what professional bike shops are for. :)
21:42defnnDuff: yeah those things are crazy hard to put together
21:42defni couldnt even begin to know where to start
21:42defni tried once...just one.
21:42defnonce*
21:43defnMadison, WI has some really nice bike paths. It's note exactly startup mecca, but there's starting to be some more VCs around town, more biotech, etc.
21:44rntzis there some way to run a swank-clojure instance /not/ associated with a "project"?
21:44arohnerlancepantz, nDuff: you two are in Austin?
21:44lancepantzarohner: i'm in los angeles
21:44lancepantzi just like it
21:45defnman, I hear nothing but bad things about LA
21:45arohnersounds like it might be time to start an Austin Clojure users group
21:45defnall the fake palm trees
21:45defni started one in madison, we're at a grand total of 2 members! huzzah!
21:46arohnerI think with nDuff and my cofounder, we're at 3!
21:46nDuffwe've got two people who make production commercial use of clojure here in the office, and me (playing around, but nothing in production yet)
21:46lancepantzdefn: i was miserable at first, but i've came around, you just have to figure it out
21:46arohnernDuff: where do you work?
21:47RaynesI know several Alabama people in #Haskell. We started a usergroup back on early '09, and are still just-a-plannin' to meet.
21:47nDuffarohner, Dell
21:47RaynesAbout 4 or 5 of us.
21:47arohnernDuff: I'm sorry. I know a bunch of people there, none of them happy
21:47defnRaynes: I'm from the north. I don't understand this "just-a-plannin'" lingo.
21:48nDuffarohner, well -- I'm in a little startup that got acquired a few years back, and the digestion process has actually been pretty slow.
21:48RaynesSince the group was formed, we've talked about meeting, but never actually did so.
21:48arohnernDuff: ah. The ones I know are in sales, the belly of the beast. What did the startup do?
21:48defnRaynes: oh i know I was just givin you trouble, spergy
21:49nDuffarohner, software-as-a-service
21:49defnStartup: SaaS. Investor: $
21:50arohnerdefn: if only it were that easy
21:50defnyeah..i have no startup experience
21:50arohnerdefn: they want customers, and revenue, and a plan and pretty soon you never get to code
21:51defni just hear all sorts of stuff about SaaS + Getting paid
21:51defnarohner: yuh :(
21:51defnHave you guys played with Quora at all?
21:51defnI'm sort of...well...obsessed with it ATM.
21:51arohnerdefn: a little. just poked around, no serious use
21:52defnAs the user base grows I really hope they are able to keep up (admins and tech-wise)
21:53defnthere is a problem with new users' questions and the topics they assign to a question. some people dont understand how to tag things. sad, but true.
21:53defnlike a miley cyrus question somehow gets "Facebook", because the person saw it on facebook, for instance
21:54qbgA random 5 minute hack: http://gist.github.com/449372
21:54defnI guess Facebook is making a Q/A thingamajig to compete with Quora, and there are some questions wherein a lot of anonymous users, who are in my estimation Quora employees venting some insane rage in the direction of Mr. Zuckerberg
21:55defnsorry so O/T. qbg i don't really get it, but I'm not "smaert".
21:56qbgJust a random hack. Scoped destructors might be useful for some.
22:06pdkis quora basically formspring
22:16defnpdk: hmmmmmmm not sure
22:17defni bet there's a question like that on quora though! :)
22:29defnunfortunately no...there wasn't
22:29tomojprogramming challenge: fix http://www.quora.com/challenges
22:29cemerickI'm starting to think that type-hinted interop should throw a compiler exception if nothing with the named field/method exists at all.
22:30defnive been working on that actually in clojure tomoj
22:30defnit's a hamiltonian path problem
22:30tomojit's a 500 error
22:30defntomoj: they're down for maintenance
22:30tomojah
22:30defn"double secret maintenance" apparently :\
22:30defnit just happened a few minutes ago
22:31hugodcemerick: would that work if you were dynamically importing classes?
22:31defntomoj: it's a neat challenge though
22:31cemerickhugod: you mean using an import in a fn body?
22:32hugodwell, using it somewhere after compilation
22:32defnbasically given [[2 0 0 0] [0 0 0 0] [0 0 3 1]] you need to find all of the longest paths which start at 2, end at 3, and dont touch any 1s
22:33cemerickhugod: you'd have to have the class loaded before you use the type hint naming it in any case
22:34hugodcemerick: you're right
22:34cemerickrhickey: am I just nuts w.r.t. to the above?
22:36hugodI've been thinking too much about dynamic classloaders - I would like to be able to run multiple versions of jars (in different threads)
22:37defntomoj: it's back up
22:38tomojwoohoo
22:38cemerickhugod: hahaha. Sorry. :-D
22:39cemerickI tried doing that once a long time ago by mangling classnames based on what thread was loading the class. It didn't go well.
22:40chousercemerick: I wonder if that strays too far from hinting and toward enforcement.
22:40hugodcemerick : I'm slowly thinking it would be a bad idea - but that means lots of vm spawning for me
22:41chouserI don't see why interop calls couldn't use call-site caching like keywords and protocol fns do now. Then you'd never need hinting at all for best performance.
22:41cemerickchouser: I'm not married to whatever baggage the "hint" term carries. If I try to compile (.foo ^ClassName bar), and there's *nothing* in ClassName called foo, then throwing an exception has nothing but upside IMO.
22:41danlarkintechnomancy: I emailed you a clojure-mode present
22:42cemerickchouser: call-side caching is fast, but still just a hair slower than direct invocation, no?
22:42cemerickcall-site*
22:44chouserhm, not sure.
22:45chouserI thought for keywords rich was claiming parity.
22:45dnolencemerick: same speed in every test I could come up with.
22:45chouserbut last time I measured, protocol methods implemented via extend were a bit slower than those in deftype/defrecord bodies.
22:45cemerickI thought there was still a map lookup involved?
22:46chouserno, call-site caching doesn't have any map lookup on cache hit
22:46cemerickchouser: that makes sense, there's definitely a lookup there
22:46cemerickI sit corrected, then.
22:46chouserI should check those measurements again.
22:46chouserbut before that, I should go to bed.
22:46chouserg'night folks.
22:47cemerickIn any case, I'd be happy with some hinted enforcement. It certainly doesn't impact dynamicism.
22:47cemericksleep well :-)
23:02redalastorI noticed a mistake in the cheatsheet on the main site. It says that creating an empty list is '() which works but () is more idiomatic.
23:23defn,()
23:23defn$()
23:23sexpbot=> ()
23:23defn$'()
23:23sexpbotCommand not found. No entiendo lo que estás diciendo.