You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.1 Workaround Java Performance Regression When Loading user.clj
Recent builds of Java 8 (u202), 11 (11.0.2), 12, and 13 included
some changes that drastically affect
optimization performance of calls from static initializers to static fields.
Clojure provides support for loading code on startup from a user.clj file and this
occurred in the static initializer of the Clojure runtime (RT) class and was thus
affected.
This issue may eventually be resolved in Java, but in Clojure we have
modified runtime initialization to avoid loading user.clj in a static
initializer, which mitigates the case where this caused a performance
degradation.
CLJ-2484
Significant performance regression of code loaded in user.clj in Java 8u202/11.0. 馃煡
1.2 clojure.main Error Reporting
clojure.main is frequently used as a Clojure program launcher by external tools.
Previously, uncaught exceptions would be automatically printed by the JVM, which
would also print the stack trace.
This release will now catch exceptions and use the same error triage and printing
functionality as the Clojure repl. The full stack trace, ex-info, and other
information will be printed to a target specified by the configuration.
The three available error targets are:
file - write to a temp file (default, falls back to stderr)
stderr - write to stderr stream
none - don't write
These error targets can be specified either as options to clojure.main, or as
Java system properties (flags take precedence). When invoking clojure.main
(or using the clj tool), use --report <target>. For Java system property,
use -Dclojure.main.report=<target>.
CLJ-2463
Improve error printing in clojure.main with -m, -e, etc 馃煩
CLJ-2497
Put error report location on its own line 馃煩
CLJ-2504
Provide more options for error reporting in clojure.main 馃煩
2 Fixes
CLJ-2499
Some compiler expr evals report as wrong error phase 馃煥
CLJ-2491
Updated fragile tests so Clojure test suite runs on Java 12 馃煥
Changes to Clojure in Version 1.10
1 Compatibility and Dependencies
1.1 Java
Clojure 1.10 now requires Java 8 or above. There were a number of updates related to this change and/or Java compatibility fixes for Java 8, 9, 10, and 11:
CLJ-2363
Bump to Java 8 as minimum requirement, update embedded ASM to 6.2,
remove reliance on jsr166 jar, update javadoc links, and remove
conditional logic. 馃煡
core.specs.alpha dependency to 0.2.44 - changes 馃煥
2 Features and major changes
2.1 Error messages
Clojure errors can occur in several distinct "phases" - reading source, macroexpansion, compilation, execution, and result printing. Clojure (and the REPL) now identify these phases in the exception and the message.
The read/macroexpand/compile phases produce a CompilerException and indicate the location in the caller source code where the problem occurred (previously macroexpansion reported the error in the macroexpansion stack). CompilerException now implements IExceptionInfo and ex-data will report exception data including the following (optional) keys:
:clojure.error/column - column of line in source file
:clojure.error/symbol - symbol being macroexpanded or compiled
:clojure.error/class - cause exception class symbol
:clojure.error/cause - cause exception message
:clojure.error/spec - explain-data for spec errors
clojure.main also contains two new functions: ex-triage and ex-str that can be used by external tools to mimic some or all of the Clojure repl reporting. ex-triage takes the output of Throwable->map and produces a concise analysis of the error phase, cause, etc (same keys as above). ex-str takes that analysis data and produces a message to print at the repl.
CLJ-2373 馃煩
Detect phase and overhaul exception message and printing
CLJ-2415 馃煩
Error cause should always be on 2nd line of error message
CLJ-2420 馃煩
Refinement of error phases, ex-triage, execution error line reporting
CLJ-2427 馃煥
CompilerException.toString() can throw if making message during initialization
CLJ-2430 馃煥
Elevate phase in throwable data and conveyance for prepl
CLJ-2435 馃煥
Include root cause class name in compilation and macroexpansion error phases
CLJ-2438 馃煥
Demunge source symbol in execution error messages
2.2 Protocol extension by metadata
defprotocol has a new option :extend-via-metadata. When :extend-via-metadata is true, values can extend protocols by adding metadata where keys are fully-qualified protocol function symbols and values are function implementations. Protocol implementations are checked first for direct definitions (defrecord, deftype, reify), then metadata definitions, then external extensions (extend, extend-type, extend-protocol).
Protocol extension by metadata 馃煩
2.3 tap
tap is a shared, globally accessible system for distributing a series of informational or diagnostic values to a set of (presumably effectful) handler functions. It can be used as a better debug prn, or for facilities like logging etc.
tap> sends a value to the set of taps. Taps can be added with add-tap and will be called with any value sent to tap>. The tap function may (briefly) block (e.g. for streams) and will never impede calls to tap>, but blocking indefinitely may cause tap values to be dropped. If no taps are registered, tap> discards. Remove taps with remove-tap.
tap 馃煩
2.4 Read string capture mode
read+string is a new function that mimics read but also captures the string that is read and returns both the read value and the (whitespace-trimmed) read string. read+string requires a LineNumberingPushbackReader.
Read string capture mode 馃煩
2.5 prepl (alpha)
prepl is a new stream-based REPL with structured output (suitable for programmatic use). Forms are read from the reader, evaluated, and return data maps for the return value (if successful), output to *out* (possibly many), output to *err* (possibly many), or tap> values (possibly many).
New functions in clojure.core.server:
prepl - the repl
io-prepl - a prepl bound to *in* and *out* suitable for use with the Clojure socket server
remote-prepl - a prepl that can be connected to a remote prepl over a socket
prepl is alpha and subject to change.
prepl 馃煩
2.6 datafy and nav
clojure.datafy is a facility for object to data transformation. The datafy and nav functions can be used used to transform and (lazily) navigate through object graphs. The data transformation process can be influenced by consumers using protocols or metadata.
Once #793 is done
Go over the changelog for Clojure 1.10.0-1.10.3 and apply the changes to Clojerl.
Review the code changes by checking out tag
clojure-1.10.3
and then running git difclojure-1.9.0
.Reference:
Applicable 馃煩
Maybe Applicable 馃煥
Not Applicable 馃煡
Changes to Clojure in Version 1.10.3
1 Changes reverted
Improve error message for case 馃煥
2 Fixes
Enable reader conditionals in Clojure prepl 馃煥
Changes to Clojure in Version 1.10.2
1 Dependencies
Updated dependencies:
2 Fixes
2.1 Interop / JVM
Ensure monitor object is on stack, for verifiers 馃煡
More fixes for invocation of static interface methods with primitive args 馃煡
Remove uses of deprecated Class.newInstance() 馃煡
Fix javadoc urls for JDK 11+ 馃煡
Add Throwable return type hint to ex-cause 馃煥
Avoid reflection in clojure.data 馃煥
Fix reflection warnings in clojure.stacktrace/print-stack-trace 馃煥
proxy should emit Java 1.8 bytecode 馃煡
2.2 Core
Fix case expression branch analysis that resulted in compilation error 馃煥
Improve error message for case 馃煥
nth with not-found on regex matcher returns not-found on last group index 馃煥
vector-of does not implement equals or hashing methods 馃煡
There is no support for
vector-of
in Clojerl.vector-of does not implement IObj for metadata 馃煡
There is no support for
vector-of
in Clojerl.quoted metadata on empty literal colls is lost 馃煥
ExceptionInInitializerError if jars executed with java -jar 馃煡
2.3 Printing
Fix errors in printing some maps with namespace syntax 馃煩
pprint doesn't print collection metadata when
*print-meta*
is true 馃煩2.4 Docstrings
Eliminate duplicate doc string printing for special forms 馃煩
prepl docstring is incorrect 馃煩
conj has out-of-date :arglists 馃煩
3 Performance
Use transient map in zipmap 馃煥
Changes to Clojure in Version 1.10.1
1 Features and Major Changes
1.1 Workaround Java Performance Regression When Loading user.clj
Recent builds of Java 8 (u202), 11 (11.0.2), 12, and 13 included
some changes that drastically affect
optimization performance of calls from static initializers to static fields.
Clojure provides support for loading code on startup from a user.clj file and this
occurred in the static initializer of the Clojure runtime (RT) class and was thus
affected.
This issue may eventually be resolved in Java, but in Clojure we have
modified runtime initialization to avoid loading user.clj in a static
initializer, which mitigates the case where this caused a performance
degradation.
Significant performance regression of code loaded in user.clj in Java 8u202/11.0. 馃煡
1.2 clojure.main Error Reporting
clojure.main is frequently used as a Clojure program launcher by external tools.
Previously, uncaught exceptions would be automatically printed by the JVM, which
would also print the stack trace.
This release will now catch exceptions and use the same error triage and printing
functionality as the Clojure repl. The full stack trace, ex-info, and other
information will be printed to a target specified by the configuration.
The three available error targets are:
These error targets can be specified either as options to clojure.main, or as
Java system properties (flags take precedence). When invoking clojure.main
(or using the clj tool), use
--report <target>
. For Java system property,use
-Dclojure.main.report=<target>
.Improve error printing in clojure.main with -m, -e, etc 馃煩
Put error report location on its own line 馃煩
Provide more options for error reporting in clojure.main 馃煩
2 Fixes
Some compiler expr evals report as wrong error phase 馃煥
Updated fragile tests so Clojure test suite runs on Java 12 馃煥
Changes to Clojure in Version 1.10
1 Compatibility and Dependencies
1.1 Java
Clojure 1.10 now requires Java 8 or above. There were a number of updates related to this change and/or Java compatibility fixes for Java 8, 9, 10, and 11:
Bump to Java 8 as minimum requirement, update embedded ASM to 6.2,
remove reliance on jsr166 jar, update javadoc links, and remove
conditional logic. 馃煡
ASM regression fix 馃煡
Fix invalid bytecode generation for static interface method calls in Java 9+ 馃煡
Add reflection fallback for --illegal-access warnings in Java 9+ 馃煡
Fix brittle test that fails on Java 10 build due to serialization drift 馃煡
Add type hint to address reflection ambiguity in JDK 11 馃煡
Fix usage of deprecated JDK apis 馃煡
Regression in reflectively finding default methods 馃煡
1.2 Dependencies
Updated dependencies:
2 Features and major changes
2.1 Error messages
Clojure errors can occur in several distinct "phases" - reading source, macroexpansion, compilation, execution, and result printing. Clojure (and the REPL) now identify these phases in the exception and the message.
The read/macroexpand/compile phases produce a CompilerException and indicate the location in the caller source code where the problem occurred (previously macroexpansion reported the error in the macroexpansion stack). CompilerException now implements IExceptionInfo and ex-data will report exception data including the following (optional) keys:
clojure.main also contains two new functions:
ex-triage
andex-str
that can be used by external tools to mimic some or all of the Clojure repl reporting.ex-triage
takes the output ofThrowable->map
and produces a concise analysis of the error phase, cause, etc (same keys as above).ex-str
takes that analysis data and produces a message to print at the repl.Detect phase and overhaul exception message and printing
Error cause should always be on 2nd line of error message
Refinement of error phases,
ex-triage
, execution error line reportingCompilerException.toString() can throw if making message during initialization
Elevate phase in throwable data and conveyance for prepl
Include root cause class name in compilation and macroexpansion error phases
Demunge source symbol in execution error messages
2.2 Protocol extension by metadata
defprotocol
has a new option:extend-via-metadata
. When :extend-via-metadata is true, values can extend protocols by adding metadata where keys are fully-qualified protocol function symbols and values are function implementations. Protocol implementations are checked first for direct definitions (defrecord, deftype, reify), then metadata definitions, then external extensions (extend, extend-type, extend-protocol).2.3 tap
tap is a shared, globally accessible system for distributing a series of informational or diagnostic values to a set of (presumably effectful) handler functions. It can be used as a better debug prn, or for facilities like logging etc.
tap>
sends a value to the set of taps. Taps can be added withadd-tap
and will be called with any value sent totap>
. The tap function may (briefly) block (e.g. for streams) and will never impede calls totap>
, but blocking indefinitely may cause tap values to be dropped. If no taps are registered,tap>
discards. Remove taps withremove-tap
.2.4 Read string capture mode
read+string
is a new function that mimicsread
but also captures the string that is read and returns both the read value and the (whitespace-trimmed) read string.read+string
requires a LineNumberingPushbackReader.2.5 prepl (alpha)
prepl is a new stream-based REPL with structured output (suitable for programmatic use). Forms are read from the reader, evaluated, and return data maps for the return value (if successful), output to
*out*
(possibly many), output to*err*
(possibly many), or tap> values (possibly many).New functions in clojure.core.server:
prepl
- the replio-prepl
- a prepl bound to*in*
and*out*
suitable for use with the Clojure socket serverremote-prepl
- a prepl that can be connected to a remote prepl over a socketprepl is alpha and subject to change.
2.6 datafy and nav
clojure.datafy is a facility for object to data transformation. The
datafy
andnav
functions can be used used to transform and (lazily) navigate through object graphs. The data transformation process can be influenced by consumers using protocols or metadata.datafy is alpha and subject to change.
Datafy JavaReflector
2.6 Other new functions in core
These functions have been added to match existing functions in ClojureScript to increase the portability of error-handling code:
ex-cause
- extract the cause exception 馃煥ex-message
- extract the cause message 馃煥This function has been added to construct a PrintWriter implementation whose behavior on flush and close is provided as functions:
PrintWriter-on
- create a PrintWriter from flush-fn and close-fn 馃煥The following function has been added, extending
resolve
:requiring-resolve
- resolve or, if needed, require symbol's namespace, then resolve 馃煥serialized-require
- likerequire
but for use in asynchronous load uses 馃煥3 Enhancements
3.1 Error messages
Report correct arity count for function arity errors inside macros
Omit ex-info construction frames
Warn in pst that stack trace for syntax error failed before execution
Omit :in clauses when printing spec function errors if using default explain printer
Mention cljc in error when require fails
Improve error message when unable to match static method 馃煥
3.2 Documentation
clojure.instant - add arglist meta for functions
proxy
- fix typoThere is no
proxy
in Clojerl.remove-tap
- fix repetitionflatten
- describe result as lazy3.3 Performance
Reuse seq in
some
The empty map literal is read as a different map each time
with-meta
should return identity when new meta is identical to prior3.4 Other enhancements
symbol
can now take a var or a keyword argument 馃煥Print ex-data in clojure.test error reports
Add test for var serialization
sort
andsort-by
should retain meta4 Fixes
4.1 Collections
PersistentHashMap leaks memory when keys are removed with
without
PersistentArrayMap鈥檚 assoc doesn鈥檛 respect HASHTABLE_THRESHOLD
Remove redundant key comparisons in HashCollisionNode
Sorted colls with default comparator don鈥檛 check that first element is Comparable
4.2 API
clojure.walk/postwalk does not preserve MapEntry type objects
Report correct line number for uncaught ExceptionInfo in clojure.test
partition-by runs infinite loop when one element of infinite partition is accessed
unchecked-* functions have different behavior on primitive longs vs boxed Longs
Clojerl has no unchecked math.
4.3 Other
ns-resolve might throw ClassNotFoundException but should return nil
Fix bugs in Clojure unit tests
In reader, don't ignore explicit :line :col meta
The text was updated successfully, but these errors were encountered: