On Sunday, May 18, 2014 10:54:43 PM UTC-4, Herwig Hochleitner wrote:
> I realized that cljs-in-cljs actually is already self-hosting after looking
> at it again. An impressive feat!
>
> Still, I would imagine that maintaining it out of tree must be pretty time
> consuming, given the pace of cljs development.
Yeah, it is. It's why I'm considering ways to do this that can be easily
picked up and maintained by the community as part of ClojureScript rather than
a fork. I hadn't realized just how much progress there was in Clojure-land --
clojure.tools.reader makes things much easier.
> How about this?
>
>
> - Update clojurescript to use clojure.tools.reader
> - Add a cljs port to clojure.tools.reader, based on existing work
I was taking a look at clojure.tools.reader. This is a much cleaner
implementation of a platform-agnostic reader -- a huge plus is that it doesn't
use any Java libraries. It seems like an approach might be:
* First pass, get it working in ClojureScript.
* Separate out any platform dependencies that might crop up in
clojure.tools.reader into clj and cljs files. Hopefully this will be minimal,
or code can be altered to work well on both -- I understand now why we don't
want to use clix here.
* Alter CLJS to use clojure.tools.reader rather than reader.clj.
* Profit!
> Even if you decide to move forward with cljx, those two are independent,
> easily done and likely to be accepted + the best cljx code are dependencies
> ;-)
I agree -- good plan, and I'll tackle this.
>> However, would the community accept such a cljx-ified beast into the MASTER
>> branch? I would not want this work to end up on a shelf, to bit rot.
>
>
> IMO as a community member
>
> + It would mirror current clojurescript's usage of gclosure as a
> post-processor
> - clojurescript's build process is complex as it is, adding a pre-processor
> won't help that
> - cljx isn't contrib (k.o. in and of itself, would have to be side-stepped by
> creating a contrib or adding cljx to clojurescript)
I didn't realize cljx wasn't contrib, or what the implications of that are.
The light becomes illuminated over my head.
>> My primary interest is having a more up to date self-hosting implementation.
> I think the recent tools.{analyzer,emitter} push brought clojure pretty close
> to self-hosting.
> So for such a plan, I would try to take advantage of those and maybe even add
> clojurescript ports (I suspect that they wouldn't differ much, except macro
> usage).
tools.emitter is absolutely the correct way to do things -- it would be pretty
cool if we had ClojureScript compile to the JVM, and this path makes it
possible.
>> That's a really good question -- for me, self-hosted means being able to
>> compile and build from within the environment itself. With Mr. Dunlop and
>> my work on Mosquito Lisp, we achieved this -- but the low level bits are not
>> written in Mosquito Lisp, so there's some similarity there. I know that
>> Clojure and ClojureScript rely on the rich environment of Java and
>> JavaScript/Closure so they are by no means low level environments.
>
> The fun thing is, as soon as you have clojure.tools.{analyzer,emitter} in
> clojurescript, you can ignore the whole settlement process about compilation
> models completely and just fire up a customized repl at any time.
>
> The bottom line to me is: a cljx dependency is unlikely to be committed to
> any core project, but there are multiple precedents for supporting both clj
> and cljs versions in the same contrib. cljs-in-cljs is also built in this
> style, currently.
cljs-in-cljs is also built in this style, but if the language converges, then
hopefully this means that there will be less cljs and cli specific files.
Is there a system by which a clj file can be compiled by cljs? My
understanding is that clj files are executed by the Clojure compiler, but that
may be a reflection of usually using macros. Would I need to do something
ghetto like symlink .clj files to .cljs?
> kind regards
Thank you for your feedback -- it was extremely helpful. I should send in the
contributor agreement, I suppose. :)
-Wes
--
Note that posts from new members are moderated - please be patient with your
first post.
---
You received this message because you are subscribed to the Google Groups
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.