#clojure logs

2008-05-29

02:59jteohttp://blogs.azulsystems.com/cliff/2008/05/clojure-stms-vs.html
13:18drewrRich's concurrency talk, except with Erlang and an English accent: http://www.infoq.com/presentations/erlang-software-for-a-concurrent-world
13:19abrooksHeh. :)
14:07rhickeyI've seen Joe Armstrong speak and he is quite interesting and provocative
14:08drewrThis talk is no exception.
14:33drewrrhickey: Do you envision Erlang-like message-passing primitives in Clojure?
15:06rhickeyonly for the distributed case
15:07rhickeyand even then I'd like the consuming side to be more event-driven vs. the blocking switch statement style of Erlang
15:07rhickeybut nothing specific has been done yet
15:26Chouse1Why am I so intrigued by the idea of porting Clojure to run on top of JavaScript?
15:26rhickeyDefinitely desired by me - see Parenscript for inspiration
15:26Chouse1yeah, I've poked at Parenscript before.
15:27rhickeyNote a very early version of Clojure targeted Javascript and JScript
15:27Chouse1oh! I didn't know that.
15:27Chouse1To call the new language "Clojure" I'd have to port some semblance of the persistent collections.
15:29rhickeysince the data is usually small in that context, you can just do copy-on-write to start
15:29Chouse1Hm. I brought this up so that everyone could laugh at me, and I could go back to doing something else.
15:29rhickeyClojureScript?
15:30ozzileeOh good lord no :-)
15:30ozzilee(the name, not the idea)
15:31Chouse1ozzilee: see, that's a much better reaction. If rhickey keeps this up, I might actually expend effort on this.
15:31Chouse1ozzilee: bah. still not helping.
15:31rhickeyit's a matter of when, not if :)
15:32Chouse1It would be such a kick to run boot.clj in a browser.
15:32rhickeyyou'd probably want to precompile boot.clj...
15:32ozzileeHeh. 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:33rhickeyand macros!
15:35ozzilee(javascript ((function [foo] (alert foo)) "Hello, world!"))
15:35Chouse1and concurrent agents of persistent hash-maps scaling into the thousands!
15:35ozzileefunction(foo) { alert foo; }("Hello, world!")
15:36ozzileeChouse1: ... in your web browser! Hmm...
15:37ozzileeHeh or on Rhino... that'd be a trip.
15:37Chouse1ozzilee: 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:37ozzileeChouse1: Yeah, I might. But clojure's got literal syntax for hash-maps, which is killer.
15:38ozzileeI've looked at parenscript, just not that deeply.
15:38Chouse1It might not be too hard to add that to parenscript. I haven't looked at the implementation.
15:38Chouse1but then you'd want destructuring...
15:38ozzileePerhaps. I don't use common lisp for anything else, so it loses some of it's value there, I reckon.
15:40Chouse1I 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:41Chouse1Bah. Seriously guys, you were supposed to talk be *out* of this, not *into* it.
15:41Chouse1"talk me"
15:41rhickeyClojureScript rocks!
15:41rhickeyas a concept
15:42ozzileeChouse1: What's wrong with ClojureScript? Only that Javascript is probably the worst name ever given to a programming language...
15:43ozzileeOh hell it's not that bad I guess :-)
15:44dudleyfIt _is_ that bad
15:44Chouse1javascript is a bad name because the language has nothing to do with java. That doesn't mean ClojureScript would be a bad name.
15:44dudleyfNot that I have a better suggestion, mind you ;-)
15:47ozzileeYeah, clojurescript works. Just triggered my gag reflex I guess :-)
15:53dudleyfozzilee: I think you're right. I have a knee-jerk reaction to the word "script" that's like chewing on tinfoil.
17:17Chouse1LispReader 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:18Chouse1I wonder if there's a java-to-javascript converter tool out there...
17:19rhickeyNo, 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:20Chouse1hm. so no client-side repl.
17:20rhickeyright
17:21Chouse1That means I'm mis-remembering parenscript.
17:22rhickeythey could have done that
17:25abrooksChouse1: Were you being sarcastic or is GWT not what you mean by java-to-javascript converter tool?
17:27Chouse1abrooks: I guess I had forgotten about GWT.
17:28abrooksI've not looked at how standalone it is but it's there: http://code.google.com/webtoolkit/overview.html
17:28abrooks"The GWT Java-to-JavaScript compiler translates the Java programming language to the JavaScript programming language."
17:56cgrand1funny: I spent the day working on adding js support to my templating lib and what I got nearly support ozzilee's example :
17:56cgrand1user=>(macroexpand-1 '(js* ((fn [foo] (alert foo)) "hello world!")))
17:56cgrand1(template/write-unesc "(function(foo){return alert(foo)})('hello world!');")
17:57Chouse1cgrand1: interesting!
18:18ozzileecgrand1: That's awesome :-)
22:45blackdogi'm trying to write my first macro, does this make sense? (defmacro onClick [obj & body]
22:45blackdog `(. ~obj addActionListener
22:45blackdog (proxy [ActionListener] []
22:45blackdog (actionPerformed [evt#]
22:45blackdog ~@body))))
22:46blackdogi'm getting java.lang.UnsupportedOperationException: actionPerformed
22:49Chouserdoes (macroexpand '(onClick ...)) produce what you expect?
22:51blackdogah
22:51blackdogdidn't know i could do that :)
22:51blackdogtht will help a lot
22:51Chouser:-)
22:51blackdogcheers, i can probably debug from there
22:52Chousersometimes if macroexpand produces too much, macroexpand-1 might be helpful.
22:52blackdogok