Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include changes from clojure-1.10.3 #794

Open
22 of 85 tasks
jfacorro opened this issue May 21, 2021 · 0 comments
Open
22 of 85 tasks

Include changes from clojure-1.10.3 #794

jfacorro opened this issue May 21, 2021 · 0 comments

Comments

@jfacorro
Copy link
Member

jfacorro commented May 21, 2021

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 dif clojure-1.9.0.

Reference:

Applicable 馃煩
Maybe Applicable 馃煥
Not Applicable 馃煡

Changes to Clojure in Version 1.10.3

1 Changes reverted

  • CLJ-2564
    Improve error message for case 馃煥

2 Fixes

  • CLJ-2453
    Enable reader conditionals in Clojure prepl 馃煥

Changes to Clojure in Version 1.10.2

1 Dependencies

Updated dependencies:

  • spec.alpha dependency to 0.2.194 - changes 馃煩
  • core.specs.alpha dependency to 0.2.56 - changes 馃煩

2 Fixes

2.1 Interop / JVM

  • CLJ-1472
    Ensure monitor object is on stack, for verifiers 馃煡
  • CLJ-2517
    More fixes for invocation of static interface methods with primitive args 馃煡
  • CLJ-2492
    Remove uses of deprecated Class.newInstance() 馃煡
  • CLJ-2534
    Fix javadoc urls for JDK 11+ 馃煡
  • CLJ-2571
    Add Throwable return type hint to ex-cause 馃煥
  • CLJ-2572
    Avoid reflection in clojure.data 馃煥
  • CLJ-2502
    Fix reflection warnings in clojure.stacktrace/print-stack-trace 馃煥
  • CLJ-2597
    proxy should emit Java 1.8 bytecode 馃煡

2.2 Core

  • CLJ-2580
    Fix case expression branch analysis that resulted in compilation error 馃煥
  • CLJ-2564
    Improve error message for case 馃煥
  • CLJ-2585
    nth with not-found on regex matcher returns not-found on last group index 馃煥
  • CLJ-1364
    vector-of does not implement equals or hashing methods 馃煡
    There is no support for vector-of in Clojerl.
  • CLJ-2549
    vector-of does not implement IObj for metadata 馃煡
    There is no support for vector-of in Clojerl.
  • CLJ-1187
    quoted metadata on empty literal colls is lost 馃煥
  • CLJ-2459
    ExceptionInInitializerError if jars executed with java -jar 馃煡

2.3 Printing

  • CLJ-2469
    Fix errors in printing some maps with namespace syntax 馃煩
  • CLJ-1445
    pprint doesn't print collection metadata when *print-meta* is true 馃煩

2.4 Docstrings

  • CLJ-2295
    Eliminate duplicate doc string printing for special forms 馃煩
  • CLJ-2495
    prepl docstring is incorrect 馃煩
  • CLJ-2169
    conj has out-of-date :arglists 馃煩

3 Performance

  • CLJ-1005
    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.

  • 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. 馃煡
  • CLJ-2367
    ASM regression fix 馃煡
  • CLJ-2284
    Fix invalid bytecode generation for static interface method calls in Java 9+ 馃煡
  • CLJ-2066
    Add reflection fallback for --illegal-access warnings in Java 9+ 馃煡
  • CLJ-2330
    Fix brittle test that fails on Java 10 build due to serialization drift 馃煡
  • CLJ-2374
    Add type hint to address reflection ambiguity in JDK 11 馃煡
  • CLJ-2375
    Fix usage of deprecated JDK apis 馃煡
  • CLJ-2414
    Regression in reflectively finding default methods 馃煡

1.2 Dependencies

Updated dependencies:

  • spec.alpha dependency to 0.2.176 - changes 馃煥
  • 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/phase - phase (:read-source, :macro-syntax-check, :macroexpansion, :compile-syntax-check, :compilation, :execution, :read-eval-result, :print-eval-result)
  • :clojure.error/source - source file
  • :clojure.error/line - line in source file
  • :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.

datafy is alpha and subject to change.

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 - like require but for use in asynchronous load uses 馃煥

3 Enhancements

3.1 Error messages

  • CLJ-1279 馃煥
    Report correct arity count for function arity errors inside macros
  • CLJ-2386 馃煥
    Omit ex-info construction frames
  • CLJ-2394 馃煥
    Warn in pst that stack trace for syntax error failed before execution
  • CLJ-2396 馃煥
    Omit :in clauses when printing spec function errors if using default explain printer
  • CLJ-1797 馃煥
    Mention cljc in error when require fails
  • CLJ-1130
    Improve error message when unable to match static method 馃煥

3.2 Documentation

  • CLJ-2044 馃煥
    clojure.instant - add arglist meta for functions
  • CLJ-2257 馃煡
    proxy - fix typo
    There is no proxy in Clojerl.
  • CLJ-2332 馃煥
    remove-tap - fix repetition
  • CLJ-2122 馃煩
    flatten - describe result as lazy

3.3 Performance

  • CLJ-1654 馃煥
    Reuse seq in some
  • CLJ-1366 馃煥
    The empty map literal is read as a different map each time
  • CLJ-2362 馃煥
    with-meta should return identity when new meta is identical to prior

3.4 Other enhancements

  • symbol can now take a var or a keyword argument 馃煥
  • CLJ-1209 馃煥
    Print ex-data in clojure.test error reports
  • CLJ-2163 馃煥
    Add test for var serialization
  • CLJ-2417 馃煥
    sort and sort-by should retain meta

4 Fixes

4.1 Collections

  • CLJ-2297 馃煥
    PersistentHashMap leaks memory when keys are removed with without
  • CLJ-1587 馃煥
    PersistentArrayMap鈥檚 assoc doesn鈥檛 respect HASHTABLE_THRESHOLD
  • CLJ-2050 馃煥
    Remove redundant key comparisons in HashCollisionNode
  • CLJ-2089 馃煥
    Sorted colls with default comparator don鈥檛 check that first element is Comparable

4.2 API

  • CLJ-2031 馃煥
    clojure.walk/postwalk does not preserve MapEntry type objects
  • CLJ-2349 馃煥
    Report correct line number for uncaught ExceptionInfo in clojure.test
  • CLJ-1764 馃煥
    partition-by runs infinite loop when one element of infinite partition is accessed
  • CLJ-1832 馃煡
    unchecked-* functions have different behavior on primitive longs vs boxed Longs
    Clojerl has no unchecked math.

4.3 Other

  • CLJ-1403 馃煥
    ns-resolve might throw ClassNotFoundException but should return nil
  • CLJ-2407 馃煥
    Fix bugs in Clojure unit tests
  • CLJ-1079 馃煥
    In reader, don't ignore explicit :line :col meta
@jfacorro jfacorro changed the title Include changes for 1.10.0 Include changes from 1.10.3 May 21, 2021
@jfacorro jfacorro changed the title Include changes from 1.10.3 Include changes from clojure-1.10.3 May 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant