[ANN] New core.async release

655 views
Skip to first unread message

Timothy Baldridge

unread,
Apr 25, 2014, 9:12:56 AM4/25/14
to clo...@googlegroups.com
This morning I'm happy to announce the latest version of core.async: 0.1.295.0-9ea6ef-alpha

No new features to announce, but there are significant "under-the-hood" changes:

ClojureScript changes -
 * Fixed a bug where pending puts were not moved into buffer as items were taken from the buffer

Clojure (JVM) changes - 
 * go macro now uses tools.analyzer.jvm instead of a custom analyzer
 * better error messages due to the use of t.a.j. For example recurring through a try will now throw an error that makes sense to humans. 
 * only parts of the go macro that contain async ops will be transformed to the SSA form. This allows certain subsections of go blocks to run unmodified. 
 * line numbers of errors thrown inside go blocks is much better. Probably still some room for improvement, but it should work 99% of the time now, instead of not working at all. 

Although the core.async test suite passes, and I am unaware of any bugs created by this new go macro, I would love some feedback. So please try out this new library and run your test suites, if something breaks let me know. 

As the astute reader will notice, the go macro changes apply only to the Clojure go macro and not the ClojureScript macro. This is due to the fact that tools.analyzer.cljs doesn't exist yet. There is a GSOC project for this, once we have an analyzer for cljs that supports passes, I'll update the CLJS side of things as well.

Thanks!

Timothy Baldridge

pentaside

unread,
Apr 25, 2014, 10:58:02 AM4/25/14
to clo...@googlegroups.com
Cool!

BTW, is there an issue tracker? Maybe I'm doing something wrong, but I'm unable to get core.async running at all (MacOS and Linux):
https://github.com/tjg/core-async-bugreport

Has exception "java.io.FileNotFoundException: Could not locate clojure/tools/analyzer__init.class or clojure/tools/analyzer.clj on classpath:"

Thanks,
 Tj

Timothy Baldridge

unread,
Apr 25, 2014, 11:05:05 AM4/25/14
to clo...@googlegroups.com
There's a problem with the deployment process. It seems that the pom wasn't updated based on the changes I put into the project.clj file. Sorry for the mixup, I'll get a new version released once we update the pom. 

Timothy


--
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.



--
“One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.”
(Robert Firth)

Timothy Baldridge

unread,
Apr 25, 2014, 11:06:09 AM4/25/14
to clo...@googlegroups.com
In the mean time if you add this dependency to your project.clj file it should fix the errors: [org.clojure/tools.analyzer.jvm "0.1.0-beta12"] 

Timothy

Timothy Baldridge

unread,
Apr 25, 2014, 12:01:26 PM4/25/14
to clo...@googlegroups.com
The new (with fixed deps) version is out and available: 

core.async-0.1.298.0-2a82a1-alpha

Charles Duffy

unread,
Apr 25, 2014, 1:45:52 PM4/25/14
to clo...@googlegroups.com
The most interesting thing I've learned from this release is just how lenient old releases were in the face of erroneous code, of which I appear to have had rather a lot. :)

That said, I have found at least one behavior I'm not able to understand. This works perfectly with the new core.async:

(defn apply-prefix-to-txn [prefix in-txn]
  (vec (for [op in-txn] (assoc op 1 (vec (concat prefix (get op 1)))))))

(defn apply-prefix
  [in-chan prefix]
  (map< (partial apply-prefix-to-txn prefix) in-chan))

...but the definition below (which is, certainly, much worse code) results in a compile-time error:

(defn apply-prefix
  [in-chan prefix]
  (let [out-chan (chan)]
    (go
      (loop []
        (when-let [in-txn (<! in-chan)]
          (>! out-chan (vec (for [op in-txn] (assoc op 1 (vec (concat prefix (get op 1)))))))
          (recur))))))

...that being:

CompilerException java.lang.IllegalArgumentException: No method in multimethod '-item-to-ssa' for dispatch value: :fn, compiling:(/private/var/folders/hm/50_gxm6n4k3dbcqddkw3_btw0000gn/T/form-init2129308341681179922.clj:4:5) 

My expectation is that these should be equivalent. Is there something I'm missing here?

Timothy Baldridge

unread,
Apr 25, 2014, 4:30:05 PM4/25/14
to clo...@googlegroups.com
I've confirmed this as a bug, it's a problem with functions inside the body of a go when used along with an async op inside the body of a loop. Thanks for the report, I've fixed it in master, and once we get a bit more feedback, I'll create a new release. Should be out sometime in the next few days. 

Timothy


--
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.
Reply all
Reply to author
Forward
0 new messages