Re: [ANN] Clojure 1.9.0-alpha20

2017-09-07 Thread Didier
I like this one, lots of good stuff. Thanks to everyone who contributed.

On Thursday, 7 September 2017 14:48:51 UTC-7, Alex Miller wrote:
>
> Clojure 1.9.0-alpha20 is now available.
>
> Try it via
>
> - Download: 
> https://repo1.maven.org/maven2/org/clojure/clojure/1.9.0-alpha20
> - Leiningen: [org.clojure/clojure "1.9.0-alpha20"]
>
> 1.9.0-alpha20 includes the following changes since 1.9.0-alpha19:
>
> - CLJ-1074 - (new) add new ## reader macro for symbolic values, and
>read/print support for double vals ##Inf, ##-Inf, ##NaN
> - CLJ-1454 - (new) add swap-vals! and reset-vals! that return both old and 
> new values
> - CLJ-2184 - (errors) propagate meta in doto forms to improve error 
> reporting
> - CLJ-2210 - (perf) cache class derivation in compiler to improve compiler 
> performance
> - CLJ-2070 - (perf) clojure.core/delay - improve performance
> - CLJ-1917 - (perf) reducing seq over string should call String/length 
> outside of loop
> - CLJ-1901 - (perf) amap - should call alength only once
> - CLJ-99   - (perf) min-key and max-key - evaluate k on each arg at most 
> once
> - CLJ-2188 - (perf) slurp - mark return type as String
> - CLJ-2108 - (startup time) delay loading of spec and core specs (still 
> more to do on this)
> - CLJ-2204 - (security) disable serialization of proxy classes to avoid 
> potential issue when deserializing
> - CLJ-2048 - (fix) specify type to avoid ClassCastException when stack 
> trace is elided by JVM
> - CLJ-1887 - (fix) IPersistentVector.length() - implement missing method
> - CLJ-1841 - (fix) bean - iterator was broken
> - CLJ-1714 - (fix) using a class in a type hint shouldn't load the class
> - CLJ-1398 - (fix) clojure.java.javadoc/javadoc - update doc urls
> - CLJ-1371 - (fix) Numbers.divide(Object, Object) - add checks for NaN
> - CLJ-1358 - (fix) doc - does not expand special cases properly (try, 
> catch)
> - CLJ-1705 - (fix) vector-of - fix NullPointerException if given 
> unrecognized type
> - CLJ-2170 - (doc) fix improperly located docstrings
> - CLJ-2156 - (doc) clojure.java.io/copy - doc char[] support
> - CLJ-2051 - (doc) clojure.instant/validated docstring - fix typo
> - CLJ-2104 - (doc) clojure.pprint docstring - fix typo
> - CLJ-2028 - (doc) filter, filterv, remove, take-while - fix docstrings
> - CLJ-1873 - (doc) require, *data-readers* - add .cljc files to docstrings
> - CLJ-1159 - (doc) clojure.java.io/delete-file - improve docstring
> - CLJ-2039 - (doc) deftype - fix typo in docstring
> - CLJ-1918 - (doc) await - improve docstring re shutdown-agents
> - CLJ-1837 - (doc) index-of, last-index-of - clarify docstrings
> - CLJ-1826 - (doc) drop-last - fix docstring
> - CLJ-1859 - (doc) zero?, pos?, neg? - fix docstrings
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Clojure 1.9.0-alpha20

2017-09-07 Thread Alex Miller
*sees*, not speeds (clearly I'm tired)

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Clojure 1.9.0-alpha20

2017-09-07 Thread Alex Miller
If anyone speeds performance issues, that would be good to know. 

Or performance gains! :)  

On Thursday, September 7, 2017 at 7:57:02 PM UTC-5, Sean Corfield wrote:
>
> Likewise. I expect we’ll put this in production early next week.
>
>  
>
> Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
> An Architect's View -- http://corfield.org/
>
> "If you're not annoying somebody, you're not really alive."
> -- Margaret Atwood
>
>  
>
> *From: *Jeaye 
> *Sent: *Thursday, September 7, 2017 5:24 PM
> *To: *clojure@googlegroups.com
> *Subject: *Re: [ANN] Clojure 1.9.0-alpha20
>
>  
>
> All of our tests are passing with this, so it looks good to me.
>
>  
>
> Thanks!
>
>  
>
> On Thu, Sep 07, 2017 at 02:48:51PM -0700, Alex Miller wrote:
>
> > Clojure 1.9.0-alpha20 is now available.
>
> > 
>
> > Try it via
>
> > 
>
> > - Download: 
> https://repo1.maven.org/maven2/org/clojure/clojure/1.9.0-alpha20
>
> > - Leiningen: [org.clojure/clojure "1.9.0-alpha20"]
>
> > 
>
> > 1.9.0-alpha20 includes the following changes since 1.9.0-alpha19:
>
> > 
>
> > - CLJ-1074 - (new) add new ## reader macro for symbolic values, and
>
> >read/print support for double vals ##Inf, ##-Inf, 
> ##NaN
>
> > - CLJ-1454 - (new) add swap-vals! and reset-vals! that return both old 
> and 
>
> > new values
>
> > - CLJ-2184 - (errors) propagate meta in doto forms to improve error 
>
> > reporting
>
> > - CLJ-2210 - (perf) cache class derivation in compiler to improve 
> compiler 
>
> > performance
>
> > - CLJ-2070 - (perf) clojure.core/delay - improve performance
>
> > - CLJ-1917 - (perf) reducing seq over string should call String/length 
>
> > outside of loop
>
> > - CLJ-1901 - (perf) amap - should call alength only once
>
> > - CLJ-99   - (perf) min-key and max-key - evaluate k on each arg at most 
>
> > once
>
> > - CLJ-2188 - (perf) slurp - mark return type as String
>
> > - CLJ-2108 - (startup time) delay loading of spec and core specs (still 
>
> > more to do on this)
>
> > - CLJ-2204 - (security) disable serialization of proxy classes to avoid 
>
> > potential issue when deserializing
>
> > - CLJ-2048 - (fix) specify type to avoid ClassCastException when stack 
>
> > trace is elided by JVM
>
> > - CLJ-1887 - (fix) IPersistentVector.length() - implement missing method
>
> > - CLJ-1841 - (fix) bean - iterator was broken
>
> > - CLJ-1714 - (fix) using a class in a type hint shouldn't load the class
>
> > - CLJ-1398 - (fix) clojure.java.javadoc/javadoc - update doc urls
>
> > - CLJ-1371 - (fix) Numbers.divide(Object, Object) - add checks for NaN
>
> > - CLJ-1358 - (fix) doc - does not expand special cases properly (try, 
> catch)
>
> > - CLJ-1705 - (fix) vector-of - fix NullPointerException if given 
>
> > unrecognized type
>
> > - CLJ-2170 - (doc) fix improperly located docstrings
>
> > - CLJ-2156 - (doc) clojure.java.io/copy - doc char[] support
>
> > - CLJ-2051 - (doc) clojure.instant/validated docstring - fix typo
>
> > - CLJ-2104 - (doc) clojure.pprint docstring - fix typo
>
> > - CLJ-2028 - (doc) filter, filterv, remove, take-while - fix docstrings
>
> > - CLJ-1873 - (doc) require, *data-readers* - add .cljc files to 
> docstrings
>
> > - CLJ-1159 - (doc) clojure.java.io/delete-file - improve docstring
>
> > - CLJ-2039 - (doc) deftype - fix typo in docstring
>
> > - CLJ-1918 - (doc) await - improve docstring re shutdown-agents
>
> > - CLJ-1837 - (doc) index-of, last-index-of - clarify docstrings
>
> > - CLJ-1826 - (doc) drop-last - fix docstring
>
> > - CLJ-1859 - (doc) zero?, pos?, neg? - fix docstrings
>
> > 
>
> > -- 
>
> > You received this message because you are subscribed to the Google
>
> > Groups "Clojure" group.
>
> > To post to this group, send email to clojure@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+unsubscr...@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+unsubscr...@googlegroups.com.
>
> > For more options, visit https://groups.google.com/d/optout.
>
>  
>
> -- 
>
> You received this message because you are subscribed to the Google
>
> Groups "Clojure" group.
>
> To post to this group, send email to clojure@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+unsubscr...@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 

RE: [ANN] Clojure 1.9.0-alpha20

2017-09-07 Thread Sean Corfield
Likewise. I expect we’ll put this in production early next week.

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

From: Jeaye
Sent: Thursday, September 7, 2017 5:24 PM
To: clojure@googlegroups.com
Subject: Re: [ANN] Clojure 1.9.0-alpha20

All of our tests are passing with this, so it looks good to me.

Thanks!

On Thu, Sep 07, 2017 at 02:48:51PM -0700, Alex Miller wrote:
> Clojure 1.9.0-alpha20 is now available.
> 
> Try it via
> 
> - Download: https://repo1.maven.org/maven2/org/clojure/clojure/1.9.0-alpha20
> - Leiningen: [org.clojure/clojure "1.9.0-alpha20"]
> 
> 1.9.0-alpha20 includes the following changes since 1.9.0-alpha19:
> 
> - CLJ-1074 - (new) add new ## reader macro for symbolic values, and
>read/print support for double vals ##Inf, ##-Inf, ##NaN
> - CLJ-1454 - (new) add swap-vals! and reset-vals! that return both old and 
> new values
> - CLJ-2184 - (errors) propagate meta in doto forms to improve error 
> reporting
> - CLJ-2210 - (perf) cache class derivation in compiler to improve compiler 
> performance
> - CLJ-2070 - (perf) clojure.core/delay - improve performance
> - CLJ-1917 - (perf) reducing seq over string should call String/length 
> outside of loop
> - CLJ-1901 - (perf) amap - should call alength only once
> - CLJ-99   - (perf) min-key and max-key - evaluate k on each arg at most 
> once
> - CLJ-2188 - (perf) slurp - mark return type as String
> - CLJ-2108 - (startup time) delay loading of spec and core specs (still 
> more to do on this)
> - CLJ-2204 - (security) disable serialization of proxy classes to avoid 
> potential issue when deserializing
> - CLJ-2048 - (fix) specify type to avoid ClassCastException when stack 
> trace is elided by JVM
> - CLJ-1887 - (fix) IPersistentVector.length() - implement missing method
> - CLJ-1841 - (fix) bean - iterator was broken
> - CLJ-1714 - (fix) using a class in a type hint shouldn't load the class
> - CLJ-1398 - (fix) clojure.java.javadoc/javadoc - update doc urls
> - CLJ-1371 - (fix) Numbers.divide(Object, Object) - add checks for NaN
> - CLJ-1358 - (fix) doc - does not expand special cases properly (try, catch)
> - CLJ-1705 - (fix) vector-of - fix NullPointerException if given 
> unrecognized type
> - CLJ-2170 - (doc) fix improperly located docstrings
> - CLJ-2156 - (doc) clojure.java.io/copy - doc char[] support
> - CLJ-2051 - (doc) clojure.instant/validated docstring - fix typo
> - CLJ-2104 - (doc) clojure.pprint docstring - fix typo
> - CLJ-2028 - (doc) filter, filterv, remove, take-while - fix docstrings
> - CLJ-1873 - (doc) require, *data-readers* - add .cljc files to docstrings
> - CLJ-1159 - (doc) clojure.java.io/delete-file - improve docstring
> - CLJ-2039 - (doc) deftype - fix typo in docstring
> - CLJ-1918 - (doc) await - improve docstring re shutdown-agents
> - CLJ-1837 - (doc) index-of, last-index-of - clarify docstrings
> - CLJ-1826 - (doc) drop-last - fix docstring
> - CLJ-1859 - (doc) zero?, pos?, neg? - fix docstrings
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@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+unsubscr...@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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@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 

Re: [ANN] Clojure 1.9.0-alpha20

2017-09-07 Thread Jeaye
All of our tests are passing with this, so it looks good to me.

Thanks!

On Thu, Sep 07, 2017 at 02:48:51PM -0700, Alex Miller wrote:
> Clojure 1.9.0-alpha20 is now available.
> 
> Try it via
> 
> - Download: https://repo1.maven.org/maven2/org/clojure/clojure/1.9.0-alpha20
> - Leiningen: [org.clojure/clojure "1.9.0-alpha20"]
> 
> 1.9.0-alpha20 includes the following changes since 1.9.0-alpha19:
> 
> - CLJ-1074 - (new) add new ## reader macro for symbolic values, and
>read/print support for double vals ##Inf, ##-Inf, ##NaN
> - CLJ-1454 - (new) add swap-vals! and reset-vals! that return both old and 
> new values
> - CLJ-2184 - (errors) propagate meta in doto forms to improve error 
> reporting
> - CLJ-2210 - (perf) cache class derivation in compiler to improve compiler 
> performance
> - CLJ-2070 - (perf) clojure.core/delay - improve performance
> - CLJ-1917 - (perf) reducing seq over string should call String/length 
> outside of loop
> - CLJ-1901 - (perf) amap - should call alength only once
> - CLJ-99   - (perf) min-key and max-key - evaluate k on each arg at most 
> once
> - CLJ-2188 - (perf) slurp - mark return type as String
> - CLJ-2108 - (startup time) delay loading of spec and core specs (still 
> more to do on this)
> - CLJ-2204 - (security) disable serialization of proxy classes to avoid 
> potential issue when deserializing
> - CLJ-2048 - (fix) specify type to avoid ClassCastException when stack 
> trace is elided by JVM
> - CLJ-1887 - (fix) IPersistentVector.length() - implement missing method
> - CLJ-1841 - (fix) bean - iterator was broken
> - CLJ-1714 - (fix) using a class in a type hint shouldn't load the class
> - CLJ-1398 - (fix) clojure.java.javadoc/javadoc - update doc urls
> - CLJ-1371 - (fix) Numbers.divide(Object, Object) - add checks for NaN
> - CLJ-1358 - (fix) doc - does not expand special cases properly (try, catch)
> - CLJ-1705 - (fix) vector-of - fix NullPointerException if given 
> unrecognized type
> - CLJ-2170 - (doc) fix improperly located docstrings
> - CLJ-2156 - (doc) clojure.java.io/copy - doc char[] support
> - CLJ-2051 - (doc) clojure.instant/validated docstring - fix typo
> - CLJ-2104 - (doc) clojure.pprint docstring - fix typo
> - CLJ-2028 - (doc) filter, filterv, remove, take-while - fix docstrings
> - CLJ-1873 - (doc) require, *data-readers* - add .cljc files to docstrings
> - CLJ-1159 - (doc) clojure.java.io/delete-file - improve docstring
> - CLJ-2039 - (doc) deftype - fix typo in docstring
> - CLJ-1918 - (doc) await - improve docstring re shutdown-agents
> - CLJ-1837 - (doc) index-of, last-index-of - clarify docstrings
> - CLJ-1826 - (doc) drop-last - fix docstring
> - CLJ-1859 - (doc) zero?, pos?, neg? - fix docstrings
> 
> -- 
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@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+unsubscr...@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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


signature.asc
Description: PGP signature


Re: Deserialization "gadget chain" in clojure

2017-09-07 Thread Daniel Compton
I saw that this issue was fixed in Clojure 1.9-alpha20. It's tracked in
https://dev.clojure.org/jira/browse/CLJ-2204. If you immediately wrote it
off as not affecting you because you never use clojure.inspector, it looks
like it also affects APersistentMap which is used by everyone. You still
need to be accepting serialized objects from an untrusted source (!) for
this to affect you AFAICT, but I thought it worth bringing up again.

--
Daniel.

On Thu, Jul 20, 2017 at 5:33 AM Ian Haken  wrote:

> Hey Alex,
>
> Thanks for digging and the quick reply. I missed your reply originally
> (apparently I have much to learn about properly subscribing to google
> groups), so sorry about the delay.
>
> Your understanding is completely correct and your assessment around the
> best way to mitigate this issue also seems spot on. I took a look at the
> comments in CLJ-2204 and it seems like you've got a good handle on a
> holistic approach to mitigating the issue as well.
>
> If you end up having any questions, let me know, but it seems like you're
> totally on top of it! Thanks again for digging into it and offering up a
> fix!
>
> Ian
>
> On Wednesday, July 12, 2017 at 5:15:20 AM UTC-7, Alex Miller wrote:
>>
>> Thanks dropping a line Ian. I dug into this a little to understand it
>> better, would be happy for any corrections.
>>
>> It seems the prerequisite for an attack like this is to have a server
>> that deserializes objects from an untrusted source. It should be obvious
>> that this is a bad idea. The attack boils down to crafting a serialized
>> object that, when deserialized, can run arbitrary code.
>>
>> The serialized class being constructed in the attack
>> is clojure.inspector.proxy$javax.swing.table.AbstractTableModel$ff19274a.
>> The Clojure inspector is a Swing app that ships inside the Clojure jar that
>> can be used from the repl to inspect Clojure data structures.
>> AbstractTableModel implements Serializable. The class in question is a
>> proxied subclass of AbstractTableModel (which is thus also Serializable).
>> Clojure proxies contain a field (__clojureFnMap) that is a map of method
>> names to proxy methods. Clojure AOT compiles the clojure.inspector code and
>> includes this proxied, serializable class inside the clojure jar.
>>
>> The attack constructs an instance of this proxy class and adds a
>> "hashCode" proxy method to the proxy's table. The method is a Clojure
>> function that can run arbitrary code. This instance is then put inside a
>> HashMap and the whole thing is serialized. On deserialization, the HashMap
>> will invoke hashCode() on the proxy object and cause the execution of the
>> arbitrary code.
>>
>> I have looked at all uses of proxy in the Clojure code base, and as far
>> as I can tell, this is the only case of a proxy of a Serializable class. A
>> quick and effective way to address this particular case is to stop AOT
>> compiling the clojure.inspector namespace. This removes the serializable
>> class from the Clojure jar. Users have no impact other than making the
>> Clojure inspector (which almost no one uses) slightly longer to start. So
>> this is an easy fix with little impact on users. I have filed an issue at
>> https://dev.clojure.org/jira/browse/CLJ-2204 with a patch modifying the
>> build for this purpose for the next Clojure release. We may also consider
>> releasing Clojure 1.8.1 with this change.
>>
>> Stepping back, it may also be worth considering ways to protect proxies
>> in general, either by detecting and forbidding the proxying of a
>> Serializable/Externalizable class without further steps or by reworking how
>> proxies are implemented in the first place. That's likely to be a bigger
>> change requiring a lot more analysis. I've logged a placeholder issue for
>> this at https://dev.clojure.org/jira/browse/CLJ-2205.
>>
>> Thanks,
>> Alex
>>
>>
>>
>> On Tuesday, July 11, 2017 at 11:37:30 PM UTC-5, Ian Haken wrote:
>>>
>>> Dear Clojure community,
>>>
>>> First off, apologies for directing this at the general clojure mailing
>>> list. I was looking for a better destination, but I couldn't find any
>>> obvious person or private mailing list to direct this to; hopefully from
>>> here this can get in front of anyone who may be interested.
>>>
>>> I recently identified a means to exploit an application performing
>>> unsafe deserialization by utilizing a "gadget chain" contained entirely in
>>> Clojure classes. What this means is that any application which is
>>> deserializing untrusted data and has Clojure on the classpath (whether or
>>> not it is actually using Clojure) is subject to a remote code execution
>>> exploit. Some more information on this form of vulnerability is available
>>> on the OWASP wiki
>>> ,
>>> which also has a number of useful links for deeper discussion.
>>>
>>> Details of the specific gadget chain I found can be seen here
>>> 

[ANN] Clojure 1.9.0-alpha20

2017-09-07 Thread Alex Miller
Clojure 1.9.0-alpha20 is now available.

Try it via

- Download: https://repo1.maven.org/maven2/org/clojure/clojure/1.9.0-alpha20
- Leiningen: [org.clojure/clojure "1.9.0-alpha20"]

1.9.0-alpha20 includes the following changes since 1.9.0-alpha19:

- CLJ-1074 - (new) add new ## reader macro for symbolic values, and
   read/print support for double vals ##Inf, ##-Inf, ##NaN
- CLJ-1454 - (new) add swap-vals! and reset-vals! that return both old and 
new values
- CLJ-2184 - (errors) propagate meta in doto forms to improve error 
reporting
- CLJ-2210 - (perf) cache class derivation in compiler to improve compiler 
performance
- CLJ-2070 - (perf) clojure.core/delay - improve performance
- CLJ-1917 - (perf) reducing seq over string should call String/length 
outside of loop
- CLJ-1901 - (perf) amap - should call alength only once
- CLJ-99   - (perf) min-key and max-key - evaluate k on each arg at most 
once
- CLJ-2188 - (perf) slurp - mark return type as String
- CLJ-2108 - (startup time) delay loading of spec and core specs (still 
more to do on this)
- CLJ-2204 - (security) disable serialization of proxy classes to avoid 
potential issue when deserializing
- CLJ-2048 - (fix) specify type to avoid ClassCastException when stack 
trace is elided by JVM
- CLJ-1887 - (fix) IPersistentVector.length() - implement missing method
- CLJ-1841 - (fix) bean - iterator was broken
- CLJ-1714 - (fix) using a class in a type hint shouldn't load the class
- CLJ-1398 - (fix) clojure.java.javadoc/javadoc - update doc urls
- CLJ-1371 - (fix) Numbers.divide(Object, Object) - add checks for NaN
- CLJ-1358 - (fix) doc - does not expand special cases properly (try, catch)
- CLJ-1705 - (fix) vector-of - fix NullPointerException if given 
unrecognized type
- CLJ-2170 - (doc) fix improperly located docstrings
- CLJ-2156 - (doc) clojure.java.io/copy - doc char[] support
- CLJ-2051 - (doc) clojure.instant/validated docstring - fix typo
- CLJ-2104 - (doc) clojure.pprint docstring - fix typo
- CLJ-2028 - (doc) filter, filterv, remove, take-while - fix docstrings
- CLJ-1873 - (doc) require, *data-readers* - add .cljc files to docstrings
- CLJ-1159 - (doc) clojure.java.io/delete-file - improve docstring
- CLJ-2039 - (doc) deftype - fix typo in docstring
- CLJ-1918 - (doc) await - improve docstring re shutdown-agents
- CLJ-1837 - (doc) index-of, last-index-of - clarify docstrings
- CLJ-1826 - (doc) drop-last - fix docstring
- CLJ-1859 - (doc) zero?, pos?, neg? - fix docstrings

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ANN] Insn: Functional JVM bytecode generation for Clojure.

2017-09-07 Thread jgpc42
Thank you for your reply. Very insightful.

Are you building it for a particular purpose like a compiler, or as a 
> curiosity?
>

I built it for a number of yet-unreleased projects I'm working on. One of 
which is a compiler of sorts. I will get around to open-sourcing them 
eventually.

The CLR is quite verbose and many parts of the bytecode emission machinery 
> require a lot of configuration to work
>

Since I posted this I have subsequently read more about the CLR's 
Reflection.Emit machinery, and I can see more why you chose this approach. 
Bytecode emission via ASM (and the JVM in general) is simpler and more 
straightforward AFAICT.

MAGE's il/local constructor function will produce a symbolic local variable
>

Related to the above, I understand this better now that I am more familiar 
the concepts of Reflection.Emit and DeclareLocal 

.

Mage will automatically flatten nested bytecode sequences.
>

I recently converted one of my projects from emitting via insn.op 
, to splicing 
seqs together for testing purposes. So I actually see more of this 
feature's value. I might implement this soon.

MAGE does support emitting types, modules and assemblies directly into 
> memory


To clarify, I was not asserting that MAGE does not support emitting to 
memory, only that the README states that a .dll is always written to disk.

... MAGIC project where it gets used and tested pretty extensively


I see. I did not think to check there.

Thank you again. I will also check out your blog.

On Wednesday, September 6, 2017 at 6:48:13 PM UTC-7, Ramsey Nasser wrote:
>
> Hello! MAGE author here. First off, insn looks super cool! I am excited to 
> see where the project goes. Are you building it for a particular purpose 
> like a compiler, or as a curiosity?
>
> With respect to MAGE,
>
> Mage provides fns for yielding the Clojure data that it consumes
>
> ... 
>
> I ultimately decided against this approach. I felt that using raw Clojure 
>> data provided more clarity, which is of course subjective. 
>
>
> Agreed, it's subjective. The CLR is quite verbose and many parts of the 
> bytecode emission machinery require a lot of configuration to work, and the 
> constructor functions allow me to set a lot of defaults in one place and 
> leave them out of the core emission logic. I got the approach from Kovas 
> Boguta's gamma library and haven't changed it since.
>
> Mage will automatically flatten nested bytecode sequences. This is not 
>> necessary in my opinion since you can just use unquote-splicing within an 
>> op sequence.
>
>
> True, but you don't lose anything to flattening bytecode sequences, and 
> being able to return vectors of bytecode (or even nil) from functions is 
> very convenient. In an environment without a stack language (like LLVM), 
> I'd probably reconsider this, but I really like not worrying about the 
> shape of my symbolic bytecode as I generate it.
>
> Mage has the concept of named local variables.
>
>
> This isn't quite the case. Locals on the CLR do not have names and compile 
> down to offsets, but MAGE's  il/local constructor function will produce a 
> symbolic local variable (just Clojure data like everything else) that will 
> get stitched together by the emission library at the end. I use Clojure's 
> let bindings to cause the same symbolic local to appear in multiple places 
> in the bytecode stream, and they get resolved to the same offset in the 
> final bytecode.
>
> Finally, mage seems to require always writing out an assembly .dll to disk 
>> on each emit.
>
>
> Though the README does not demo it, MAGE does support emitting types, 
> modules and assemblies directly into memory. This is how MAGIC is able to 
> live side-by-side with ClojureCLR. That said, the CLR compiler ecosystem is 
> very much oriented around files, so I do end up emitting to disk a lot 
> while developing MAGE and MAGIC to take advantage of disassemblers and 
> other tools.
>
> I would also be nice if the mage author would provide some tests
>
>
> More than happy to! Do you mean tests of MAGE in the repo? The most use it 
> gets is in the MAGIC project where it gets used and tested pretty 
> extensively: https://github.com/nasser/magic.
>
> I hope than answers some questions! If you're interested in this stuff 
> I've started documenting it in a dev blog over at http://nas.sr/magic/.
>
> Again, great work on insn and I am excited to see where it goes!
>
> R
>
>
> On Saturday, August 19, 2017 at 12:49:54 PM UTC-4, jgp...@gmail.com wrote:
>>
>> While I'm not as familiar with the CLR and its bytecode syntax, from what 
>> I can tell from the README, mage and insn seem to have similar goals and 
>> ideas.
>>
>> I'll attempt to summarize the differences that I could find, if the mage 
>> author *nasser* is available I would appreciate his or her 

Re: Using memory with futures

2017-09-07 Thread Andy Fingerhut
You can probably also avoid the 60- to 80-second wait if you call
(shutdown-agents) at the end of your program.

https://clojuredocs.org/clojure.core/future

Andy


On Thu, Sep 7, 2017 at 2:27 AM, Max Muranov  wrote:

> it takes about a minute for the pool to decide to shutdown the threads.
>>
>
> Yes, I tried to wait 80 seconds after each creating futures loop and
> everything was okay, thanks!
>
> In certain configurations, the JVM may never give the memory back the OS
>
>
> Oh, I suffered from this some time ago when used java library for ML. I
> thought it was bad library =D Can you please tell me what to learn about
> configs to avoid these problems?
>
> *Didier*, no that's not the case, I have enough time between creating
> futures in my program. But thanks for the link!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clojure@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+unsubscr...@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+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Why is the start function called -main

2017-09-07 Thread Cecil Westerhof
2017-09-07 7:09 GMT+02:00 Didier :

> Clojure is always launched from Java, there's no way to bootstrap straight
> into Clojure from the JVM. So when you launch the JVM, it always starts in
> a Java main method. What Clojure does normally, is that it creates the Java
> main method for you, and have it call your own main method.
>
> So it goes: JVM -> Java main method -> Clojure main function.
>
> What creates the Java main method for you is the (gen-class) macro. To
> know which of your Clojure function to have the Java main method it'll
> generate call, it uses a convention. This convention by default is that it
> will call the function named "-main". You can choose to change the "-" to
> any other prefix, but it is "-" by default. The convention forces you to
> have it end with "name", but lets you choose whatever prefix you want,
> which is "-" by default. I think you could set the prefix to "" and have
> your Clojure main function be called simply "main" if you want (never tried
> it though).
>
> Why is it prefixed?
>
> Well, the idea of having a prefix is that any Clojure function used for
> interop, in the sense that it is designed to be called from Java, is
> prefixed, so you can easily know its purpose is Java interop. So by
> default, all Clojure function prefixed with "-" can be assumed to be
> interop functions used by Java.
>

​Thanks. That makes sense.

-- 
Cecil Westerhof

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@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+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.