This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # beginners (33)
- # cljs-dev (9)
- # cljsjs (1)
- # cljsrn (5)
- # clojure (120)
- # clojure-brasil (1)
- # clojure-dev (3)
- # clojure-uk (2)
- # clojured (1)
- # clojurescript (9)
- # datomic (69)
- # defnpodcast (2)
- # dirac (8)
- # emacs (35)
- # events (4)
- # figwheel (7)
- # fulcro (29)
- # hoplon (6)
- # immutant (1)
- # keechma (4)
- # lumo (45)
- # nyc (1)
- # off-topic (16)
- # om (1)
- # onyx (9)
- # re-frame (11)
- # rum (15)
- # shadow-cljs (137)
- # spacemacs (1)
- # sql (6)
- # uncomplicate (1)
- # unrepl (5)
which docs do I need to follow? I guess Travis docs? @anmonteiro Maybe I need to ask your help on this.
say I am compiling something with
cljs.analyzer in it. Where can I get the analysis cache for it? Is there a place where to find it? I am also thinking whether it should be published on
lumo consumption (we don't have
cache support yet but it would be awesome to have)
@richiardiandrea If I understand your first question, usually
yep I can find that file in
target because I compile
lumo myself...but I think it should be published for consumption now that we can compile with it
Ahh, interesting: One problem with attempting to publish any compiled artifacts is that if the compiler version changes, the artifacts become invalid.
no well, any Cljs compiler files should work...only they have to be the same version
Well, all I'm saying is: If you publish a ClojureScript library for general use, attempting to include compiled artifacts leads to the possibility of a version mismatch. So, most ClojureScript libraries comprise only source code.
Even pointing the classpath to cache fails still has some spurious warning and failures...will need to dig more:
WARNING: Use of undeclared Var cljs.analyzer/no-warn at line 855 WARNING: Use of undeclared Var cljs.analyzer/no-warn at line 873 WARNING: Use of undeclared Var cljs.analyzer/no-warn at line 2495 WARNING: Use of undeclared Var cljs.analyzer/no-warn at line 2516 WARNING: Use of undeclared Var cljs.analyzer/no-warn at line 2536 Copying lumo/io.cljs to out/lumo/io.cljs Compiling out/lumo/io.cljs Copying cljs/spec/gen/alpha.cljs to out/cljs/spec/gen/alpha.cljs Compiling out/cljs/spec/gen/alpha.cljs Copying cljs/spec/alpha.cljs to out/cljs/spec/alpha.cljs Compiling out/cljs/spec/alpha.cljs failed compiling file:out/cljs/spec/alpha.cljs (new) Function.cljs.core.ex_info.cljs$core$IFn$_invoke$arity$3 (NO_SOURCE_FILE <embedded>:2058:72) (evalmachine.<anonymous>:644:25) Function.lumo.compiler.compile_file.cljs$core$IFn$_invoke$arity$3 (evalmachine.<anonymous>:655:4) (Object.lumo$closure$compile_file) (evalmachine.<anonymous>:1644:21) (Object.lumo$closure$_compile) (Object.lumo$closure$compile_from_jar) (evalmachine.<anonymous>:1679:21) (Object.lumo$closure$_compile) Cannot write Object.com.cognitect.transit.impl.writer.marshal (NO_SOURCE_FILE <embedded>:6021:288) Object.com.cognitect.transit.impl.writer.emitObjects (NO_SOURCE_FILE <embedded>:6008:181) Object.com.cognitect.transit.impl.writer.emitArray (NO_SOURCE_FILE <embedded>:6008:407) Object.com.cognitect.transit.impl.writer.marshal (NO_SOURCE_FILE <embedded>:6021:58) (NO_SOURCE_FILE <embedded>:6014:409) cljs.core.PersistentHashMap.forEach (NO_SOURCE_FILE <embedded>:1503:182) Object.com.cognitect.transit.impl.writer.emitMap (NO_SOURCE_FILE <embedded>:6014:286) Object.com.cognitect.transit.impl.writer.marshal (NO_SOURCE_FILE <embedded>:6021:129) Object.com.cognitect.transit.impl.writer.marshalTop (NO_SOURCE_FILE <embedded>:6023:120) com.cognitect.transit.impl.writer.Writer.write (NO_SOURCE_FILE <embedded>:6024:390)
@richiardiandrea Is this a new Lumo build failure that occurred simply by switching to 1.9.1104?
ClojureScript is self-hosting... but this raises the question: Can the self-hosted compiler then compile itself again (2nd stage). In general so far the answer has been "no".
In other words, ClojureScript isn't truly "bootstrapped" in the sense that it is still tied to the JVM for the first compile.
Oooo ok, so well then all the code that relies on compiler features cannot compile itself? For instance a lib that wants to use warning handler functions...
So, what I've done in Planck, (and I assume Lumo does the same), is that things like
cljs.analyzer namespace (`:require` it). But it is another matter altogether to try to point Planck or Lumo at
analyzer.cljc and try to have it compile that file.
I am specifically using this piece of code:
(defn exit-on-warning! [warning-type env extra] (when (warning-type ana/*cljs-warnings*) (when-let [s (ana/error-message warning-type extra)] (binding [*print-fn* *print-err-fn*] (println "lumo error:" (ana/message env s))) (lumo.core/exit 1))))
but it is requiring it as well and I guess that triggers something I cannot grasp now :smile:
$ lumo Lumo 1.7.0 ClojureScript 1.9.908 Node.js v8.4.0 Docs: (doc function-name-here) (find-doc "part-of-name-here") Source: (source function-name-here) Exit: Control+D or :cljs/quit or exit cljs.user=> (require '[cljs.analyzer :as ana]) nil cljs.user=> (require 'lumo.core) nil cljs.user=> (defn exit-on-warning! #_=> [warning-type env extra] #_=> (when (warning-type ana/*cljs-warnings*) #_=> (when-let [s (ana/error-message warning-type extra)] #_=> (binding [*print-fn* *print-err-fn*] #_=> (println "lumo error:" (ana/message env s))) #_=> (lumo.core/exit 1)))) #'cljs.user/exit-on-warning! cljs.user=>
I think it has something to do with what you where saying above about not being able to compile itself...and it is probably not using the cache, I will report back :slightly_smiling_face:
My first reaction would be to try to have the Lumo compilation mode load compiled artifacts from the Lumo binary if they happen to be things produced from source like
In other words, make the compilation mode work just like the REPL mode when it comes to loading stuff like that. But then again, I've never looked at that aspect of Lumo.
there is some difference though that waits to be discovered in there, bug or subtlety
Yeah. You definitely feel the difference in speed when working with Coal Mine. The Clojure compiler can load some of that corpus in seconds, while ClojureScript JVM is in minutes, and Planck gets closer to hours. :slightly_smiling_face:
Going back to the idea of a common place for projects like
closh ... I think that
cljs-oss can be a good place
@richiardiandrea If you end up digging into adding Lumo to Canary, I've distilled the steps into the README. If you see anything inaccurate, we can get it fixed. I'll invite you to the repo so you can push stuff into it.