#clojure log - Apr 02 2008

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

12:02 Chouser: rhickey: I added my first file to clojure-contrib. Before I announce it in the group, did you want to peek at it at all?

12:03 rhickey: sure, one sec

12:03 Chouser: no rush.

12:05 rhickey: neat - want to put a CPL.TXT in the directory?

12:06 Chouser: sure

12:06 rhickey: thanks

12:06 Chouser: done

12:07 rhickey: great! when I get time I'll put the ants and the spell demos in there

12:07 Chouser: sufficiently idomatic? Worth having it in contrib at all?

12:08 rhickey: sure

12:08 Chouser: oh, ok -- perhaps I'll hold off mentioning it in the group until you've add more stuff?

12:09 rhickey: no, go ahead - the things I have are already available

12:11 new glitch-free audio of the concurrency talk is up, for those that haven't yet suffered through the first version :)

12:12 Chouser: I got a call last night from a friend who, after listening to the talk and writing some clojure code, just wanted to call and "gush about Clojure".

12:13 rhickey: fun

12:13 Chouser: yep, that was the general conclusion. Writing Clojure code is fun.

12:14 rhickey: I had to write Clojure in order to keep programming fun for myself

12:20 cgrand: Hi! I've got a bug: (macroexpand '(and 2)) throws an exception

12:20 (expanded form is not checked to be a seq before the recursive call)

13:31 Chouser: any reason the symbol lists passed to refer are lists instead of vectors?

13:36 rhickey: Chouser: I don't think they have to be lists

13:37 quoted vectors seem weird to me

13:45 cgrand: fixed, thanks

13:47 cgrand: thanks! any reason for macroexpand not using recur?

13:48 rhickey: no, probably left over from when it was a macro

13:48 hopefully no one will blow stack with macroexpand :)

13:49 cgrand: I did (macros are new to me...)

13:49 :-P

13:50 Chouser: oh. yeah. How was I thinking that vectors were quoted already? Well, nevermind then.

13:50 rhickey: cgrand: would have been an infinite loop otherwise

13:51 Chouser: that's the trick, they are not quoted, they are evaluated

13:51 but you want the symbols, not their values

13:52 Chouser: right. right. I mean I clearly am using them correctly in several places, but somehow slipped a gear just now.

13:53 [...] is like (list ...) not like '(...)

13:53 rhickey: right

13:53 Chouser: and '[...] would seem, as you said, weird.

13:54 rhickey: '(a b c) for a list of symbols is an idiom

13:54 Chouser: have you looked at webjure much?

13:55 rhickey: not since it first came out

13:55 now you can do most of that in Clojure itself, given proxy

13:55 Chouser: It's got a syntax for inlining html, which I didn't know when I wrote my own. So now I'm comparing...

13:57 rhickey: see also: http://www.cl-user.net/asp/tags/11047

13:57 Chouser: it uses backquoted lists, ~, and ~@, while I just used nested vectors. I'm having a hard time seeing which is better.

13:58 does webjure's use of backquotes somehow move some of the work to compile time and result in better runtime performance?

13:59 rhickey: I'd like to see html gen, servlets, and url dispatch as separate libs

13:59 Chouser: my html gen is tiny

13:59 One 15 line function

14:00 rhickey: macros are all compile time, syntax quote doesn't have particularly small output, non-optimized at present

14:00 Chouser: It doesn't have any special support for javascript or CSS, which might be nice. Those might double it or so.

14:01 ok. I guess I need to look closer at what "defh" does, but it seems to me it's still got to insert values into that tree at runtime, and translate the tree to HTML after that, so I don't see that it can be doing a whole lot at compile time.

14:11 I wonder if it's using `() just so that you can expand lists in-place using ~@

15:42 abrooks: Chouser,rhickey: Should "coll?" (in zip-filter.clj) be added to boot.clj?

15:44 rhickey: probably, plus a few other of the tag interfaces, Sequential, Reversible etc

15:45 all should have predicates

16:58 Chouser: I don't know much about Java web servers and servlets. It looks like a web server expects to find a .class file for each servlet?

16:58 That seems like a poor fit for Clojure.

17:00 webjure seems to solve this by providing a single servlet and .class file itself, and then starting up clojure within itself, and loading .clj files from there.

17:20 rhickey: Chouser: yes, but I'm not sure it does the minimum in Java, maybe it does...

17:23 Chouser: Is it even possible to generate a class file from clojure code?

17:24 rhickey: not right now, possibly never

17:24 Chouser: ok that's what I thought. Not something I really want.

17:24 ...except that it seems to be required for Java Servlets, although I don't really want those either.

17:25 rhickey: I like servlets, I think it will be good for Clojure to do web apps that way

17:25 Chouser: oh

17:26 rhickey: they take care of the boilerplate, no?

17:26 lots of server choices

17:26 Chouser: there are lots of ways to take care of the boilerplate

17:27 I have very little experience with servlets, so you should put too much weight on my opinion.

17:27 requiring a .class file to load them seems a little awkward, even if it wasn't for the mismatch with Clojure.

17:28 rhickey: that's a one-time stub

17:28 Chouser: There are lots of server apps that do servlets, but there are lots of low-cost hosting services which do not.

17:28 rhickey: I think that will change now that Java is open source, not sure how long it will take

17:29 Chouser: Hm. Ok.

17:30 Well, it may be beside the point. If there's something that provides the interface between the Java Servlet environment and the Clojure environment (like webjure does), that interface can be documented and provided by other mechanisms.

17:31 rhickey: kind of, but you'd have to abstract the streams, the parameters, cookies, session state, authentication etc, all of which comes with servlet containers

Logging service provided by n01se.net