News for hackers. Stuff that matters.
Re:ClojureScript gets a REPL that drives the browser by johnfn on Thursday July 28, 2011 @04:31PM (#2818786)
I had been wondering about what advantage ClojureScript gave, since the biggest appeal of lisp to me is generally the ability to send functions straight to the REPL and see updates without restarting the program. Last night, I went on IRC to ask about this, and lbdknox responded that he was working on it as I asked. As he explained a little more, I realized that it wasn't an intractable problem - in fact, I was capable of solving it.

I think the lesson here is that you shouldn't just wait for answers to your problems - you should create them.

Re:ClojureScript gets a REPL that drives the browser by devin on Thursday July 28, 2011 @07:55PM (#2819543)
Stolen from Alan Kay: "Don't worry about what anybody else is going to do. The best way to predict the future is to invent it." --Alan Kay

Stolen from "Joy of Clojure": CLOJURE APHORISM Clojure programmers don’t write their apps in Clojure. They write the language that they use to write their apps in Clojure. --M. Fogus && C. Houser

Re:ClojureScript gets a REPL that drives the browser by nkassis on Thursday July 28, 2011 @03:42PM (#2818568)
I've been wondering why they didn't create an actual compiler in javascript? I understand it's more trouble.
Re:ClojureScript gets a REPL that drives the browser by JoelMcCracken on Thursday July 28, 2011 @07:22PM (#2819418)
I imagine that they would have, but for the following:

I'm sure that clojure compiles clojure, at this point, at least for the majority.

So, once you've written something that compiles clojure to js, then you just need to compile that compiler to js.

Why haven't they done this? My guess is that "something" in the clojure compiler relies on the jvm, or links to some java code to do its work.

Another possible reason that clojurescript doesn't yet compile all valid clojure.

In any case, I'm sure that this is an eventual goal. Hickey has stated that he always wanted clojure to target multiple platforms, but decided to start on java first.

Re:ClojureScript gets a REPL that drives the browser by ithayer on Thursday July 28, 2011 @03:54PM (#2818619)
Any good examples of some JS that's cool to run?
Re:ClojureScript gets a REPL that drives the browser by ibdknox on Thursday July 28, 2011 @04:06PM (#2818673)
Not "cool" per se, but here's something that works :)

    (require '[goog.dom :as dom])
    (def body (aget (dom/getElementsByTagNameAndClass "body") 0))
    (defn elem-factory [tag text] 
        (let [elem (dom/createElement tag)] 
            (dom/setTextContent elem text) 
            elem))
    (dom/appendChild body (elem-factory "p" "my new tag"))
Re:ClojureScript gets a REPL that drives the browser by vishgm on Friday July 29, 2011 @03:27AM (#2820585)
Will ClojureScript take care of cross-browser issues?
Re:ClojureScript gets a REPL that drives the browser by nickik on Friday July 29, 2011 @08:10AM (#2821336)
ClojureScript just compiles to JavaScript it does not care for cross-browser issues --> it does not add a browser independed standard library but ClojureScript works closly together with the Google Closure library (witch is used for a lot google products) and this library includes browser independend librarys.
Re:ClojureScript gets a REPL that drives the browser by vishgm on Saturday July 30, 2011 @08:24AM (#2825607)
ok. thanks