#clojure log - May 29 2008

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

2:59 jteo: http://blogs.azulsystems.com/cliff/2008/05/clojure-stms-vs.html

13:18 drewr: Rich's concurrency talk, except with Erlang and an English accent: http://www.infoq.com/presentations/erlang-software-for-a-concurrent-world

13:19 abrooks: Heh. :)

14:07 rhickey: I've seen Joe Armstrong speak and he is quite interesting and provocative

14:08 drewr: This talk is no exception.

14:33 rhickey: Do you envision Erlang-like message-passing primitives in Clojure?

15:06 rhickey: only for the distributed case

15:07 and even then I'd like the consuming side to be more event-driven vs. the blocking switch statement style of Erlang

15:07 but nothing specific has been done yet

15:26 Chouse1: Why am I so intrigued by the idea of porting Clojure to run on top of JavaScript?

15:26 rhickey: Definitely desired by me - see Parenscript for inspiration

15:26 Chouse1: yeah, I've poked at Parenscript before.

15:27 rhickey: Note a very early version of Clojure targeted Javascript and JScript

15:27 Chouse1: oh! I didn't know that.

15:27 To call the new language "Clojure" I'd have to port some semblance of the persistent collections.

15:29 rhickey: since the data is usually small in that context, you can just do copy-on-write to start

15:29 Chouse1: Hm. I brought this up so that everyone could laugh at me, and I could go back to doing something else.

15:29 rhickey: ClojureScript?

15:30 ozzilee: Oh good lord no :-)

15:30 (the name, not the idea)

15:31 Chouse1: ozzilee: see, that's a much better reaction. If rhickey keeps this up, I might actually expend effort on this.

15:31 ozzilee: bah. still not helping.

15:31 rhickey: it's a matter of when, not if :)

15:32 Chouse1: It would be such a kick to run boot.clj in a browser.

15:32 rhickey: you'd probably want to precompile boot.clj...

15:32 ozzilee: Heh. I think it's a fine idea. A great one, actually. Actually, I'd be happy with just a syntax wrapper so javascript that can be written in clojure's s-expressions.

15:33 rhickey: and macros!

15:35 ozzilee: (javascript ((function [foo] (alert foo)) "Hello, world!"))

15:35 Chouse1: and concurrent agents of persistent hash-maps scaling into the thousands!

15:35 ozzilee: function(foo) { alert foo; }("Hello, world!")

15:36 Chouse1: ... in your web browser! Hmm...

15:37 Heh or on Rhino... that'd be a trip.

15:37 Chouse1: ozzilee: if you don't need too much of what makes clojure different from other lisps, you really might look into parenscript. It gets a lot Right.

15:37 ozzilee: Chouse1: Yeah, I might. But clojure's got literal syntax for hash-maps, which is killer.

15:38 I've looked at parenscript, just not that deeply.

15:38 Chouse1: It might not be too hard to add that to parenscript. I haven't looked at the implementation.

15:38 but then you'd want destructuring...

15:38 ozzilee: Perhaps. I don't use common lisp for anything else, so it loses some of it's value there, I reckon.

15:40 Chouse1: I have to resist the urge to start on ClojureScript (what's wrong with that name?) -- I've got to get enclojure working the way I want first.

15:41 Bah. Seriously guys, you were supposed to talk be *out* of this, not *into* it.

15:41 "talk me"

15:41 rhickey: ClojureScript rocks!

15:41 as a concept

15:42 ozzilee: Chouse1: What's wrong with ClojureScript? Only that Javascript is probably the worst name ever given to a programming language...

15:43 Oh hell it's not that bad I guess :-)

15:44 dudleyf: It _is_ that bad

15:44 Chouse1: javascript is a bad name because the language has nothing to do with java. That doesn't mean ClojureScript would be a bad name.

15:44 dudleyf: Not that I have a better suggestion, mind you ;-)

15:47 ozzilee: Yeah, clojurescript works. Just triggered my gag reflex I guess :-)

15:53 dudleyf: ozzilee: I think you're right. I have a knee-jerk reaction to the word "script" that's like chewing on tinfoil.

17:17 Chouse1: LispReader is over 800 lines of Java that would be just the beginning of what would have to be ported to JavaScript and then *maintained*, keeping up with the rather rapid rate that rhickey puts fixes and features into the main codebase.

17:18 I wonder if there's a java-to-javascript converter tool out there...

17:19 rhickey: No, the idea behind Parenscript, and similarly ClojureScript, is that it runs on the Lisp/Clojure side and spews JavaScript, it is not a Clojure interpreter written in JavaScript. So, uses the Clojure reader and macroexpander etc. All you need on JavaScript side is runtime support

17:20 Chouse1: hm. so no client-side repl.

17:20 rhickey: right

17:21 Chouse1: That means I'm mis-remembering parenscript.

17:22 rhickey: they could have done that

17:25 abrooks: Chouse1: Were you being sarcastic or is GWT not what you mean by java-to-javascript converter tool?

17:27 Chouse1: abrooks: I guess I had forgotten about GWT.

17:28 abrooks: I've not looked at how standalone it is but it's there: http://code.google.com/webtoolkit/overview.html

17:28 "The GWT Java-to-JavaScript compiler translates the Java programming language to the JavaScript programming language."

17:56 cgrand1: funny: I spent the day working on adding js support to my templating lib and what I got nearly support ozzilee's example :

17:56 user=>(macroexpand-1 '(js* ((fn [foo] (alert foo)) "hello world!")))

17:56 (template/write-unesc "(function(foo){return alert(foo)})('hello world!');")

17:57 Chouse1: cgrand1: interesting!

18:18 ozzilee: cgrand1: That's awesome :-)

22:45 blackdog: i'm trying to write my first macro, does this make sense? (defmacro onClick [obj & body]

22:45 `(. ~obj addActionListener

22:45 (proxy [ActionListener] []

22:45 (actionPerformed [evt#]

22:45 ~@body))))

22:46 i'm getting java.lang.UnsupportedOperationException: actionPerformed

22:49 Chouser: does (macroexpand '(onClick ...)) produce what you expect?

22:51 blackdog: ah

22:51 didn't know i could do that :)

22:51 tht will help a lot

22:51 Chouser: :-)

22:51 blackdog: cheers, i can probably debug from there

22:52 Chouser: sometimes if macroexpand produces too much, macroexpand-1 might be helpful.

22:52 blackdog: ok

Logging service provided by n01se.net