Re: Clojurejs: a lightweight clojure to javascript compiler

319 views
Skip to first unread message

Jim foo.bar

unread,
Oct 8, 2012, 9:10:47 AM10/8/12
to clo...@googlegroups.com
On 08/10/12 07:18, Hoàng Minh Thắng wrote:
> Clojurejs started by [kriyative](https://github.com/kriyative) is an
> amazing project that compile clojure to javascript.

Now I'm confused! Isn't clojureScript exactly that?

Jim

Timothy Baldridge

unread,
Oct 8, 2012, 9:43:04 AM10/8/12
to clo...@googlegroups.com

Clojurejs started by [kriyative](https://github.com/kriyative) is an amazing project that compile clojure to javascript.


This can hardly be called Clojure. The syntax may be similar, but the semantics are all wrong.

From boot.cljs

(defn map [fun arr]
  (loop [r []
         i 0]
    (if (< i (count arr))
      (do
        (.push r (fun (get arr i)))
        (recur r (+ i 1)))
      r)))

Map is no longer lazy?

Timothy

Mark Rathwell

unread,
Oct 8, 2012, 9:47:42 AM10/8/12
to clo...@googlegroups.com
> Now I'm confused! Isn't clojureScript exactly that?

ClojureScript is a Clojure implementation that targets Javascript
(meaning that Clojure core, et al, is also necessarily converted to
Javascript in the build process and a part of what you ship). I'm
assuming this project is a straight translator from Clojure source to
the equivalent Javascript, which would mean smaller output but not a
robust implementation of Clojure.
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

Jim foo.bar

unread,
Oct 8, 2012, 10:09:36 AM10/8/12
to clo...@googlegroups.com
On 08/10/12 14:47, Mark Rathwell wrote:
> ClojureScript is a Clojure implementation that targets Javascript
> (meaning that Clojure core, et al, is also necessarily converted to
> Javascript in the build process and a part of what you ship). I'm
> assuming this project is a straight translator from Clojure source to
> the equivalent Javascript, which would mean smaller output but not a
> robust implementation of Clojure.

aaa ok that clears things up a bit.. thanks! :-)

Jim

Hoàng Minh Thắng

unread,
Oct 9, 2012, 11:30:39 PM10/9/12
to clo...@googlegroups.com
You are right, Mark. And because the compiler is run in Clojure, we have the power of macros along with the beautiful and concise syntax.
Reply all
Reply to author
Forward
0 new messages