#clojure logs

2008-11-10

00:43danlarkinwhat's a good way to add generic dispatch to my json-encoding function. Like if you've got a way you want to have JFrames encoded then you define it and I'll know to call it. I know I could define a multimethod using #'clojure/class but that ties it to type
08:23Carkit's ironic i'm writing a tool to search the meta tags in clojure and i don't know how to add a doc string to multimethods
08:24kib2look at that blog post (last paragraph is talking about Clojure) : http://spotless-spots.blogspot.com/2008/11/why-i-like-f.html
08:42StartsWithKCark: (defmulti #^{:doc "doc string"} fn-name dispatch-fn)
08:43Carkyay thanks StartsWithK
08:44StartsWithKworks for defmethod too, (im at rev1086)
08:46Carklisppaste8: url
08:46lisppaste8To use the lisppaste bot, visit http://paste.lisp.org/new/clojure and enter your paste.
08:47lisppaste8cark pasted "a tool to search docs string and other meta data" at http://paste.lisp.org/display/70071
08:48Carkif someone has anything to say about it, i'll gladly take it !
10:18Chouser-awayrhickey: are print-method and print-dup fairly settled down now, or not yet?
10:19Chouserwell, what I'm asking is if it's a bad time for someone to start looking at pretty-print.
10:20leafwcan't svn handle branches properly? It's a bit odd to see all this "interim checkin" warnings on the latests commits
10:20leafwI would have done them on a separate branch and then cherry-pick them into the master ...
10:21Chouserleafw: how well svn handles branches is perhaps a matter of some controversy, but anyway rhickey doesn't like branches.
10:21Chousersvn certainly doesn't handle cherry-picking nearly as well as git.
10:21rhickeyChouser: basically print-dup removes from print all of the goop required for 'serialization', so print-method goes back to what it was. I'm not sure of the relationship between print-method and a pretty-printer though
10:21leafwthat is evident. Never mind, just a comment.
10:22leafwwe have our own git mirror of clojure ... had to checkout an earlier commit today.
10:22leafwto avoid the interims.
10:23Chouserleafw: yeah, I have a "stable" branch in my git mirror right now, so I can flip back and forth pretty easily.
10:24rhickeyI didn't check in anything that didn't run, if you have problems you either have to change something to work with the breaking changes or report a problem
10:25leafwno obvious problem so far Rick; just didn't want to include a version whose commit mesage was a "warning do not use"
10:25leafwin fiji.
10:27rhickeyleafw: thus the warning, there's absolutely no reason to take head unless it fixes a bug or adds a feature you need
10:27rhickeyOR - you want to help test the changes
10:27leafwI know, I know, I'm shutting up.
11:12danlarkinI saw your post about Gorilla, kotarak, congrats on release #1
11:13kotarakdanlarkin: thanks. The Repl is still, ehm, experimental... I have to work on this. Noticed already some issues.
11:13danlarkinnow let's get going on Parser! :-D
11:13kotarakdanlarkin: hehe, sure
11:14danlarkinheh, just kidding on the square... no pressure or anything :)
11:17kotarakdanlarkin: certainly not, this is a hobby. But Parser will get it's time slice in the near future. :)
11:17danlarkinwoo hoo!
12:20kib2kotarak: ping ?
12:21kotarakkib2: pong
12:21kib2ok, have you tried to compile Vim on Windows with Ruby support ?
12:21kib2I've got lots of errors
12:21kotarakkib2: the self-installer vims come with Ruby enabled
12:22kotaraknever compiled vim on windows
12:25kib2kotarak: the problem is that I need Python support too, and I have to compile Vim from source to have Python support. But the Ruby one does not work.
12:26kotarakkib2: the self-installer vims com with Ruby *and* Python enabled
12:26kotarakkib2: they do it over some dynamic loading thing.
12:26kotarakkib2: when it's there it's used, otherwise, well, it's not
12:27kib2kotarak: are you *sure* it comes with native Python support ?
12:27kotarakkib2: I think so. But I can't check now, since I'm already at home. But I think they have everything enabled. Also Tcl and Perl. But you can also ask on #vim.
12:29kib2kotarak: ok, but last time I've tried, Python was not natively supported.
12:29kib2kotarak: see here http://showmedo.com/videos/video?name=1850010&fromSeriesID=185
12:34ChouserI don't know how to make this available for review without it being fully public. ...so here it is
12:34Chouserhttp://blog.n01se.net/?p=33 -- Writing a macro: for vs. doseq
12:34Chouserif anyone spots any errors, let me know.
12:38kib2Chouser : nice blog posts on Clojure !
12:39ChouserIf by "nice" you mean "too long", then I agree! :-) Thanks, though.
12:41kotarakChouser: awesome. Cosmetics: In the "nested loops" section, the formatting is a bit messed up. It least there is one paragraph in all monospace. Is this intentional?
12:43Carkchouser : that's cosmetic too but ...the code divs are very small, hard to read
12:44Carkusing firefox
12:45rhickey_Chouser: very nice, you might want to warn people that doseq a la for is not the most trivial macro
12:46rhickey_also another tip about macros (that you observed) they often can and should be written in terms of functions, not a giant syntax-quote
12:52drewcrhickey_: amen!
12:55drewcthe biggest reason is to avoid recompiling the world every time the macro changes, and as a side effect you get clean maintainable code and a functional interface to your abstraction.
13:08Chouserthanks, guys. The formatting should be cleaned up now.
13:12Carkeasier to read, thanks !
13:14Carkchooser : ", so until they are you much choose to use my-doseq as shown above."
13:14rhickey_Chouser: hmm, the code is huge now for me, with much spillage out of the white box. Camino 1.5.1 OS X 10.5.5
13:14Carkthat's not making sense
13:15Carkthere is some spilling here too btw
13:15Chouserok
13:16Carkthe problem is with this smallish column width you got there !
13:16ChouserCark: grammar fixed
13:16Chouseryeah, no kidding.
13:17Chouserdefault Wordpress width. :-/
13:18Carkmhh, i can't seem to find a neat way to manage changing state in a complex swing window
13:20Carki'd like to keep the state imutable, and at the same time change the reference in the window
13:20Carkis there a field in those swing components that can be used at the programmer's discretion ?
13:21Carklike in delphi there was this tag field to every component, and you could store pointers in there
13:26Carkah got it, putClientProperty and getClientProperty !
13:46askentaskenim implementing prolog in python,clojure and haskell. im thinking i need some state. or soem container to store allf acts and rules. what would that be in Clojure where i dont have traditional OO? im thinking multimethods mgiht be of use in the implementation. Perhaps I just have a : (def State {:rules nil :facts nil})?
13:48Carkor a (def state (ref {:rules nil :facts nil}))
13:48Chouseror (def rules (ref {})) (def facts (ref {}))
13:53askentaskenbut i want a "struct" clause which canab a rule or a fact. and i want to be able to define new structs within this predefined form. im not making much sense am i? i want to abstract out the defintiion of a rule but be able to define different rules. a Class i python does this nicely. In clojure, what do ido?
13:53Chouserprobably a hash-map.
13:54Chouserclojure has a thing called a struct, but it's really just a performance enhancement of a hash-map.
13:55sohailaskentasken, a useful model is to understand that clojure does not let the user define new types
13:55Chouser(without resorting to proxy or gen-class)
13:56sohailyou probably wouldn't want to do that too often!
13:57Chouserright. proxy and gen-class are generally the wrong tools for defining application-specific data.
13:58askentaskenhow do i define atsruct? i dont get it fromt he API?
13:59Chouseraskentasken: http://clojure.org/data_structures#toc75
14:00Chouserbut don't get too distracted by StructMaps. They're really just another kind of PersistentMap, so when designing your solution that's all that really matters.
14:00ChouserThe Struct part is a small optimization on the same core concept.
14:09askentaskenand {} is syntactic sugar for hash-map?
14:09Chouseryes
14:12askentaskenah wait
14:12askentasken(def State {:rules [] :facts []})
14:13askentaskeni can then create new State a lot of times and it is not the same State?
14:14Carkby doing this you create a var state, and it has the value you gave to it
14:14Carkit's not a good idea to re-def it afterwards
14:14sohailI'm told you want to use refs
14:18askentaskenhow do i update the value of a key?
14:19Chouserassoc returns a new hash-map with you value updated in it.
14:21askentasken#'user/s
14:21askentaskenuser=> s
14:21askentasken{:2 [10 10]}
14:21askentasken (def s (assoc s :2 (conj (get s :2) 10)))
14:22askentaskenseemscomplicated for adding a value to a key
14:23Chouser(update-in s [:2] conj 10)
14:24Chouserbut don't use def to update values in application logic -- use an agent or ref for that.
14:25wwmorganaskentasken: you could also use java.util.HashMap
14:25rhickey_best to define your model and a set of functions that transform your model, then, later, put your model in a ref
14:25Chousukethat's throwing away all the concurrency benefits though.
14:25Chouser(def s (ref {:2 [10]}))
14:25Chouser(dosync (alter s update-in [:2] conj 10))
14:26askentaskenwhat is? using refs?
14:26askentaskenupdate-in doesnt work like that though
14:26Chousukeaskentasken: using java.util.HashMap instead of clojure's maps
14:26rhickey_wwmorgan: then when you want to run queries in the background while editing your rulebase in a gui you've got threading trouble
14:27rhickey_or fact db updated from incoming data feeds, etc etc
14:27wwmorganyes
14:27rhickey_If you use the Clojure model from the start then adding these things is easy
14:28askentasken(defn add-value [coll key val]
14:28askentasken (assoc coll key (conj (get coll key) val)))
14:28askentaskenwell update-in is the same i get but i dont see how to use it
14:28askentasken(update-in s [:2] conj 10) -> wrong number of args
14:28askentaskenand if i do(conj 10) i get wrong nbr of args for update-in
14:28Chouseryou're probably running from a release version. hang on.
14:28rhickey_askentasken: think about (add-fact db fact stuff), yielding new db
14:29Chouser(dosync (alter s update-in [:2] #(conj % 10)))
14:29rhickey_you should leave the ref out of it until later
14:31danlarkinI asked this last night and didn't get any responses (I think everyone was asleep :))... what's a good way to add generic dispatch to my json-encoding function. Like if you've got a way you want to have JFrames encoded then you define it and I'll know to call it. I know I could define a multimethod using #'clojure/class but that ties it to type
14:31rhickey_e.g. first define assert-fact, retract-fact, add-rule, drop-rule, all taking and returning a fact/rule base
14:32rhickey_danlarkin: you can dispatch on an attribute or metadata
14:34danlarkinwould dispatching on metadata require adding that key to the metadata for every object you want encoded?
14:35rhickey_danlarkin: If you have a default, then no, just for the special cases
14:39danlarkinideally I'd like to have a way to define additional ways to define a dispatch
14:39danlarkinbut maybe that's just overengineering
14:39rhickey_danlarkin: how would you find out about them?
14:40danlarkinnot sure :)
14:41rhickey_one meta option is that dispatch functions can themselves be multimethods
14:43askentaskenwhat is the diff between ref and agent?
14:43rhickey_askentasken: you've read the docs?
14:48danlarkindispatch functions being multimethods would buy me allowing the user to define an encoding method based on whatever options I choose... class, a key in the metadata, but not their own way of dispatch
14:48danlarkinbut maybe that's good enough
14:51rhickey_danlarkin: you can have your first-line multimethod be spec'ed to return a fn to be called in turn
14:52rhickey_get-encoder-getter
14:53danlarkinlet me whip up a paste to see if I get it
15:02danlarkinHeh, I'm getting lost in abstraction, could you show me an example?
15:04rhickey_danlarkin: {:encoding-system :mine} {:encoding-system :yours}
15:05rhickey_(defmulti get-encoding method :encoding-method)
15:06rhickey_(defmethod get-encoding-method :mine [_] my-dispatch)
15:06rhickey_(defmulti my-dispatch whatever-I-want)
15:07AWizzArdWhat I didn't understood, regarding AOT was, if it will be possible to reaload .class files. It sounded as if the jvm does not allow this.
15:07rhickey_(defn encode [foo] ((get-encoding-method foo) foo))
15:08rhickey_AWizzArd: jvm doesn't
15:08AWizzArdokay, so for patching an application one should restart it
15:09rhickey_AWizzArd: no
15:09rhickey_AWizzArd: Clojure works hard to provide an indirection that avoids the rigidity of the JVM class system in most cases
15:10AWizzArdI see.
15:10rhickey_right now only genclass sigs have the same static nature as the rest of Java, even their method implementations can be dynamically redefined
15:11rhickey_but it's nasty and hard
15:11waltersAWizzArd: JDWP allows it in some limited circumstances
15:12waltersAWizzArd: there is some initial work in openjdk in allowing classes to implement new interfaces at runtime as well
15:13danlarkinrhickey_: thanks, I understand now. I appreciate it
15:13AWizzArdI see... well, it's nice that rhickey_ already has some good ideas about it. Although honestly I regard it as acceptable to restart an application from time to time. When Lisp compilers get updated (Allegro, Lispworks, sbcl) then they all need a new version/a restart and can't hotfix themselves while running.
15:14drewcAWizzArd: i have an application (still) running sbcl 0.8.something that has yet to be restarted.
15:15drewcAWizzArd: i do, of course, have to keep around an old emacs/slime installation for the odd patch, and it could be restarted without harm or loss of income.. but it's been an experiment :)
15:16AWizzArdnice :-)
15:16drewcand i could see applications for which any downtime is not acceptable.. i'm just glad i don't have to write them! :)
15:19AWizzArdI'm glad about my internal software.. it needs some downtimes at nights, but in reality the system is even working them. Never rebooted so far..
15:28bradbevrhickey_: I was trying to make prettier slime backtraces by changing user.foo_QMARK___1234.invoke -> user/foo?. I used a heuristic to do it, but is there an internal map of java symbol names to clojure names?
15:31rhickey_bradbev: clojure.lang.Compiler/CHAR_MAP
15:32bradbevoh, I found that. I was really meaning the __1234 part
15:32bradbevI assume that is a gensym, and I can't rely on it being 4 digits
15:32rhickey_bradbev: right
15:34bradbevactually, I guess I use #"__\d+" to remove it, so the amount of digits won't really matter
15:42SnowBuddythe lazy programmer in me wants to know if macro-fu is necessary for Clojure programming. i mean, unless i totally don't understand the point of macros, they don't seem like a requirement for getting things done. i'm usually wrong, so could somebody correct me?
15:43AWizzArdSnowBuddy: you never need macros. In all cases you can solve your programs with pure functional programming.
15:43AWizzArdThe difference is, that macros allow you to remove ' and #(..) and (fn []) from your code
15:43SnowBuddyhow much of a difference is that?
15:44AWizzArd(if (= a b) (fn [] (then)) (fn [] (else))) vs (if (= a b) (then) (else))
15:45jgracindoes the work on enabling AOT imply there will be a nicer/easier way to do what gen-and-save-class does?
15:45AWizzArdFor some constructs it is ugly to pass in functions, and that's why macros win in such situations.
15:46SnowBuddyok, that helps. i still think i'll avoid that part of the language. i'm not smart enough for functional programming, much less macros on top of it ;)
15:48AWizzArdin the end you can solve the program by functional programming and then have a one-line macro which just calls your functions and therewith removes the need for manually making expressions lazy
15:49SnowBuddycan you run that by me again? :P
15:51AWizzArdsolve the problem I meant
15:51SnowBuddyheh, i didn't even see that. it's the whole latter part that i didn't get
15:52AWizzArda macro does not evaluate its arguments
15:52AWizzArd(if true (print "Hello") (print "World")) does print only one of them
15:52AWizzArdif "if" were a function then always both strings would get printed.
15:53AWizzArdbut you can make them lazy.. stop them from being evaluated
15:54AWizzArd(if-function bool #(print "Hello") #(print "World")) - in this case you can decide which one you want to call inside if-function.
16:00bradbevthe macros section in "Practical Common Lisp" was illuminating for me. Skim read that to get a feeling for what macros can do for you, SnowBuddy
16:01SnowBuddythat's the problem. i feel i understand what they can do, but i don't see myself using them. it's kind of like inheritance in C++; i fully understand it, but so few of my problems require that feature
16:02SnowBuddybut with all of the talk about macros, i thought i might have been missing something
16:05Chousukeat the very least, you can use macros to make your code more expressive
16:05alecSnowBuddy: I find myself using macros in Clojure much less than in Common Lisp because Clojure provides easier lambdas and general sequence operators
16:07Chousukerather than writing the logic as is, you can write something that expresses more clearly the meaning of your code, and under the hood expands into something clojure can actually run.
16:07SnowBuddyspeaking of general sequence operators, let's say i want to print the namespaces from (all-ns) all on a separate line. i can do it, but everything i've come up with seems overly complicated. is there a quick and easy way with the standard functions like (this doesn't work quite right btw) "(apply println (all-ns))"?
16:10wwmorganSnowBuddy: (doseq n (all-ns) (println n)), before revision 1090. (doseq [n (all-ns)] (println n)) otherwise
16:11SnowBuddyWhy the brackets in the second version?
16:12wwmorganthe syntax changed to make it more consistent with for, let, loop, etc
16:12SnowBuddyso will the first not work anymore?
16:12wwmorganI'm pretty sure the first form is broken as of rev 1090
16:12Chousukeyeah, it is
16:12Chousukeit throws an exception I think
16:13SnowBuddypoo diddles, i guess i need to update my installation
16:13Chousukefor now, stay with revision 1088
16:13Chousukeapparently HEAD is quite volatile at the moment :P
16:13SnowBuddyhow do i know which revision i'm on/
16:13SnowBuddy?
16:14Chousukeif your code works, you're pre-1089 :P
16:15albinosvn? svn info
16:15SnowBuddyi just downloaded the zip from sourceforge...
16:19wwmorganSnowBuddy: the sf download lags behind head usually
16:23Lau_of_DKIf I have a seq-of-seqs that I want to output, I would think (map println seqs) would do the trick, but it takes the liberty to throw out a "nil" between every seq, why ?
16:24wwmorganLau_of_DK: because println returns nil, is my guess. You'd be better off using doseq anyway as map is lazy
16:26Lau_of_DKTHanks wwmorgan
16:26kotarakLau_of_DK: rule of thumb: side-effects => do*
16:26Lau_of_DKGood one
16:42SnowBuddyyou know what would be awesome? an example for each of the standard functions/macros in the documentation.
16:43ZakThat would be awesome. I bet if you contributed some good ones, they would become part of the official documentation.
16:43SnowBuddyi would, but i'm reasonably sure they wouldn't be good quite yet ;)
16:45ZakI know what you mean, but don't sell yourself too short. I'm still a Clojure novice, but having experience with other Lisps I think I have a very good grasp of the parts that are similar.
16:49SnowBuddyhmm, is there any reason why the output appears to be sorted? (doseq x (take 10 (iterate rand 100)) (println (int x)))
16:51wwmorgansnowbuddy: you want (repeatedly #(rand 100)), not (iterate rand 100). In the latter case you're feeding smaller and smaller numbers into rand
16:51Lau_of_DKrhickey_, when are these 'interim' svn updates expected to be completed?
16:51Lau_of_DKls
16:52SnowBuddyhow's that? does iterate send the result of the previous rand call to the next iteration?
16:52ZakYes, that's what iterate does.
16:53ZakIterate returns a seq of (f x), (f (f x)), (f (f (f x)))...
16:53SnowBuddygotcha
16:54SnowBuddyso what would i use iterate for?
16:55drewciteration?
16:55drewc:)
16:55Cark(iterate inc 0) = all the positive integers
16:55Carkthat's usefull
16:55SnowBuddydrewc: not in any form i'm familiar with ;)
16:56Cark(zipmap (iterate inc 0) (enumeration-seq (-> table .getColumnModel .getColumns)))
16:56Carka map from index to table column
16:57drewcSnowBuddy: FWIW i thought i was in #lisp, where ITERATE is indeed for iterating in the usual sense :)
16:57SnowBuddy:D
16:57SnowBuddybbiab
16:57SnowBuddytime to go home
16:59kib2gnuvince, do you wrote your new tutorial ?
17:01albinoWhat's the word on the clojure book? Has anyone looked at it yet?
17:02gnuvince_kib2: not yet, haven't had time to write this weekend.
17:03kib2gnuvince : ok, i'll wait
17:25roblallyI've been reading Pragmatic Clojure - it is very good.
17:25roblallyStill a work in progress, but worth acquiring even at this stage.
17:49bradbevI use Slime. If I have a recursive function & I re-evaluate it - ie, to stop recursing - the definition doesn't take effect in the running function. Is this a Slime problem, or an artifact due to recur not looking up the function by symbol
17:51Chousukelatter, I think.
17:52bradbevdoh
17:52bradbevIt would be handy to be able to do that, perhaps make it a global property some how?
17:53bradbevotherwise you can't edit & fix recursive functions on the fly like you can with other funcs
17:53SimonAdameitHi
17:58bradbevthis also applies to agent functions that resend themselves to agents, the clojure symbol is looked up at compile time rather than runtime. That is good for speed & local functions, but annoying for development & global defs. Thoughts rhickey_ ?
18:02bradbevnope, I lied about the agent thing
18:02bradbevonly recursive functions
18:04rhickey_bradbev: that seems backwards - you can redefine recursive fns and see it rught away - but self-sends from agents should use #'action-name to send the var rather than its current value
18:07lisppaste8bradbev pasted "weird" at http://paste.lisp.org/display/70099
18:07bradbevthis is running via slime, which I think spawns a thread for each eval - is the def thread local then?
18:08rhickey_no, def is global
18:09rhickey_but recur is not a self-call but a direct loop
18:09bradbevso the goto is calculated once at compiletime
18:10rhickey_bradbev: it's a loop, not a function call
18:11bradbevtrue.... and if it were in a (loop...) I probably would have been quicker. As a tail-call mimic I didn't clue into that as much
18:12bradbevso for recur there is no way to fix on the fly :(
18:14bradbevthanks for the help
18:14rhickey_sure
18:15bradbevBTW, I'm really liking Clojure quite a lot - thanks for all the effort!
18:16rhickey_great - you're welcome!
18:17danm__+1
18:23ZakI'm having trouble trying to use swank with Clojure. Before I ask any detailed questions, will it work with 20080916, or do I need a recent snapshot?
18:24ChousukeI think you need something more recent. however, not the most recent.
18:24Chousukego with r1088
18:35ZakI tried r1088 and I'm still getting the following exception: java.lang.Exception: Unable to resolve symbol: *e in this context
18:46rhickey_psst - wanna try AOT compiler? rev 1093 9
18:46rhickey_(for the daring only)
18:47Chouserrhickey_: using #'action is so that the action is looked up when the agent actually run rather than when it's queued?
18:50rhickey_Chouser: when you say (send agt foo) the fn value is sent, so if you change the var foo, it's not seen by the agent
18:50rhickey_Chouser: vs (send agt #'foo) which sends the var itself,, agent will get current value whenever it uses it
18:50bradbevI guess AOT means that we'd be able to deploy a JAR full of class files generated by Clojure?
18:51rhickey_bradbev: yup
18:51bradbevnice!
18:51rhickey_Clojure itself runs without the source for core.clj et al
18:51Chouserrhickey_: in the case of an agent sending the same action to itself, though, it'll still pick up a change in the var, just perhaps one iteration late, right?
18:52bradbevSo you're not counting core.clj as part of Clojure now? Very Scheme of you!
18:52rhickey_Chouser: only if you use #'
18:52rhickey_bradbev: I count it, just highlighting that even the bootstrap works from classfiles generated by AOT compiler
18:53gnuvince_Interesting times ahead in Clojure Land :)
18:53bradbevoh, I see - I thought you were making a joke :)
18:54ChousukeI wish git svn clone wasn't so slow ;/
18:54Chousertime from shell prompt to repl was about 2 seconds. after pre-compiling, about 0.8 seconds.
18:55rhickey_Chouser: and java HelloWorld?
18:56rhickey_startup was never long for me, but people with old machines have said it's several seconds - interested in the speedup for them
18:57mibueh, clojure is mentioned in a +4 slashdot comment: http://developers.slashdot.org/article.pl?sid=08/11/10/0453229
18:59rhickey_Clojure has been mostly ignored by slashdot so far, interesting how Ioke gets an article at this stage of its development
18:59gnuvince_Gah!
18:59gnuvince_I forgot to push my blog articles from work :-/
19:00Chousukerhickey_: well, I guess no-one has actually tried posting a submission about clojure yet.
19:00miburhickey, maybe ioke is underdeveloped, but it got PR
19:01Chousukeand maybe now is not the best time to slashdot clojure
19:01rhickey_Chousuke: right
19:02miburhickey, do you track website hits, svn hit, google group user count, download count, etc to see when there is a surge of interest?
19:02gnuvince_It's funny the difference between communities
19:02gnuvince_Reddit has had Clojure articles for a year now, and quite a few in the past weeks.
19:02rhickey_mibu: yes, there are some measures
19:02gnuvince_I'm not sure if it made an appearance on Digg or Slashdot.
19:02miburhickey, when was the biggest surge?
19:03Chouserjava hello world (short classpath, don't know if that matters) 0.12 seconds
19:03mibuslashdot is a lot more mainstream than reddit. it's more of a java crowd than a lisp crowd.
19:04rhickey_mibu: seems so
19:05danlarkinreddit's gone down the tubes in the past year
19:05rhickey_https://sourceforge.net/project/stats/detail.php?group_id=137961&ugn=clojure&type=prdownload&mode=12months&package_id=0
19:05Chousukehmm... judging from the git svn clone output, it looks like you pretty much abandoned the CLI port of clojure at revision 261 :)
19:06rhickey_http://sourceforge.net/project/stats/detail.php?group_id=137961&ugn=clojure&mode=12months&type=svn
19:07bradbevIs there a good bridge between CLI & JVM? It should be possible. Sensible... maybe not.
19:07danlarkinwow october!
19:07miburhickey: was there a single event that made it surge like that?
19:08gnuvince_Wasn't it the Boston Lisp Talk?
19:08rhickey_Boston Lisp and JVM Summit
19:09mibugnuvince, that was an actual event. but it's not an event until someone posts something about it on the web. you know, a blog entry, a mention on slashdot, a high rated reddit entry, etc...
19:09rhickey_http://clojure.org/space/stats/overview/2008
19:10gnuvince_Nice graphs
19:10rhickey_only started using that site in June
19:10mibugreat graphs. very interesting.
19:11mibuthat spike in the middle of october, which blog post/site mention caused it?
19:11gnuvince_mibu: Reddit had some noise about both events.
19:14rhickey_Between Boston Lisp and Lisp50 at OOPSLA, I think Lispers have embraced Clojure, plus the one friend tells two others effect is kicking in, more experienced users can tell richer stories, lots of factors.
19:16rhickey_the group membership and message volume is taking off as well
19:18ZakIs there any documentation for the AOT compiler or should I just read the source code?
19:18rhickey_Zak - I put some tips in the checkin message
19:19rhickey_basically, your code must conform to the new lib format - my.fancy.lib should be in my/fancy/lib.clj in classpath
19:19mibui'm fascinated with how a small number of single events causes a surge of interest in things.
19:19rhickey_you can compile it with (compile 'my.fancy.lib)
19:20rhickey_mibu: it used to be a lot clearer, now there are so many mentions in different places - like last week O think there was a hit due to mentions at #rubyconf
19:21ZakI think a lot of times there's latent interest, but some missing feature keeps people from using a project.
19:21rhickey_zak: then there will be classfiles in ./classes
19:22rhickey_Zak: yeah, and different communities with different awareness levels
19:23mibuit's interesting if there will be a 1.0 adoption surge.
19:23rhickey_For AOT to be generally useful, the lib fns need to use the classfiles, as per RT.loadLib, and clojure-contrib will have to move to the new dir structure
19:24rhickey_I'm ready for people to start trying that
19:26ZakFor example, I have a future project planned for which I'm probably going to use Clojure. It will be a proprietary desktop app, for which I would like to use AOT compilation and proguard or something like it.
19:26rhickey_what's a good open source Java decompiler?
19:31waltersrhickey_: i spent a good hour or two searching for one with little luck for something that looked modern and sane, if you find one let me know =) however I did find this very useful: http://asm.objectweb.org/eclipse/index.html
19:33rhickey_well, people concerned with decompilation can now try it on the AOT code
19:33waltersrhickey_: though this one looked the most promising, i didn't try it though (aside from the applet): http://jode.sourceforge.net/
19:34rhickey_walters: looks pretty old
19:34waltersyeah, like i said that was the most promising out of a rather sad lot...
19:36waltersrhickey_: the other trick i found useful was ASM's verifier, not sure if you're using that or not
19:36walterssince openjdk's verifier emits nearly useless error messages
19:37rhickey_ASM's verifier doesn't produce Java source for the program, does it?
19:37rhickey_ASMifier produces the Java code needed to get ASM to emit the bytecode
19:38waltersno; this is in the more general scope of "debugging tools for people generating java bytecode"
19:38rhickey_walters: right, I use that myself :)
19:38albinohttp://java.decompiler.free.fr/
19:38waltersi'm not talking about ASMifier but CheckClassAdapter
19:41rhickey_walters: ditto
19:42bradbevanybody know anything about java non-blocking sockets? I'm accepting on my server socket, then using a new selector for each client connection, but the problem is that select won't block on the sockets, even though they have no bytes pending. Argh!
19:52rhickey_albino: that one doesn't show anything useful for the Clojure-generated code
19:55rhickey_thanks for the pointer, looks nice
19:56albinowell that sucks
19:57albinoThe only other one that my friends are telling me is good is JAD
19:59Chouserso require and friends are updated yet?
19:59rhickey_Chouser: not yet
20:05lisppaste8Chouser pasted "updating the action of a self-sending agent" at http://paste.lisp.org/display/70104
20:06rhickey_Chouser: I've added a loadLib method to RT, which loads from a classfile if available and newer than the source
20:06Chouserah, ok.
20:06Chouserand that must be what Repl's using at startup
20:07Chouseras for self-sending agents, I must be misunderstanding you.
20:08Chouserthat paste demonstrates what i was expecting, not what I thought you were saying.
20:13gnuvince_Is there a way to import all the classes in a package? something like (import '(org.foo.bar *))?
20:13rhickey_Chouser: right, I was remembering when I first did the ants, it was the case that a reference to act inside act was resolved to "this", and not via a deref of var #'act. So #'act is only needed when a fn will be held onto, like in a data structure
20:14rhickey_gnuvince: no
20:14gnuvince_ok
20:14rhickey_gnuvince: would just make a mess in the ns
20:14rhickey_since they are reified
20:15gnuvince_rhickey_: that's fine, I'm just playing with a class in the REPL and it would've been quicker than type 7-8 class names.
20:15gnuvince_But it's no big deal
20:15rhickey_there's also been some talk about leveraging the imports for more inference: http://groups.google.com/group/clojure/msg/5c9a008c794b193d
20:16rhickey_* imports could negate that optimization
20:16gnuvince_ok
20:21Chouserrhickey_: thanks, that makes sense.
20:22rhickey_Chouser: sorry for the misinfo
21:58lisppaste8danlarkin pasted "generic dispatch" at http://paste.lisp.org/display/70110
21:59danlarkinthere we go, that's what I want to be able to do
22:44slavaerg: what a surprise to see you here
22:47slavahi rhickey
22:53rhickeyslava: hi
22:54danlarkinah rhickey, just the man I need... here's what I'm aiming for... http://paste.lisp.org/display/70110 - can it be done with multimethods or do I have to create my own method of dispatching and keep a state-holding variable around on thread-local or something
22:56slavarhickey: are we going to see clojure in the language shootout at some point?
22:57rhickeyslava: that's not something I'd spend my time on, but I imagine someone will at some point
23:12rhickeydanlarkin: I'm not sure I get it
23:21danlarkinrhickey: it'd be nice for the user to add a dispatcher that returns nil or a keyword, and then be able to define a multimethod on that keyword