Help sought on issue with AOT, hadoop, classloaders, and consistency of Clojure fn classes

2015-01-28 Thread Jason Wolfe
First off, I apologize in advance for not having a reduced test case, and express my sincere gratitude in advance for any assistance. I've been tearing my hair out for a day or so and not making headway, and figured someone here might recognize some keywords and have a pointer in the right dir

Re: gofmt like tool for Clojure?

2015-01-28 Thread Lucas Bradstreet
This was released recently: https://github.com/weavejester/cljfmt On 29 January 2015 at 10:20, Papa Balyo wrote: > Greetings, > > Is there a tool that reads .clj(s) source file and prints it in canonical > fashion? (things like equal number of blank lines between forms, consistent > placement of

gofmt like tool for Clojure?

2015-01-28 Thread Papa Balyo
Greetings, Is there a tool that reads .clj(s) source file and prints it in canonical fashion? (things like equal number of blank lines between forms, consistent placement of arguments vector in defn, etc.) I use Cursive IDE and it does nice indentation, but it is not enough. Ideally I would li

Re: Clojurescript to target JVM?

2015-01-28 Thread Colin Fleming
Hi Adam, This is really interesting, thanks - at some point soon I'm going to be doing some performance work on Cursive, a large part of which is going to be trying to stop namespaces being loaded before they're required. This will be very useful - I'll steal your patch to log namespace loading, f

Re: Switched map for record and got slower

2015-01-28 Thread Mike Rodriguez
Sorry. That was a typo. I meant 1.8. I'm just referring to the version tagged on the Jira. -- 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 -

Re: Switched map for record and got slower

2015-01-28 Thread Fluid Dynamics
On Wednesday, January 28, 2015 at 3:30:08 PM UTC-5, Mike Rodriguez wrote: > > Another thing to note is if you were using these maps as keys to a > hash-based associative structure, like a hash map, then you be aware that > Clojure record do not cache their hash code like other Clojure persistent

Switched map for record and got slower

2015-01-28 Thread Mike Rodriguez
Another thing to note is if you were using these maps as keys to a hash-based associative structure, like a hash map, then you be aware that Clojure record do not cache their hash code like other Clojure persistent map impls do. I've had this eat up performance time in some scenarios before. Th

Re: Switched map for record and got slower

2015-01-28 Thread Alex Miller
On Wednesday, January 28, 2015 at 2:07:07 PM UTC-6, Fluid Dynamics wrote: > > On Wednesday, January 28, 2015 at 1:59:49 PM UTC-5, Marshall > Bockrath-Vandegrift wrote: >> >> At the very least, all the places where you switched to method/property >> syntax now require runtime reflection. Try lea

[ANN] edn-java 0.4.5 released

2015-01-28 Thread Ben Smith-Mannschott
edn-java [1] is a parser and printer for edn [2]. This release: * Incorporates a patch from 'redahe' to fix issue 40 where < and > were not recognized as symbols. [3] It is available on Maven central as I write this. [1] http://edn-java.bpsm.us [2] https://github.com/edn-format/edn [3]

Re: Switched map for record and got slower

2015-01-28 Thread Fluid Dynamics
On Wednesday, January 28, 2015 at 1:59:49 PM UTC-5, Marshall Bockrath-Vandegrift wrote: > > At the very least, all the places where you switched to method/property > syntax now require runtime reflection. Try leaving those as they were, or > switching to using the keyword as the function (which

Re: Switched map for record and got slower

2015-01-28 Thread Marshall Bockrath-Vandegrift
At the very least, all the places where you switched to method/property syntax now require runtime reflection. Try leaving those as they were, or switching to using the keyword as the function (which is somewhat more idiomatic). You could instead hint the appropriate object type in each functi

Re: ANN: ClojureScript 0.0-2740, Windows

2015-01-28 Thread Ole Krüger
Perfect, this is what I've been waiting for. Great to see that Windows bugs are getting fixed. On Wednesday, January 28, 2015 at 2:54:42 PM UTC+1, David Nolen wrote: > > ClojureScript, the Clojure compiler that emits JavaScript source code. > > README and source code: https://github.com/clojure/c

Switched map for record and got slower

2015-01-28 Thread Pedro Pereira Santos
Hello, I have a vector with ~20 elements that don't change. They are basically metadata information that are used on the application. Those 20 elements are maps, and I gathered them like: (defn units [] [unit1 unit2 ...]) I created a record and changed the gathering to: (defn units [] (ma

Re: Java Agent Based Modeling Systems and Clojure

2015-01-28 Thread Mars0i
Fred, This is an old thread, but did you end up using Repast, Mason, or another Java library with Clojure? I've been doing agent-based modeling in NetLogo and pure Clojure separately, but would be interested in exploring a more integrated approach. I have written a proof-of-concept NetLogo

Re: Resources don't work in uberjar

2015-01-28 Thread Dan Harbin
After perusing stackoverflow, it's evident to me that the "proper" way to access a file within a jar is to use getResourceAsStream (as was mentioned in the thread above, thank you), and I suppose clojure's io/input-stream does the trick as well. Thanks, all! -- You received this message bec

Re: Resources don't work in uberjar

2015-01-28 Thread Dan Harbin
It seems my problem is related to this line in io.clj: https://github.com/clojure/clojure/blob/f437b853adeaffc5cad9bb1e01e2355357a492c9/src/clj/clojure/java/io.clj#L60 (if (= "file" (.getProtocol u)) (as-file (escaped-utf8-urlstring->str (.replace (.getFile u) \/ File/se

Re: Resources don't work in uberjar

2015-01-28 Thread Dan Harbin
Here's my goal: I have a thread that listens on a channel for tuples of [file-path, file-contents] and writes files to a zip file using clojure.java.io/copy. It's been really nice to be able to specify file-contents as anything clojure.java.io/copy can consume, such as a byte[] or a String, and

Re: Clojurescript to target JVM?

2015-01-28 Thread Adam Clements
I'm currently using the fastload branch against alpha5, and it's pretty good. You have to be careful though with namespace declarations as you may end up loading more than you need to. I'm currently in the process of breaking my app down into "runlevels", where it loads the minimum needed to get st

Re: Resources don't work in uberjar

2015-01-28 Thread Jeroen van Dijk
I'm not sure anymore what your goal is exactly, but here is what I meant to be complete: (defn -main "I don't do a whole lot ... yet." [& args] (->> "hi.txt" io/resource slurp (spit "out.txt"))) On Wed, Jan 28, 2015 at 4:57 PM, Dan Harbin wrote: > Marshall, > > If I remove io/file, I get: > > E

Re: Clojurescript to target JVM?

2015-01-28 Thread Ashton Kemerling
A lot of the slowness in Clojure comes down to how slow it is to load the main namespaces that are needed, especially clojure.core (see this post ). You should also look into the Clojure fastload branch, which apparently

Re: Resources don't work in uberjar

2015-01-28 Thread Dan Harbin
Marshall, If I remove io/file, I get: Exception in thread "main" java.lang.IllegalArgumentException: No method in multimethod 'do-copy' for dispatch value: [java.net.URL java.io.OutputStreamWriter] at clojure.lang.MultiFn.getFn(MultiFn.java:160) at clojure.lang.MultiFn.invoke(Mu

Re: Clojurescript :advanced compilation extern only partly working.

2015-01-28 Thread David Nolen
Run a `lein deps :tree` to compare the version of the Google Closure Compiler you are getting. David On Wed, Jan 28, 2015 at 9:58 AM, Crispin Wellington < retrogradeor...@gmail.com> wrote: > OK something very strange is going on. I tried the let block, and it was > the same in my project. > > So

Re: Clojurescript :advanced compilation extern only partly working.

2015-01-28 Thread Crispin Wellington
OK something very strange is going on. I tried the let block, and it was the same in my project. So I created a new minimal project, lein new mies test-sound, and made a minimal test: https://github.com/retrogradeorbit/test-sound And here it works! Go back to my old project, and it doesn't.

Re: ANN: ClojureScript 0.0-2740, Windows

2015-01-28 Thread Ivan L
Thanks David, the Windows love is much much appreciated. On Wednesday, January 28, 2015 at 8:54:42 AM UTC-5, David Nolen wrote: > > ClojureScript, the Clojure compiler that emits JavaScript source code. > > README and source code: https://github.com/clojure/clojurescript > > New release version: 0

Re: Clojurescript :advanced compilation extern only partly working.

2015-01-28 Thread David Nolen
I mentioned trying this in a `let` binding instead. What happens when you try that? David On Wed, Jan 28, 2015 at 9:04 AM, Crispin Wellington < retrogradeor...@gmail.com> wrote: > No, that's not it. So I tried: > > (def audio-context (js/AudioContext.)) > (.decodeAudioData audio-context (js/Arra

Re: Clojurescript :advanced compilation extern only partly working.

2015-01-28 Thread Crispin Wellington
No, that's not it. So I tried: (def audio-context (js/AudioContext.)) (.decodeAudioData audio-context (js/ArrayBuffer. 256) #(println "ok" %) #(println "error" %)) and it compiled to: ;var zv = new AudioContext; zv.Rd(new ArrayBuffer(256), function(a) { return fo.c(mh(["ok", a], 0)); }, funct

ANN: ClojureScript 0.0-2740, Windows

2015-01-28 Thread David Nolen
ClojureScript, the Clojure compiler that emits JavaScript source code. README and source code: https://github.com/clojure/clojurescript New release version: 0.0-2740 Leiningen dependency information: [org.clojure/clojurescript "0.0-2740"] The primary reason for this release is to bring all

Re: alternatives to component (like) systems

2015-01-28 Thread Jony Hudson
You don't need a global reference that lives in your code to be able to interact with the scheduler at the REPL. I'd do it by breaking stuff into more bits - it looks convoluted for this simple example, but hopefully the idea makes sense: (defn make-scheduler [] (qs/initialize)) (defn start-sc

Re: Clojurescript :advanced compilation extern only partly working.

2015-01-28 Thread Thomas Heller
I just have a guess for you. AudioContext.decodeAudioData parameters are declared as ArrayBuffer, Function, Function but you are passing "data" which is a String not an ArrayBuffer. Maybe the type inference thinks you are calling a method that is not defined in the externs? Maybe it will work