cljs-dev

ClojureScript compiler & std lib dev, https://clojurescript.org/community/dev
dominicm 2020-09-15T15:57:20.104800Z

https://clojurians.slack.com/archives/C06E3HYPR/p1600154539042500 Would it make sense for ClojureScript to use the :cljs branch for reading data_readers.cljc? Or would it use the :clj branch? I can see an argument for both.

borkdude 2020-09-15T16:00:29.106Z

I guess it's always read-time which is before macro time, so probably only :clj unless self-hosted

dominicm 2020-09-15T16:01:29.106400Z

In this case, the cljs compiler gets to choose.

dominicm 2020-09-15T16:01:35.106600Z

As it manually calls read.

plexus 2020-09-15T16:19:53.108800Z

Would it work to use the cljs branch? The referenced functions may not exist on the Clojure side

dominicm 2020-09-15T16:39:39.109700Z

Well, I suppose the real intention of setting :cljs would be that you could mark the intended audience of the reader cond, rather than how to read the symbol it references.

dominicm 2020-09-15T16:40:11.110400Z

That is, I'd still expect the symbol referenced to be read in Clojure (as that's where the compiler lives), I'm just saying that it's the data reader for clojurescript to use.

lilactown 2020-09-15T16:42:49.112200Z

I think there’s an argument about consistency there. Everywhere else the compiler will take the :clj route when reading & executing JVM clojure code. for :cljs I would expect that code to be executed in a JS runtime.

dominicm 2020-09-15T16:44:19.113300Z

Yeah, that's the other argument. But I also think that's a special file, and being able to distinguish the target reader is massively valuable in this situation.

dominicm 2020-09-15T16:44:52.113900Z

I previously asked about how to write data readers which work in clj & cljs, and it's not currently possible as clj uses objects and cljs uses code forms.

dominicm 2020-09-15T16:45:01.114100Z

This would alleviate that problem.