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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include changes from clojure-1.9.0 #793

Closed
44 tasks done
jfacorro opened this issue May 21, 2021 · 1 comment
Closed
44 tasks done

Include changes from clojure-1.9.0 #793

jfacorro opened this issue May 21, 2021 · 1 comment

Comments

@jfacorro
Copy link
Member

jfacorro commented May 21, 2021

Go over the changelog for Clojure 1.9.0 and apply them to Clojerl.

Review the code changes by checking out tag clojure-1.9.0 and then running git dif clojure-1.8.0.

Reference:

  • Applicable 🟩
  • Maybe Applicable 🟨
  • Not Applicable 🟥

Changes to Clojure in Version 1.9

  • 1 New and Improved Features
    • 1.1 spec 🟩
    • 1.2 Support for working with maps with qualified keys 🟩
    • 1.3 New predicates 🟩
    • 1.4 More support for instants 🟨
    • 1.5 Other new core functions 🟩
      • 1.6 Other reader enhancements
      • Can now bind reader-resolver to an impl of LispReader$Resolver to control the reader’s use of namespace interactions when resolving autoresolved keywords and maps. 🟨
      • Add new ## reader macro for symbolic values, and read/print support for double vals ##Inf, ##-Inf, ##NaN (CLJ-1074) 🟥
        There is no representation for Inf, -Inf or NaN in the BEAM that would play nicely with the available number types.
  • 2 Enhancements
    • 2.1 Spec syntax checking 🟩
    • 2.2 Documentation 🟩
    • 2.3 Performance
      • Improved update-in performance 🟩
      • Optimized seq & destructuring 🟩
      • CLJ-2210 Cache class derivation in compiler to improve compiler performance 🟥
        There are no classes in the BEAM.
      • CLJ-2188 slurp - mark return type as String 🟩
      • CLJ-2070 clojure.core/delay - improve performance 🟥
        Delay has a completely different implementation in Clojerl, therefore the performance improvement does not apply.
      • CLJ-1917 Reducing seq over string should call String/length outside of loop 🟨
        There is an implementation of StringSeq but there is no InternalReduce protocol in Clojerl (or any of the logic around CollReduce either). This is because most of that implementation relies on the hierachy of classes in the JVM. The alternative chosen in Clojerl is to implement the clojerl.IReduce protocol for the collections and seqs that would be included in the original Clojure logic. Following this reasoning, clojerl.StringSeq does not implement IReduce so we should probably add that.
      • CLJ-1901 amap - should call alength only once 🟥
        There are no arrays in the BEAM.
      • CLJ-1224 Record instances now cache hasheq and hashCode like maps 🟥
        This cache is implemented using unsynchronized-mutable in Clojure JVM. There is no way to cache values in this way on the BEAM. There are ways (e.g. calculate the hash when the record is created or updated) but none of them are robust enough and/or the trade-off seem worthy.
      • CLJ-99 min-key and max-key - evaluate k on each arg at most once 🟩
    • 2.4 Other enhancements
      • Added Var serialization for identity, not value 🟥
        There is no java.io.Serializable equivalent on the BEAM.
      • into now has a 0-arity (returns []) and 1-arity (returns the coll that's passed) 🟩
      • CLJ-2184 Propagate meta in doto forms to improve error reporting 🟩
      • CLJ-1744 Clear unused locals, which can prevent memory leaks in some cases 🟥
        After checking the linked issue, this does not seem to cause any issues (tried with OTP 24), it could be because the BEAM compiler includes a pass to remove unusued locals, and therefore there is no lingering reference to the lazy seq head. We could confirm this by compiling the expression in the issue (i.e. (loop [[a & b] c] [a b])) and check the assembler BEAM code generated for it by providing the --to-asm to bin/clj or bin/clojure.
      • CLJ-1673 clojure.repl/dir-fn now works on namespace aliases 🟩
      • CLJ-1423 Allow vars to be invoked with infinite arglists (also, faster) 🟩
  • 3 Fixes
    • 3.1 Security 🟥
      There is only one change in this section which is related serialization of proxy classes, neither of which are available in this implementation.
    • 3.2 Docs 🟩
    • 3.3 Other fixes
      • clojure.core/Throwable->map formerly returned StackTraceElements which were later handled by the printer. Now the StackTraceElements are converted to data such that the return value is pure Clojure data, as intended. 🟥
        There is no Throwable class in the BEAM, any value can be use in a throw expression. However Clojerl defines the IError protocol which it uses to provide user defined errors and more Clojuresque error handling. This is why Throwable->map was renamed to IError->map.
      • CLJ-2091 clojure.lang.APersistentVector#hashCode is not thread-safe 🟥
        There are no threads on the BEAM, every value is immutable and each process keeps its state (note: this does not mean that there can't be race conditions between processes though).
      • CLJ-2077 Clojure can't be loaded from the boot classpath under java 9 🟥
        JVM specific.
      • CLJ-2048 Specify type to avoid ClassCastException when stack trace is elided by JVM 🟥
        JVM specific.
      • CLJ-1914 Fixed race condition in concurrent range realization 🟥
        See comment for CLJ-2091 above.
      • CLJ-1887 IPersistentVector.length() - implement missing method 🟥
        This is related to gvec's implementation which is used in vector-of which is not supported in Clojerl.
      • CLJ-1870 Fixed reloading a defmulti removes metadata on the var 🟩
      • CLJ-1860 Make -0.0 hash consistent with 0.0 🟩
      • CLJ-1841 bean - iterator was broken 🟥
        JVM specific.
      • CLJ-1793 Clear 'this' before calls in tail position 🟥
        JVM specific.
      • CLJ-1790 Fixed error extending protocols to Java arrays 🟥
        JVM specific.
      • CLJ-1714 using a class in a type hint shouldn’t load the class 🟥
        JVM specific.
      • CLJ-1705 vector-of - fix NullPointerException if given unrecognized type 🟥
        vector-of not supported in Clojerl.
      • CLJ-1398 clojure.java.javadoc/javadoc - update doc urls 🟥
        JVM specific.
      • CLJ-1371 Numbers.divide(Object, Object) - add checks for NaN 🟥
        There is no NaN on the BEAM.
      • CLJ-1358 doc - does not expand special cases properly (try, catch) 🟩
      • CLJ-1242 equals doesn't throw on sorted collections 🟥
        It never did on Clojerl.
      • CLJ-700 contains?, get, and find broken for transient collections 🟥
        No support for transient collections in Clojerl.
jfacorro added a commit that referenced this issue May 22, 2021
jfacorro added a commit that referenced this issue May 22, 2021
jfacorro added a commit that referenced this issue May 22, 2021
jfacorro added a commit that referenced this issue May 22, 2021
jfacorro added a commit that referenced this issue May 22, 2021
jfacorro added a commit that referenced this issue May 23, 2021
jfacorro added a commit that referenced this issue May 23, 2021
jfacorro added a commit that referenced this issue May 23, 2021
jfacorro added a commit that referenced this issue May 29, 2021
jfacorro added a commit that referenced this issue May 29, 2021
jfacorro added a commit that referenced this issue May 29, 2021
jfacorro added a commit that referenced this issue May 29, 2021
jfacorro added a commit that referenced this issue May 29, 2021
jfacorro added a commit that referenced this issue May 29, 2021
jfacorro added a commit that referenced this issue May 29, 2021
jfacorro added a commit that referenced this issue Aug 25, 2021
jfacorro added a commit that referenced this issue Aug 25, 2021
With the introduction of JIT compilation in OTP 24 there is less need to use native compilation.
jfacorro added a commit that referenced this issue Aug 25, 2021
…re-1.9.0

[#793] include spec.alpha for clojure 1.9.0
jfacorro added a commit that referenced this issue Aug 27, 2021
Since we are removing the deps from all deps to avoid a cyclic dependency with `clojerl` we need to explicitly add `test.check` which is a required dep for `spec.alpha`.
jfacorro added a commit that referenced this issue Aug 27, 2021
Since we are removing the deps from all deps to avoid a cyclic dependency with `clojerl` we need to explicitly add `test.check` which is a required dep for `spec.alpha`.
jfacorro added a commit that referenced this issue Aug 27, 2021
This is to confirm that there are no issues when compiling with the default profile
jfacorro added a commit that referenced this issue Aug 27, 2021
Since we are removing the deps from all deps to avoid a cyclic dependency with `clojerl` we need to explicitly add `test.check` which is a required dep for `spec.alpha`.
jfacorro added a commit that referenced this issue Aug 27, 2021
This is to confirm that there are no issues when compiling with the default profile
jfacorro added a commit that referenced this issue Aug 27, 2021
jfacorro added a commit that referenced this issue Sep 8, 2021
jfacorro added a commit that referenced this issue Sep 11, 2021
jfacorro added a commit that referenced this issue Sep 12, 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