ANN: ClojureScript 0.0-3058, Enhanced REPLs, faster compile times

909 görüntüleme
İlk okunmamış mesaja atla

David Nolen

okunmadı,
9 Mar 2015 19:41:459.03.2015
alıcı clojure, clojur...@googlegroups.com
ClojureScript, the Clojure compiler that emits JavaScript source code.


New release version: 0.0-3058

Leiningen dependency information:

    [org.clojure/clojurescript "0.0-3058"]

This is a significant enhancement release around REPLs and compile times.

All builtin REPLs (Nashorn, Node.js, Rhino and the browser REPL) now
support the helper functions normally available via clojure.repl,
these include: doc, find-doc, apropos, dir, source, and pst.  All of the
builtins REPL now also support source mapped stacktraces.

This release also includes many enhancements around compile times.

ClojureScript now ships with a default :optimizations setting of
:none. Implicit now when using :none is source map generation and analysis
caching. Analysis caching significantly speeds up compile times.

The standard library (cljs.core) is now AOTed compiled to JavaScript
along with an AOTed analysis dump and an AOTed source map. This
dramatically cuts down on cold start compile times. The standard
library is never actually ever analyzed or compiled in your own
builds. The result is particularly dramatic for REPLs.

ClojureScript is also now available for the first time as a standalone
AOTed JAR. The Quick Start introduction has been rewritten in terms of
the standalone JAR:

The new Quick Start is essential reading even if you are a relatively
experienced ClojureScript developer.

As usual feedback welcome!

## 0.0-3058

### Enhancements
* browser REPL source mapping for Firefox, Safari, Chrome
* macro support in REPL special functions
* CLJS-897: AOT core.cljs CLJS-899: AOT cache core.cljs analysis
* CLJS-1078: Nashorn REPL should use persistent code cache
* CLJS-1079: add way to execute arbitrary fn upon watch build completion
* CLJS-1034: Support REPL-defined functions in stacktrace infrastructure
* source mapping for Rhino
* CLJS-1071: support symbol keys in :closure-defines
* CLJS-1014: Support Closure Defines under :none
* CLJS-1068: node target define
* CLJS-1069: Generic :jsdoc support
* CLJS-1030: add `cljs.repl/pst`
* add `cljs.repl/apropos`, `cljs.repl/find-doc`, `cljs.repl/dir`
* fix `cljs.analyzer.api/all-ns` docstring
* add `cljs.analyzer.api/ns-publics`
* CLJS-1055: cljs.repl/doc should support namespaces and special forms
* Add ClojureScript special form doc map
* CLJS-1054: add clojure.repl/source functionality to cljs.repl
* CLJS-1053: REPLs need import special fn

### Changes
* move :init up in cljs.repl/repl
* CLJS-1087: with-out-str unexpectedly affected by *print-newline*
* CLJS-1093: Better compiler defaults
* Bump deps latest Closure Compiler, Rhino 1.7R5, data.json 0.2.6, tool.reader 0.8.16
* more sensible error if cljs.repl/repl arguments after the first incorrectly supplied
* default REPLs to :cache-analysis true
* default :output-dir for Nashorn and Node REPLs
* change ES6 Map `get` support to take additional `not-found` parameter
* deprecate clojure.reflect namespace now that REPLs are significantly enhanced, static vars, etc.

### Fixes
* stop blowing away cljs.user in browser REPL so REPL fns/macros remain available
* CLJS-1098: Browser REPL needs to support :reload and :reload-all
* CLJS-1097: source map url for AOTed cljs.core is wrong
* CLJS-1094: read option not used by cljs.repl/repl*
* CLJS-1089: AOT analysis cache has bad :file paths
* CLJS-1057: Nashorn REPL should not use EDN rep for errors
* CLJS-1086: Keyword constants should have stable names
* CLJS-964: Redefining exists? does not emit a warning like redefining array? does.
* CLJS-937: local fn name should be lexically munged
* CLJS-1082: analysis memoization bug
* CLJS-978: Analysis caching doesn't account for constants table
* CLJS-865: remove `cljs.js-deps/goog-resource` hack
* CLJS-1077: analyze-deps infinite recursive loop
* manually set *e in Rhino on JS exception
* REPL options merging needs to be more disciplined
* CLJS-1072: Calling .hasOwnProperty("source") in Clojurescript's string/replace will break with ES6
* CLJS-1064: ex-info is not printable
* Fix REPLs emitting code into .repl directory
* CLJS-1066: Rhino REPL regression
* be more disciplined about ints in murmur3 code
* Node.js REPL should work even if :output-dir not supplied
* Nashorn environment doesn't supply console, setup printing correctly

Ivan L

okunmadı,
9 Mar 2015 19:53:349.03.2015
alıcı clojur...@googlegroups.com
blown away by the new ease of use. spectacular.

Aleš Roubíček

okunmadı,
10 Mar 2015 01:39:4510.03.2015
alıcı clojur...@googlegroups.com, clo...@googlegroups.com
Just wow! Thank you.

Robin Heggelund Hansen

okunmadı,
10 Mar 2015 05:20:4610.03.2015
alıcı clo...@googlegroups.com, clojur...@googlegroups.com
It says analysis caching is enabled when optimizations is :none. Do we have to enable to explicitly on other optimization levels?

Max Gonzih

okunmadı,
10 Mar 2015 06:07:4510.03.2015
alıcı clojur...@googlegroups.com, clo...@googlegroups.com
Amazing update! Yay.

But I just spotted one weird thing, after I pumped compiler version compilation fails for me with following error:

clojure.lang.ExceptionInfo: failed compiling file:public/javascripts/out-server-side/cljs/core.cljs {:file #<File public/javascripts/out-server-side/cljs/core.cljs>}
at clojure.core$ex_info.invoke(core.clj:4403)
at cljs.compiler$compile_file$fn__2959.invoke(compiler.clj:1130)
at cljs.compiler$compile_file.invoke(compiler.clj:1101)
at cljs.closure$compile_file.invoke(closure.clj:347)
at cljs.closure$eval3294$fn__3295.invoke(closure.clj:398)
at cljs.closure$eval3230$fn__3231$G__3221__3238.invoke(closure.clj:305)
at cljs.closure$compile_from_jar.invoke(closure.clj:390)
at cljs.closure$eval3289$fn__3290.invoke(closure.clj:404)
at cljs.closure$eval3230$fn__3231$G__3221__3238.invoke(closure.clj:305)
at cljs.closure$get_compiled_cljs.invoke(closure.clj:467)
at cljs.closure$cljs_dependencies.invoke(closure.clj:511)
at cljs.closure$add_dependencies.doInvoke(closure.clj:533)
at clojure.lang.RestFn.applyTo(RestFn.java:139)
at clojure.core$apply.invoke(core.clj:626)
at cljs.closure$build.invoke(closure.clj:1408)
at cljs.closure$build.invoke(closure.clj:1351)
at cljsbuild.compiler$compile_cljs$fn__3665.invoke(compiler.clj:81)
at cljsbuild.compiler$compile_cljs.invoke(compiler.clj:80)
at cljsbuild.compiler$run_compiler.invoke(compiler.clj:180)
at user$eval3797$iter__3833__3837$fn__3838$fn__3856.invoke(form-init1562646833731967415.clj:1)
at user$eval3797$iter__3833__3837$fn__3838.invoke(form-init1562646833731967415.clj:1)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.RT.seq(RT.java:484)
at clojure.core$seq.invoke(core.clj:133)
at clojure.core$dorun.invoke(core.clj:2855)
at clojure.core$doall.invoke(core.clj:2871)
at user$eval3797.invoke(form-init1562646833731967415.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6703)
at clojure.lang.Compiler.eval(Compiler.java:6693)
at clojure.lang.Compiler.load(Compiler.java:7130)
at clojure.lang.Compiler.loadFile(Compiler.java:7086)
at clojure.main$load_script.invoke(main.clj:274)
at clojure.main$init_opt.invoke(main.clj:279)
at clojure.main$initialize.invoke(main.clj:307)
at clojure.main$null_opt.invoke(main.clj:342)
at clojure.main$main.doInvoke(main.clj:420)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:383)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Caused by: java.lang.ClassCastException: java.net.URL cannot be cast to java.io.File
at cljs.util$mkdirs.invoke(util.clj:80)
at cljs.analyzer$write_analysis_cache.invoke(analyzer.clj:2021)
at cljs.compiler$compile_file_STAR_$fn__2927.invoke(compiler.clj:1055)
at cljs.compiler$with_core_cljs.invoke(compiler.clj:961)
at cljs.compiler$compile_file_STAR_.invoke(compiler.clj:981)
at cljs.compiler$compile_file$fn__2959.invoke(compiler.clj:1118)
... 40 more
Subprocess failed

Is this related to AOT compiler cljs.core ns?

On Tuesday, March 10, 2015 at 12:41:45 AM UTC+1, David Nolen wrote:

Max Gonzih

okunmadı,
10 Mar 2015 06:13:5010.03.2015
alıcı clojur...@googlegroups.com
so much typos

s/pumped/bumped/
s/compiler/compiled/

sorry about that

David Nolen

okunmadı,
10 Mar 2015 06:55:4910.03.2015
alıcı clojur...@googlegroups.com, clojure
Looks like you're trying to use :cache-analysis with a higher :optimizations setting than :none. I would avoid this for now.


--
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 clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Chris McDevitt

okunmadı,
10 Mar 2015 09:17:5410.03.2015
alıcı clojur...@googlegroups.com, clo...@googlegroups.com
On Tuesday, 10 March 2015 10:55:49 UTC, David Nolen wrote:
> Looks like you're trying to use :cache-analysis with a higher :optimizations setting than :none. I would avoid this for now.

That fixed the same problem for me. Thanks.

Also my cold compile time went down from 40s to 25s!

Thanks,

Chris

David Nolen

okunmadı,
10 Mar 2015 09:44:3910.03.2015
alıcı clojur...@googlegroups.com, clojure
Hopefully we can get that down 1s for anything except production builds. Next on the list of todos is a shared AOT cache for all projects builds. Once you've compiled a dependency from a JAR we should never compile it ever again.

Max Gonzih

okunmadı,
10 Mar 2015 12:52:3410.03.2015
alıcı clojur...@googlegroups.com, clo...@googlegroups.com
Thanks David, it solved my problem!

Austin Haas

okunmadı,
11 Mar 2015 01:14:5611.03.2015
alıcı clojur...@googlegroups.com, clo...@googlegroups.com
This is great, David!

Is it difficult to include dependencies (e.g., core.async) for a project built this way?

David Nolen

okunmadı,
11 Mar 2015 02:29:3111.03.2015
alıcı clojure, clojur...@googlegroups.com
It's no more or less difficult than using Clojure by itself. You can use whatever tool you want to manage dependencies.

That said I would probably use Maven or Lein myself. Using Maven directly with AOTed dependencies will likely result in a fast workflow. AOTed tools.reader and data.json JARs are already available this way via "aot" classifier, though still working on ClojureScript.

David

On Wed, Mar 11, 2015 at 12:41 AM, Austin Haas <aus...@pettomato.com> wrote:
This is great, David!

Is it difficult to include dependencies (e.g., core.async) for a project built this way?
--
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
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter West

okunmadı,
11 Mar 2015 09:38:4011.03.2015
alıcı clojur...@googlegroups.com, clo...@googlegroups.com
On Tuesday, 10 March 2015 09:41:45 UTC+10, David Nolen wrote:
> ClojureScript, the Clojure compiler that emits JavaScript source code.
>
> New release version: 0.0-3058
>
> The new Quick Start is essential reading even if you are a relatively
> experienced ClojureScript developer.


I did this, and worked through the example. When I got to

Require your namespace by evaluating (require '[hello-world.core :as hello])

the REPL hung. Any suggestions?

Peter West

okunmadı,
11 Mar 2015 09:41:1011.03.2015
alıcı clojur...@googlegroups.com, clo...@googlegroups.com
OS X 10.10.2 java version "1.8.0_31" tried with both Safari and Opera browsers.

Mike Fikes

okunmadı,
11 Mar 2015 09:42:3611.03.2015
alıcı clojur...@googlegroups.com
If you are on Linux or a Mac, do a `kill -3` on the Java process to cause it to produce thread dumps with stack traces. That way we can see where it is hung.

- Mike
> --
> 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 clojurescrip...@googlegroups.com.

David Nolen

okunmadı,
11 Mar 2015 09:55:0411.03.2015
alıcı clojur...@googlegroups.com, clojure
A couple of people mentioned this happened while trying out the Quick Start. If eval takes a long time it could be because you don't have the right browser tab focused. If the REPL is truly hung due to some kind of communication issue, try refreshing the browser. The bREPL uses an iframe which can be a little finicky particularly in Safari in my experience.

HTH,
David


--

Christopher Graham

okunmadı,
11 Mar 2015 15:20:1011.03.2015
alıcı clo...@googlegroups.com, clojur...@googlegroups.com
It seems that (doc ...) and (source ...) do not print any text after (require '[hello-world.core :as hello] :reload) has been entered at the (browser) REPL.
Tümünü yanıtla
Yazarı yanıtla
Yönlendir
0 yeni ileti