#clojure log - May 15 2009

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

0:02 duck112358: technomancy: I'm surprised that considering you hope to tackle mvn integration, corscrew doesn't itself follow the maven conventions

0:02 looks cool otherwise

0:06 technomancy: duck112358: I started the project before I really used mvn much

0:06 what conventions specifically do you mean?

0:06 having its own pom?

0:06 duck112358: also the whole src/main/clojure and src/test/clojure

0:07 I am just now trying to get my project working with maven

0:07 soo I've been reading the book

0:07 I started work on archetypes to create clojure project stubs with maven, but I'm just learning it

0:09 I really wish we had some sort of Maven for the Clojure programmer wiki page to write down just what you need to know to get started doing it right

0:10 if every clojure library had a consistent folder layout, the world would be a much happier place

0:12 technomancy: duck112358: have you seen the clojure-pom project?

0:12 at work we write poms that inherit from that, so you end up having to write only a small amount of XML

0:13 duck112358: wait, the one for just clojure, or something else

0:13 technomancy: it's one that any clojure project can refer to as a parent and automatically get a certain subset of functionality

0:13 duck112358: are you using the maven-clojure-plugin to compile, or call out to java?

0:14 technomancy: just calling out to java

0:14 http://github.com/dysinger/clojure-pom

0:15 clojure-http-client uses that

0:15 duck112358: ok, because I have been running into classpath issues with the maven plugin

0:16 I've been pulling from the tapestry repository for clojure and clojure-contrib

0:16 technomancy: we just set our classpath to src/:target/classes/:target/dependency/ and use mvn process-resources to unpack all the deps (including clojure) in target/dependency. works like a charm, and the classpath never changes

0:16 duck112358: I still think the -lang suffix needs to go, but I'll shut up about that for now

0:17 technomancy: yeah, I think it's unnecessary.

0:17 duck112358: does that AOT compile your code?

0:17 technomancy: sounds like Rich agrees

0:17 we haven't been doing AOT yet, but it would be easy to add

0:18 duck112358: it should be fixed whenever 1.0.1 goes out, i think

0:18 see, I need to AOT compile my stuff, because I'm running with Tomcat

0:19 another library I'm working on compiles just fine, but when I coppied the xml to another client, I'm getting a file not found error

0:20 btw, I got to explain the joys of clojure to 6 ruby guys at last nights meetup

0:20 technomancy: how'd they take it?

0:21 I've found they aren't to happy about my "Ruby is still my favourite imperative language" quip. =)

0:22 duck112358: they were definitely interested. At least one guy is going to check it out

0:22 I also had to explain emacs to them. (I was the only non-mac guy)

0:23 technomancy: heh; rubyists.

0:24 always confused as to why anyone would want something more sophisticated than textmate

0:25 duck112358: I've never used textmate, so i can't speak for or against it

0:25 I've always been into the kitchen sink

0:26 before emacs it was eclipse

0:26 technomancy: that's the kitchen sunk

0:27 duck112358: The only thing I miss is Oxygen is 100x better than nXml for editing xml documents.

0:27 p_l: eh, rubyist + Macfanboy = bad combination

0:28 duck112358: I felt kinda left out, I don't do rails, they all did. They all had their macbooks and iPhones, I just have my eeepc

0:29 p_l: it's mostly the rails crowd that is mac-happy ;-)

0:30 technomancy: well eeepcs are pretty hip these days

0:30 doesn't hurt that you can run whatever software you like on them. =)

0:30 hiredman: I ? my wind

0:32 duck112358: I run dovecot, mysql, tomcat, and emacs on mine

1:02 duck1123_: is there any clear way to know what an ExceptionInInitializerError on line 1 means?

1:03 I know it's a problem with my ns macro, but i don't know what

1:07 did the format of ns change recently? This used to compile

1:07 hiredman: the ns macro changed

1:08 duck1123_: ok, then it's not maven that caused all of my ns calls to miraculously fail

1:08 i'll look into the fix

1:09 do you know if that was on the list?

1:10 hiredman: I do not think it was

1:10 clojurebot: latest?

1:10 clojurebot: latest is 1368

1:10 hiredman: r1368

1:10 r1367

1:11 duck1123_: hmm... so where would i need to go to find out what to change?

1:12 hiredman: clojurebot: stat! is <reply>a sap

1:12 clojurebot: 'Sea, mhuise.

1:12 hiredman: svn diff?

1:12 google code might have a nice diff thinger

1:13 duck1123_: ok, then i'll have to do that in the morning

1:14 i'm not quite happy with this emacs maven integration lib i found yet

1:14 but it's compiling

1:16 cads: hey, I've got a thing that lets you build vector spaces on an underlying data type, and exposes a bunch of vector operations on the resulting type

1:17 technomancy: there's no cp -r equivalent in the JDK, is there?

1:18 cads: how should I encapsulate a space and its functions so that you can have a few instances globally, but can still use the functions comfortably?

1:18 could a new namespace be created for each new vector type?

1:19 technomancy: yeesh: http://www.dreamincode.net/code/snippet1443.htm

1:19 duck1123_: technomancy: ruby has one. :)

1:19 * technomancy sticks with (sh "cp" "-r" foo bar); that's ridiculous

1:20 memoize: technomancy: java can't even tell if a file is a symlink ;p

1:20 hiredman: cads: maybe binding?

1:20 technomancy: memoize: That's Not Portable(TM(TM)

1:21 hiredman: you could use Chouser's jni (jna?) thing

1:21 call out to libc

1:22 memoize: yeah, saw that, using that technique to do lots of unportable things with java, clojure

1:23 duck1123_: technomancy: cp -r isn't portible either.

1:24 the maven repository for clojure doesn't have a 1.0 version

1:24 that's upsettinng

1:24 hiredman: big thread on the mailing list

1:24 about how to push the 1.0

1:24 *sigh*

1:24 duck1123_: I'm talking about the tapestry one

1:25 technomancy: portable enough for me

1:25 windows users can PDI

1:26 hiredman: dirty gnu hippie

2:01 unlink: Yes, cp -R would be portable.

2:02 It's almost laughable to consider someone might be using a non-Linux unix now.

2:02 When was the last time you logged into a Tru64, Solaris or FreeBSD box?

2:02 hiredman: every day

2:03 unlink: hah

2:03 Which of those?

2:04 hiredman: freebsd

2:04 unlink: I haven't logged into FreeBSD since mid-2007.

2:04 slashus2: unlink: Mac OS X follows the UNIX specifications now. But that is an obvious example.

2:05 hiredman: unlink: your loss :P

2:05 * mattrepl is feeling the nostalgia

2:06 * Raynes just won his first game of Go against someone that isn't made out of 0's and 1's.

2:16 technomancy: did something change about AOT compilation recently?

2:16 old script that used to work suddenly went bonkers

2:17 java.io.IOException: No such file or directory (deps.clj:1) when I try to compile a namespace that works fine in the repl

2:19 back to 1.0, I guess.

2:29 hah. I just read the elisp definition of cond instead of the clojure one.

2:29 was very confused for a minute there

5:34 AWizzArd: I want to inline (defn get-entry [key] (find @*my-ref* key)). Is (def #^{:inline #(find @*my-ref* %)} get-entry) the right way to do it? Looks a bit strange...

6:50 markusgustavsson: AWizzArd: definline?

6:50 ~definline

6:50 clojurebot: Gabh mo leithsc�al?

6:50 markusgustavsson: ~brain

6:50 clojurebot: brain dump is http://clj.thelastcitadel.com/clojurebot

7:05 cemerick: ooh, there's lots of new stuff :-)

7:05 ~haskell

7:05 clojurebot: Yo dawg, I heard you like Haskell, so I put a lazy thunk inside a lazy thunk so you don't have to compute while you compute.

7:05 cemerick: very nice.

7:07 In order to be fully compliant, that probably should be s/inside a/inside your

7:17 AWizzArd: markusgustavsson: definline sounds good, thx

7:27 I have two functions F1 and F2. In F1 I @*my-ref*. In F2 I have a transaction in which I call F1. Am I right that F1's dereferencing of *my-ref* is in that case also protected by the transaction?

7:39 "In F1 I access @*my-ref*."

7:58 ~ def definline

7:58 ~ def definline-

8:02 ,(macroexpand-1 '(definline foo [x] (+ x 1)))

8:02 clojurebot: java.lang.RuntimeException: java.lang.ClassCastException: clojure.lang.Symbol cannot be cast to java.lang.Number

8:03 AWizzArd: oh

8:04 hmm, where is the problem with that definline example?

8:07 liebke: (definline foo [x] `(+ ~x 1))

8:08 markusgustavsson: AWizzArd: x is not a number

8:08 liebke: AWizzArd: I guess you treat definline just like defmacro

8:09 markusgustavsson: liebke: yeah

8:09 AWizzArd: ah oki

8:17 heart-hacker: heloooooooozzzzzzzzzzzzzzzzzz!!!!!!!!!!!!!!

9:48 tmi: in compojure, anyone know how I can do the equivalent of (route :*) with the new defroutes macro?

9:48 clojurebot: compojure is http://github.com/weavejester/compojure/tree/master

10:17 chessguy_: woohoo! the day has arrived!

10:33 Chouser: I've got a 3rdparty .class file with a class in the anonymous package.

10:33 Is there any way to use that from Clojure?

10:37 ah, (Class/forName "Jzmq") ...not ideal, but it gets me a little farther down the road.

10:37 danlarkin: http://jira.fastmq.org/browse/ZMQ-226

10:38 :)

10:38 Chouser: nice

10:43 chessguy: anybody using enclojure?

10:48 hm, quiet group today

10:52 hiya rich

10:53 bstephenson: i'm using enclojure

10:54 rhickey: chessguy: hey

10:56 Chouser: into-arruser=> (.newInstance (first (.getConstructors (Class/forName "Jzmq"))) (into-array "localhost"))

10:56 java.lang.IllegalAccessException: Class clojure.lang.Reflector can not access a member of class Jzmq with modifiers "public" (NO_SOURCE_FILE:0)

10:56 what kind of sense does that make?

10:58 chessguy: bstephenson, so i'm trying to start simple with a clojure project

10:58 bstephenson, i've created a new project, and in Source Packages, i've created a file "front-end.clj"

10:59 in which i put "(defn main [] print "hi")

10:59 but it fails to build

11:00 tmi: chessguy: (defn main [] (print "hi"))

11:00 chessguy: tmi, same error

11:00 (my code worked in the repl too)

11:01 i get 'Exception in thread "main" java.lang.ClassCastException: clojure.lang.PersistentList (.clj:4)'

11:02 along with the requisite massive stack trace

11:08 tmi: chessguy: up the stacktrace up on paste.lisp.org; someone might be able to figure it out (I'm off, so can't help you)

11:09 lisppaste8: chessguy pasted "stack trace" at http://paste.lisp.org/display/80295

11:11 chessguy: nothing terribly interesting there

11:13 bstephenson: chessguy: sorry stepped away for a sec

11:13 chessguy: bstephenson, yeah, i'm docking your paycheck for that one

11:16 bstephenson: chessguy: have you tried naming your main clojure function "-main", not "main"?

11:16 chessguy: um...no

11:16 stuhood: what does compiling do when there is no namespace declaration, or gen-class?

11:17 hiredman: you can't, using (compile ...)

11:17 it takes a namespace

11:17 chessguy: bstephenson, doesn't seem to make a difference

11:17 stuhood: hm... so maybe you need a namespace?

11:17 hiredman: chessguy: did you pastbin the code ittself somewhere?

11:17 chessguy: stuhood, the IDE puts a namespace in there automatically

11:18 stuhood: gotcha

11:18 chessguy: there's really no code to it

11:18 hiredman: well obviously there is some

11:18 bstephenson: chessguy: look here: http://clojure.org/compilation under the "gen-class Examples" section

11:18 chessguy: other than the (defn main...), which i wrote out

11:19 hiredman: are you running 1.0?

11:19 bstephenson: clojure main function should be named "-main".

11:20 chessguy: that makes it the default entry point for java when loading the class.

11:20 chessguy: bstephenson, the first example there fails to compile in the same way

11:20 hiredman: chessguy: what version of clojure?

11:21 chessguy: probalby not quite 1.0

11:21 but pretty close

11:21 hiredman: before or after close?

11:22 chessguy: before

11:22 hiredman: chessguy: pastbin the code

11:22 and how you are compiling it

11:22 chessguy: how?

11:22 err, what do you mean by "how" i'm compiling it?

11:23 hiredman: just (compile 'name.space) ?

11:23 chessguy: oh, i'm using enclojure

11:23 i did mention that

11:23 not sure what command it runs internally

11:24 bstephenson: chessguy: the example code on clojure.org won't run within netbeans/enclojure as written without some adjustment. But if you build it and run it, sending it an argument like "Fred", it will work.

11:25 chessguy: bstephenson, i'm not even getting as far as running it...

11:25 bstephenson: chessguy: the -main that will run in netbeans looks like this:

11:25 (defn -main ([greetee] (println (str "Hello " greetee "!"))) ([] (-main "world")))

11:25 chessguy: it should build, right?

11:25 AWizzArd: is there something like dissoc-in (similar to update-in)

11:26 bstephenson: chessguy: yes, it build with my enclojure

11:26 (the original code from clojure.org)

11:28 lisppaste8: chessguy pasted "complete code/output" at http://paste.lisp.org/display/80297

11:28 chessguy: there you go hiredman

11:29 that's as complete as i know how to be

11:31 bstephenson: chessguy: that code built in my enclojure, but I have clojure 1.0. Have you tried a "Clean and Build" in NetBeans'?

11:31 chessguy: bstephenson, yes. same thing

11:34 is there some easy way to tell from the repl what version of clojure i'm using? i don't recall

11:36 bstephenson: chessguy: I just created an entirely new project called Hello, with default namespace clojure.examples.hello, enclojure created hello.clj (which should be the name of the file you are compiling), cut-and-pasted code from your code output, and it compiled in my enclojure!?!?

11:36 chessguy: wait, enclojure created hello.clj?

11:39 heh

11:39 ok, it seems to be working now

11:40 bstephenson: yes, when I created project Hello, it asked me what my default namespace was. I said clojure.examples.hello. Enclojure create directories /clojure/examples, and then creates file hello.clj . That is how the filename and directory structures have to be in order for clojure (like java) to compile (if you use the ns symbol)

11:40 chessguy: good to hear! Never argue with success!

11:40 chessguy: yeah, i guess i was messing with the namespaces too much

11:40 interestingly, it created my file with the exact code from that examples page already in it

11:41 bstephenson: yes, that code is included when we construct a default project in enclojure. It is there for you to enjoy modifying :)

11:42 clojure/enclojure are very specific about namespaces and file and driectory structures (like java), so keep an eye on it.

11:42 chessguy: so what if i want sub-namespaces like clojure.examples.hello.foo and clojure.examples.hello.bar?

11:44 bstephenson: you would have files clojure/examples/hello/foo.clj and clojure/examples/hello/bar.clj (both in same directory)

11:45 chessguy: just a tip from me personally: avoid using hyphens or underscores in filenames, it can get confusing switching between clojure's hyphens and java's underscores.....

11:46 Chouser: justrunyourwordsalltogetheritsmucheasier

11:46 bstephenson: okwithinreasonavoidhyphens

11:48 chessguy: haha

11:49 bstephenson: Chouser: I do write a lot of functions with hyphens, but try not to make the last name in the namespace with a hyphen, so I don't get hyphenated filenames. Do you create a lot of namespaces where the result is the source filename contains the hyphen?

11:50 Chouser: I don't specifically try to avoid it. I guess it depends on how much java interop you're doing.

11:51 the only reason you'd need to know that a - in a function name should be a _ is if it's a method name in Java, right? At which point camelCase may make sense.

11:52 bstephenson: Chouser: True, and I am a big camelCase proponent, but it is discouraged at our comapny.

11:52 I appreciate your POV though, thx

11:52 Chouser: camelCase is discouraged in Java sources?

11:52 bstephenson: no in clojure sources, and clojure namespaces

11:53 Chouser: oh, sure. yeah, if it's not for going to be (primarily?) used in Java, then you can usually use hyphens with little negative consequence. esp. for function names.

11:53 now namespace/class/package names may be a bit different -- you're more likely to see the underscores in your source file names and such.

11:54 but since those are also going to show up less frequently in your source code, perhaps machingthemtogether is reasonable.

11:54 bstephenson: yes, implies more into Java interop in that project......

11:57 I think I would try to find a single word synonym for matchingthemtogether, and use that. But I am not nearly the expert as others here, so MHO should be taken with much salt. Mostly I was trying to answer the enclojure problem question. :0

11:57 :)

11:57 chessguy: does netbeans interact well with version control?

11:57 bstephenson: We have found little problem with SVN so far. Have quite a few projects there

11:58 Chouser: bstephenson: well, I appreciate you answering questions. I've been slacking off in that regard a lot lately, compared to what I used to do, and I don't think anyone's missed me. So thanks for your part in that. :-)

11:59 bstephenson: Chouser: when you take that first step to answer someone else's question, it is a bit daunting....glad I knew what I was talking about!

11:59 hiredman: au contraire

11:59 Chouser: I missed you

11:59 * rhickey misses Chouser

12:00 chessguy: awwww. group hug!

12:00 rhickey: who else will remember when I forget?

12:00 chessguy: ~remember rhickey

12:00 clojurebot: he works hard so you don't have to

12:00 bstephenson: hiredman: couldn't agree more. Only listen to rhickey's posts more than Chouser's!

12:03 Chouser: so the problem with that class is that the class itself was not marked public.

12:03 even though the constructor was.

12:04 does that mean that only other unnamed-package classes could have used it?

12:04 and why do I feel like I'm the first person to have ever tried to use this?

13:04 technomancy: clojurebot: what is peepcode?

13:04 clojurebot: You don't have to tell me twice.

13:04 technomancy: clojurebot: what?

13:04 clojurebot: what is peepcode?

13:04 technomancy: clojurebot: forget what

13:04 clojurebot: I forgot what

13:04 technomancy: silly bot

13:05 dysinger: moin'

13:05 technomancy: clojurebot: peepcode is a commercial screencast series; see the Clojure one at http://peepcode.com/products/functional-programming-with-clojure by technomancy

13:05 clojurebot: Ok.

13:08 * rsynnott never quite GOT screenscasts, even when free

13:08 rsynnott: also, that colour hurts my eyes

13:09 cp2: :)

13:09 hello all

13:11 technomancy: rsynnott: you can be comfortable in your masculinity and still be OK with pink; it's OK. =)

13:15 rsynnott: I'm not too worried about my masculinity

13:15 (I'm a homosexual, anyway, so allowed to be ok with pink regardless)

13:15 but that is a terribly ugly variety of pink :)

14:08 unlink: Yes, give me a regular blog entry over a screencast any day.

14:12 technomancy: I just used reduce and partial in the same line.

14:12 replaca: unlink: everyone has the medium they like best. I *do* like the occasional screencast, though mostly for tips and tricks.

14:12 * technomancy awards himself an FP merit badge.

14:13 replaca: technomancy: watch out, you might stumble into haskell :-)

14:14 technomancy: (http://nerdmeritbadges.com/)

14:15 unlink: lol at #02

14:15 rsynnott: so people like screencasts?

14:15 I alwaysa assumed they existed largely because people liked MAKING them

14:15 qmrw: can i define a function at the repl and then get the source for it later in the repl?

14:16 marklar: rsynnott: I think its like replaca said, everyone has a medium they like best

14:16 gnuvince: Screencasts are good, but I really like presentations.

14:16 marklar: I'm not a fan of them, but I've been teaching a friend programming and he loves them

14:16 gnuvince: Some people are just so captivating to watch

14:16 technomancy: depends on your learning style

14:16 gnuvince: Simon Peyton-Jones comes to my mind.

14:16 technomancy: having an engaging narrator is key. not many people can pull it off.

14:17 gnuvince: CS should have more females.

14:18 unlink: Screencasts suck because once you have watched it and you want to later refer to information in it, you have to seek to that position in the screencast.

14:19 Also you can't copy and paste information from a screencast.

14:19 gnuvince: unlink: you must hate real life ;)

14:20 unlink: I can copy and paste information from real life.

14:20 Well, at least the parts of real life that are written in blog entries.

14:20 technomancy: my Emacs screencast came with a text script, but I didn't get around to including it with the Clojure one. =\

14:21 gnuvince: unlink: I tried to right-click on the hot cashier at the gas station this morning

14:21 Didn't work :(

14:21 So no copy, and now I can't go there anymore

14:22 unlink: That's not how you interface with women.

14:22 technomancy: gnuvince: should have used keyboard shortcuts

14:22 unlink: The trick is to get her to try to right-click you.

14:22 replaca: I really liked the screencasts when I was learning rails. I think that's because rails consists mostly of a lot of little tidbits which make nice quick screencasts

14:23 gnuvince: unlink: I'll keep that in mind ;)

14:23 technomancy: :)

14:24 technomancy: I wish I had a tumblelog so I could post that. =)

14:26 gnuvince: tumblelog?

14:27 technomancy: http://en.wikipedia.org/wiki/Tumblelog

14:28 rsynnott: it's like a blog, but with fewer features!

14:29 (as distinct from twitter, which is like a blog, except with basically no features)

14:29 soon, there will be a service where you can simply post a smiley or frowny face depending on mood

14:30 technomancy: rsynnott: http://binarytweet.com

14:30 oh... it's down. =(

14:31 gnuvince: I'll make the nothingtweet!

14:32 You can't post anything

14:32 You just have an account

14:32 technomancy: gnuvince: it's the logical final step

14:35 gnuvince: The one before last

14:36 The last one is an empty index.html page that you sell for 4.8 billion dollars to Time-Warner

14:38 cemerick: what are people's general impressions of couchdb, assuming you've used it? (this being a more trustworthy crowd than the general programmer herds :-) )

14:38 technomancy: cemerick: head-over-heels.

14:38 it makes me very happy.

14:41 dnolen_: so technomancy: question about corkscrew.

14:41 clojurebot: technomancy is to blame for all failures

14:42 danlarkin: higher response time than an SQL database

14:42 technomancy: dnolen_: oh?

14:43 dnolen_: so how were you planning on resolving the location of a library from the client?

14:43 do you have first download the library and then run corkscrew to get the dependencies?

14:45 technomancy: dnolen_: right now only svn/git and http deps are supported; for those you need to give a URL

14:45 dnolen_: so the part I was working on worked something like this (and joining forces is a good idea).

14:45 from the REPL I type

14:45 (install 'library-name)

14:45 danlarkin: cemerick: I still have those couchdb functions I wrote, I bet technomancy has some too :)

14:46 dnolen_: this hits a server which looks up that librarys dependency info (your format).

14:46 then it could run corkscrew to install the whole shebang

14:46 and update the classpath dynamically

14:46 so you can just start trying out that library right away.

14:46 technomancy: dnolen_: updating the classpath isn't possible

14:47 but if you unpack the dependency onto a directory that's already on the classpath it should get around that flaw

14:47 dnolen_: you can dynamically add the classpath, and _also_ write to a file. and IDEs can use this file to load the REPL classpath.

14:47 there's just reason to maintain the classpath by hand.

14:47 it's too tedious.

14:47 libraries should define how to update the classpath.

14:47 cemerick: technomancy, danlarkin: how many nodes have you scaled out to so far?

14:48 technomancy: dnolen_: dynamically adding to the classpath only works for .clj files; you can't load bytecode from a classpath entry that's been added after JVM boot

14:48 cemerick: in my (brief) research so far, the only thing that's sent up flags vis a vis other options is the single-master nature of things (unless that's changed, and I'm reading outdated stuff)

14:49 dnolen_: technomancy: gotcha is that just a limitation of the JVM?

14:49 technomancy: dnolen_: correct

14:49 dnolen_: and no way to hack around that I suppose?

14:49 danlarkin: cemerick: just one. I agree, the couchdb replication model is... unusual

14:50 Chouser: I believe you can use -Djava.ext.dirs=foo and drop new .jars into foo at runtime

14:51 dnolen_: Chouser: I was just going to say that screw it, pull all jars in one place ;)

14:51 and OS specific dynamic libs

14:51 so what I'm describing is possible and desirable :)

14:52 cemerick: danlarkin: I like the simplicity quite a lot. I worry about what ends up happening when we start pushing too many writes for our master -- do we just go and shard things at the app-level? I can do that with mysql already, thanks.

14:53 danlarkin: cemerick: yes, I think sharding /and/ conflict resolution have to happen at app-level

14:53 cemerick: I've been reading what little is out there about cassandra, and it sounds like a great hybrid, but I have to recoil a little at its age. at the moment.

14:54 danlarkin: ha, I was just going to mention cassandra

14:54 one advantage it has over couchdb is it's known-good in a (HUGE) production deployment

14:54 a young project for sure, but obviously stable enough for facebook

14:55 hiredman: clojurebot: sdb?

14:55 clojurebot: Titim gan �ir� ort.

14:55 technomancy: sdb has a lousy query syntax and ugly urls compared to couch

14:56 cemerick: if it had *two* large users, I wouldn't think twice. Facebook is big, but having another set of set of eyes matters.

14:56 technomancy: but having amazon handle everything has its appeal

14:56 hiredman: ~sdb is http://github.com/richhickey/sdb/tree/master

14:56 clojurebot: Ack. Ack.

14:56 danlarkin: sdb is alright, but unusable in some situations, since it's on an external network

14:56 cemerick: indeed.

14:57 our plan is to set things up so we can plug in whatever persistence we want -- s3 would work just fine for us, but we can't be bound to it for all customers, etc.

14:58 danlarkin: not trying to be snarky, but I can't help but notice that rhickey's sdb api wraps an existing java API.

14:59 * cemerick has no problem continuing conversations from weeks ago :-P

14:59 cemerick: (or, s/has no problem/doesn't feel guilty about)

14:59 danlarkin: cassandra is now in apache incubator, I am expecting nice things from it

14:59 cp2: do you have a permit for that?

14:59 cemerick: danlarkin: ah, I didn't notice that

15:00 danlarkin: I know more about couchdb than I do cassandra at this point, does it have anything akin to couchdb's views?

15:02 cemerick: danlarkin: it uses a column-oriented data model, so aren't couchdb-style views irrelevant? (perhaps I've not yet grokked views...)

15:02 chessguy: hi ya'all

15:02 dysinger: I don't think any docdb has anything like couchdb's map/reduce views

15:02 except maybe super heavy-weight hadoop/hbase

15:02 and that's not really a doc db

15:05 danlarkin: cemerick: how can I get all users with first name "Dan", for instance

15:05 oh... thrift

15:06 eack, couchdb is much nicer in terms of query interface, from what I'm seeing on http://wiki.apache.org/cassandra/ThriftInterface

15:07 dysinger: there is project voldermort and hypertable

15:07 also

15:07 technomancy: yeah, the elisp client for couch is like 300 lines, and most of it is UI

15:07 danlarkin: yeah everyone and their brother has a K:V store

15:07 dysinger: yes

15:07 it's all the rage

15:07 I like couchdb

15:08 for documents at least

15:08 jackrabbit is even a close cousin with JCR

15:08 At erlang exchange a couple weeks ago Dynomite was demonstrated.

15:08 looked pretty

15:08 cool

15:09 danlarkin: the one thing that I have yet to see is a fair comparison between an SQL backend and a couchdb backed, by someone who actually *gets* document store backends, instead of just trying to replicate a relational model as a document

15:09 dysinger: the speaker went to his production systems and killed a couple servers in the cluster and the system kept running.

15:09 Yeah you are confused if you want to do SQL-type things with K:V stores.

15:09 by you I mean the abstract "you"

15:10 There is no direct comparison between sql and document/k:v dbs

15:10 It's not the same use case

15:11 danlarkin: there's overlap

15:11 dysinger: It's a whole different ball-game IMO

15:11 I don't see it. SQL is all about guarantees on write, transactions and related records.

15:11 you don't get that with K:V distrib dbs and document dbs.

15:11 but you do get other things

15:12 anyway that's IMHO from using couchdb and others.

15:13 cemerick: learning in real-time here: so, with couchdb views, I could potentially avoid having an index off to one side for semi-arbitrary querying?

15:13 (wow, this is incredibly OT :-P )

15:13 cp2: hugh

15:13 hush

15:13 *

15:14 danlarkin: cemerick: couchdb (stored) views are run each time a document is updated

15:14 or whatever

15:14 it's not read-time calculation

15:14 if that answers your question, I don't know

15:15 cemerick: well, that sounds promising -- so, I could create a view that contained only those documents belonging to a particular customer, etc?

15:16 danlarkin: exactly

15:20 Chouser: Sweet! The Java protobuf objects are immutable (unlike their C++ cousins)

15:23 cemerick: damn wacky wireless

15:24 danlarkin: cemerick: in case you didn't see it: [3:12pm] danlarkin: exactly

15:24 cemerick: yeah, I saw, just in time :-)

15:24 danlarkin: in that case, couchdb is *very* interesting indeed. It might turn into mysql past some unknown scale, but at least the data model is sane for what we do.

15:24 and who knows, we may never need that level scalability

15:25 danlarkin: it's a bit scary to build something on couchdb not knowing how well it works for scaling up

15:26 technomancy: it's erlang! magic scalability pixie dust!

15:26 clojurebot: erlang is http://clojure.googlegroups.com/web/erlang.clj

15:27 cp2: so uh

15:28 what distro do you guys prefer to use on servers? (be it for work, personal, whatever)

15:28 trying to decide what to install on this vps

15:29 danlarkin: cp2: might as well ask if we prefer vi or emacs

15:29 :)

15:29 cp2: hah danlarkin

15:29 im not trying to start a war here =P just asking for (small) opinions...

15:29 technomancy: use what you know

15:29 cemerick: we used fedora for a long time...switched to ubuntu server a few months ago

15:29 technomancy: unless it's fedora

15:29 =)

15:30 cp2: lol

15:30 well, currently it has centos 5 installed

15:30 but i am getting pretty pissed at it

15:30 am leaning more towards debian

15:31 danlarkin: I use gentoo, but don't say that too loudly anywhere or you'll get people shouting "--funroll-loops" at you

15:31 cemerick: that was sorta-kinda our progression. We decided on ubuntu purely based on its release pace and general level of activity compared to debian proper.

15:33 cp2: hah danlarkin -- i know

15:33 i used to run gentoo on a desktop at home

15:33 got a lot of abuse for mentioning it =P

15:33 cemerick: yeah, i was thinking that too

15:33 ubuntu is more 'up to date' (even though debian 5 just came out, but still)

15:34 danlarkin: I used to use debian (way back when potato was the stable release, long before ubuntu existed) but I prefer portage to apt by a longshot

15:36 cp2: well, i have sort of a love hate relationship with portage

15:36 i would rather not talk about it :(

15:42 arohner: wow, talk about rhickey's time machine. I was about to ask if there was a function to "replace" values in a collection

15:43 and so I thought "I know, I'll use find-doc before asking the channel"

15:43 and there it is, clojure.core/replace

15:48 cemerick: danlarkin: I've been off in #couchdb being a noob. It's not single-master at all.

15:49 danlarkin: oh word?

15:52 lisppaste8: cemerick pasted "danlarkin: multiple-master couchdb mini-transcript" at http://paste.lisp.org/display/80309

15:53 danlarkin: Ooooo

15:53 I wonder what the eta is like

15:53 "some time soon" :)

15:55 cemerick: well, it sounds like you can just round-robin the PUTs (which would be completely transparent to clients), and have functionally the same thing now

15:55 a little more sysadmin involved there, though, and you've still got the single point of failure (the proxy)

15:56 danlarkin: I joined #couchdb after you mentioned you were in there

15:57 cemerick: danlarkin: yeah, that's when I stopped the transcript :-)

15:57 danlarkin: a twisted server to round robin to different couches seems... weird

15:57 cemerick: I don't think the twisted server is necessary for the round-robining -- IIUC, that's to ensure proper application of the views.

16:01 danlarkin: cemerick: your problem sounds fun, I'm jealous :)

16:09 cemerick: danlarkin: eh, the storage stuff is the simplest part. We're still trying to figure out the real guts of the thing. :-)

16:37 danlarkin: cemerick: I'll try to get my couchdb functions up on the internets this evening (or some time this weekend, at least) and then you can start hacking them into shape :)

16:39 cemerick: danlarkin: I hope you won't feel bad if I say that we'll likely just use jcouchdb. We've no fear of dependencies, and already-tested code has a strong pull...

16:39 I will absolutely take a look, though -- maybe the advantages will outweigh that instinct.

16:41 danlarkin: haha I'm horribly offended!

16:42 just kidding of course, jcouchdb likely covers more features of couchdb right now

16:42 hiredman: hmmm

16:43 I wonder where that exception came from

16:43 ~still here?

16:43 clojurebot: It's greek to me.

16:43 cemerick: yeah. I've had a number of conversations here in the past couple of weeks with people reimplementing stuff in clojure that already exists in java with decent APIs. It's a confusing impulse to me.

16:44 dnolen: cemerick: only if you think that Clojure will never run on an environments other than Java.

16:45 danlarkin: we can't help it

16:45 dnolen: if Clojure runs on Objective-C, any library that explicity depends on Java will need to be rewrriten. versus writing against a stable Clojure based interface.

16:47 cemerick: dnolen: sure, but aside from "just wanting to" (completely legitimate motivation, of course), it seems like one would wait until those other backends are available, and then hopefully wrap whatever is natively available there with a common API that handles the gnarly details of hooking up with the bits that do the real work.

16:51 I hope no one takes my puzzlement the wrong way. I'm just talkin' over here. :-)

16:52 * danlarkin scoffs

17:03 Chouser: is proxy-super thread-safe?

17:04 maybe as long as the proxy instance is visibile to only one thread?

17:09 billy-: hi. i have a key that needs to be a string than back again...

17:09 when (keyword ":a") returns ::a

17:09 what's that?

17:09 Chouser: ,(name :a)

17:09 clojurebot: "a"

17:09 opqdonut: it's a keyword :)

17:09 Chouser: ,(keyword (name :a))

17:09 clojurebot: :a

17:10 billy-: ok, so its not :namespace/a then

17:10 ,::a

17:10 clojurebot: :sandbox/a

17:28 chessguy: ugh, what's that if-let construct?

17:31 leafw: chessguy: it's a short cut for (let [a (whatever)] (if a (do ...)))

17:32 chessguy: is there something similar for (let [a (whatever)] (if a a (do ...)))

17:33 opqdonut: :D

17:33 chessguy: opqdonut, :)

17:33 what are you doing in here?

17:33 opqdonut: coding clojure at work nowadays

17:34 chessguy: really? awesome!

17:34 stuartsierra: chessguy: (or (whatever) (do ...)))

17:34 chessguy: that's right, i forgot you were a java guy

17:34 stuartsierra, ooooh, good call

17:35 opqdonut: not entirely satisfied with the language but it's the best one available on the jvm :)

17:35 chessguy: opqdonut, what are you working on these days?

17:35 opqdonut: machine learning applied to robotics

17:35 mostly coding, other guys handle the theory

17:35 at a small startup

17:36 chessguy: whereabouts?

17:36 opqdonut: helsinki, finland :)

17:36 chessguy: cool. sounds like fun

17:36 opqdonut: you're still coding the chess system?

17:37 chessguy: starting something new in clojure

17:37 opqdonut: mhmm?

17:37 chessguy: figure it's about time i learn a lisp, and i really like a lot of the features of clojure.

17:38 opqdonut: yeah, pureness is nice

17:38 i've done some things in CL but the impurity kept bothering me after haskell

17:38 chessguy: yeah, i miss strong typing :(

17:38 * gnuvince_ too

17:39 dnolen: me not. ;)

17:39 opqdonut: i miss algebraic data types

17:39 not the typing that much

17:40 a shame the adt library in contrib is so unfinished

17:40 chessguy: dnolen, a little slack, please. we're trying hard to branch out here

17:40 opqdonut: guess i should contribute a few patches

17:40 dnolen: opqdonut: pardon my ignorance, but what does ADT give you over a relatively powerful object system like Smalltalk or CLOS except less flexibility and type checking?

17:41 opqdonut: dnolen: i just want discriminated unions i can case over

17:41 i'm used to thinking that way

17:42 struct-maps with a :type key aren't that good a solution

17:42 dnolen: interesting, do you have link for that? is this some form of dispatching?

17:44 opqdonut: mm yeah, basically

17:44 cemerick: have a good weekend, all

17:44 cp2:

17:44 cemerick: danlarkin: thanks for the couchdb info, etc.

17:44 opqdonut: dnolen: i haven't got a proper reference but i write a short example in haskell

17:45 dnolen: I have a copy of Real World Haskell looking at it now ;)

17:45 opqdonut: heh

17:45 data Expression = Lit Int | Plus Expr Expr

17:46 eval e = case e of Lit i -> i; Plus a b -> (eval a) + (eval b)

17:46 i want to write something roughly like that

17:47 http://code.google.com/p/clojure-contrib/wiki/TypesApiDoc <- a very unfinished implementation for clojure

18:12 guinea: What's the difference between sync and dosync? Is it laziness?

18:13 never mind, I just found the macro definition of dosync

18:57 chessguy: opqdonut, how would you change that API?

18:59 ,(eq? '(1 2 3) '(1 2 3))

18:59 clojurebot: java.lang.Exception: Unable to resolve symbol: eq? in this context

19:01 opqdonut: oh the types one? it's fine, the library's just pretty incomplete

19:01 chessguy: what would you add to it?

19:02 opqdonut: well the api pretty much has everything that's needed, defadt and match

19:03 chessguy: so...what's incomplete about it?

19:04 opqdonut: well, printing a nullary constructor throws a nullpointer exception

19:04 and other bugs

19:04 chessguy: oh, so it's buggy

19:44 unlink: Where's the part of prn that does the actual printing?

19:51 eee: i asked a question in the discussion group . . . got no answer

19:51 will try here

19:51 what's a good thing to return from java

19:51 so that

19:51 clojure can work with a "pair"

19:52 in my case, there's a minData() and a minPri() function

19:52 dnolen_: like returning a vector in clojure?

19:52 eee: but maybe the user just wants min()

19:52 and then they know that :data

19:52 gets the data

19:52 and :pri

19:52 pri

19:53 gets the priority

19:53 so maybe returning a map

19:53 with two keys

19:53 i guess the java code needs to include clojure at that point. to use clojure objects

19:54 native clojure objects

19:57 guinea: depends on if clojure objects are java objects

19:58 not sure if you'll need a wrapper though

19:58 eee: this is something for rhickey, i guess

19:59 guinea: yeah

19:59 eee: if it comes down to preference

19:59 guinea: in your shoes, i'd probably just use a java object

19:59 create a java class with pri and data

19:59 then perhaps use a macro of clojure function to access pri and data

19:59 eee: ok

19:59 tnks

20:00 guinea: either a macro or a function to access the pri and data fields/methods

20:00 eee: that's a thought

20:00 better than first and second, for sure

20:00 but at that point

20:01 not simpler than just asking heap

20:01 (.minData heap)

20:01 guinea: you can always use a clojure wrapper to return it in first, second format

20:02 eee: i could actually make the heap a lazy seq

20:02 well . . .doesn't solve the pair problem

20:02 i just confused myself

20:02 vm

20:02 nevermind

20:03 guinea: i'm trying to think of something useful to practice using refs and stm on

20:03 eee: i am working toward that with this work

20:04 first doing serial versions of heap algs

20:04 but will end with parallel branch and bound

20:05 guinea: and you're doing part of it in java?

20:05 eee: rich asked me to implement the heap in java purely functional

20:05 so I did

20:06 got a rockin persistent datastructure

20:06 need to do some examples

20:06 so people se the value

20:06 i've wanted to implement this stuff for a long time. . . .long before clojure

20:07 so now finally forcing myself to

20:07 very fun coding up the heap, and I have some stuff that may never have been done before planned

20:08 don't know clojure tho . . . so good project to start out with

20:08 guinea: sounds very cool

20:08 eee: http://code.google.com/p/jc-pheap/

20:09 feel free to mess with it or suggest stuff if you think it is a way to mess with stm

20:10 you could parallelize the a-star algorithm

20:10 that is included there

20:10 guinea: cool

20:11 eee: wow, now that I put the source in a zip, the download count went up to 2

20:11 i wonder how many read-only svn views were out before that

20:11 guinea: is there no count of those?

20:12 eee: not that I know of

20:12 i bet if I used github it would have helped, too

20:12 people seem to like that

20:14 ieure: GitHub is really nice.

20:14 guinea: what brought you to clojure?

20:16 eee: an article on languages coming out for parallelism

20:16 so it was gonna either be F# or clojure

20:16 and F# is microshaft?

20:17 and clojure had cool videos by rhickey

20:17 and clojure is lisp

20:17 parallel stuff and lisp? done

20:18 what about you, guinea

20:21 is there an easy way to get the set of keys from a map?

20:21 dnolen_: keys

20:22 ,(keys {:k1 'v1 :k2 'v2 :k3 'v3})

20:22 clojurebot: (:k1 :k2 :k3)

20:22 eee: well, that would be easy :)

20:23 guinea: I need to use the JVM and Java based libraries on some things, but don't really like Java

20:23 dreish: If you actually wanted a set, there's .keySet

20:23 guinea: I tried Scala, but found it was still pretty verbose

20:24 eee: dreish . . . it's for a reduce

20:24 so as long as some sort of "foreach" happens

20:24 dreish: Don't want a set then. :)

20:24 eee: right

20:24 but thanks for the info

20:24 that I'll forget

20:24 :(

20:25 dreish: (show {:a 1})

20:25 If you've loaded contrib repl-utils

20:25 eee: ,(show {:a 1})

20:25 clojurebot: java.lang.Exception: Unable to resolve symbol: show in this context

20:25 eee: really?

20:25 that is cool

20:26 guinea: what's the help command in the repl again?

20:26 dreish: Help for a function? doc

20:26 eee: ,(doc doc)

20:26 clojurebot: "([name]); Prints documentation for a var or special form given its name"

20:26 guinea: yup, that's the one

20:29 * eee wonders if his heap will find it's way into scala, too

21:13 lisppaste8: tmi pasted "key must be integer?" at http://paste.lisp.org/display/80320

21:14 dreish: tmi: In a vector, yes.

21:21 tmi: dreish: I'm trying to get session-stuff working in compojure; (with-session (fn [req] ...)) and I can't quite figure out where it goes wrong.

21:21 dreish: Oh, sorry. I've never tried compojure.

21:22 tmi: :/

21:22 Thanks anyway.

21:32 kli: is there a way to iterate over a collection while keeping a counter

21:32 like ruby's each_with_index

21:36 unlink: kli: a bad way to do it is (apply map list [(iterate inc 0) my-seq])

21:36 a slightly less stupid, but still bad way to do it, would be (map list (iterate inc 0) my-seq)

21:37 kli: i see

21:37 cp2: ,(map list (iterate inc 0) [1 2 3 4 5])

21:37 clojurebot: ((0 1) (1 2) (2 3) (3 4) (4 5))

21:38 lisppaste8: tmi pasted "key must be integer culprit...?" at http://paste.lisp.org/display/80322

21:40 kli: ,(def *test* 1)

21:40 clojurebot: DENIED

21:40 kli: haha

21:41 rejected =D

21:41 i was going to start using this as my repl...

21:41 cp2: ,(def *girlfriend*)

21:41 clojurebot: DENIED

21:41 cp2: :(

21:41 kli: the bot's grumpy

21:42 hiredman: tmi: what is merge?

21:42 the function merge?

21:43 tmi: hiredman: looks that way

21:44 hiredman: neither of those two things are maps, as far as I can tell

21:44 and the first thing is definitely a vector

21:44 ,(into [] {:a 1})

21:44 clojurebot: [[:a 1]]

21:44 hiredman: bah

21:45 ,(assoc [] :a 1)

21:45 clojurebot: java.lang.IllegalArgumentException: Key must be integer

21:46 tmi: hmm

21:49 it's supposed to be {:status 302...}; now I gotta figure out why/where it's converted :/

21:50 hiredman: ,(doc merge)

21:50 clojurebot: "([& maps]); Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the mapping from the latter (left-to-right) will be the mapping in the result."

21:51 hiredman: ,(merge-with merge [1 2] {:a 1})

21:51 clojurebot: java.lang.IllegalArgumentException: Key must be integer

21:51 hiredman: ,(merge-with merge {1 2} {:a 1})

21:51 clojurebot: {:a 1, 1 2}

21:52 hiredman: ,(doc merge-with)

21:52 clojurebot: "([f & maps]); Returns a map that consists of the rest of the maps conj-ed onto the first. If a key occurs in more than one map, the mapping(s) from the latter (left-to-right) will be combined with the mapping in the result by calling (f val-in-result val-in-latter)."

21:52 hiredman: hmmm

Logging service provided by n01se.net