I've been working on a platform-agnostic version of this over here:
https://github.com/halgari/universal-clojure/blob/master/src/universal_clojure/core.clj

But I'd rather collaborate with ClojureScript. Are there any ongoing
efforts to make this cross platform? The current analyzer contains
quite a few java calls. For instance, .contains, and .indexOf. Is
Raphael working on this, or can I take up that torch and implement
these in pure Clojure?

After that, I'd like to rip apart core.cljs and make it also platform
agnostic. My idea is to standardize the native calls under a pseudo
namespace called "native". For instance:

(defn alength [array]
      (native/alength array))

(defn aget [array idx default]
      (if (and (>= idx 0) (< idx (alength array))
          (native/aget array idx))
          default))

All a new platform needs to do is have their compiler interpret
native/alength as the platform specific call (.Length in CLR, len() in
Python, etc.), and the above code is suddenly 100% cross platform.
>From there, porting to a new platform is no longer "translate
core.cljs", but instead, "implement these 20 functions from native/".

I'm really wanting to collaborate on this, since I plan on basing
future versions of Clojure-Py completely off this code base. Any
suggestions on how to go about this? I don't want to re-write anyone
else's code, but I'm also kind of tired of waiting around for someone
to hand me this on a silver platter :-).

Timothy Baldridge



On Fri, Jun 15, 2012 at 11:25 AM, David Nolen <dnolen.li...@gmail.com> wrote:
> Thanks to Raphael Amiard's hard work the ClojureScript analyzer is now
> decoupled:
>
> http://github.com/clojure/clojurescript/commit/9ad79e1c9b87c862ccb7ad6aad37d90414123c76
>
> This is a big step towards making the ClojureScript compiler infrastructure
> pluggable. There's a couple of JS things to clean up in the backend and
> we're looking to remove any JS specific stuff from cljs.core so that
> alternate backends can compile the standard library with no fiddling.
>
> Fun times ahead!
>
> David
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en



-- 
“One of the main causes of the fall of the Roman Empire was
that–lacking zero–they had no way to indicate successful termination
of their C programs.”
(Robert Firth)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to