Re: Clojure: Elegance vs. Performance?

2013-07-10 Thread Mikera
Hi Colin, with-local-vars sadly doesn't actually create local variables on the stack - it creates regular Clojure vars. Which is great for many uses, but they still come with performance overhead (extra level of indirection, boxing etc.). You need the compiler to actually produce the right low-

Re: matrix: masked arrays

2013-07-10 Thread Mikera
You could use ereduce (elementwise reduce) in core.matrix to do this. Something like: (let [NaN Double/NaN [sum n] (ereduce (fn [[acc cnt] x] (if (Double/isNaN x) [acc cnt] [(+ acc x) (inc cnt)])) [0 0] [0.0 1.0 NaN 2.0 NaN 3.0 4.

Re: [ANN] Pedestal-app Tutorial has been released

2013-07-10 Thread CA
Awesome!! On Tuesday, July 9, 2013 6:03:58 PM UTC+2, Ryan Neufeld wrote: > > Hey there, Clojurians/Pedestallions! > > I'm pleased to announce the release of a comprehensive tutorial for > pedestal-app: http://bit.ly/pedestal-app-tutorial. In this tutorial we > finally *dive deep* into the guts

Re: Clojure: Elegance vs. Performance?

2013-07-10 Thread MikeM
> > Clojure people say that jvm doesn't support tco, which it doesn't. So > they implemented a recur macro that turns the function into an > explicitly tcoable function. But, take a look at scala. It can do > (naive) tco optimization without any extra effort from the developer. > And on other

Re: core.async pub/sub

2013-07-10 Thread Alex Miller
There is a broadcast fn in the lab namespace (https://github.com/clojure/core.async/blob/master/src/main/clojure/clojure/core/async/lab.clj) that does this and I believe David Nolen has created a different variant in some of his stuff. The lab one is experimental and would welcome feedback on

[ANN] CHP Web Framework Documentation Update

2013-07-10 Thread Kelker Ryan
ClojureHomePage is a Clojure Web Framework CHTML, Routing, and Sessions CHTML & RoutesSession handling, Cookies, and Compojure Ring Ring and port configurationAuto-loading middleware Code Generation & Modules Generating views from a tableView bindingsView bindings ExampleEnable admin accountDatabas

Re: Clojure: Elegance vs. Performance?

2013-07-10 Thread Meikel Brandmeyer (kotarak)
Hi, Am Mittwoch, 10. Juli 2013 11:49:35 UTC+2 schrieb MikeM: > > > Are clojure designers just lazy or is >> there a good reason for this .. lie? >> >> > SISC has its own stack, so it doesn't do TCO within the jvm. There's a > significant performance impact from this choice. > Having it's own s

Re: Clojure: Elegance vs. Performance?

2013-07-10 Thread Colin Fleming
> > I remain convinced that the solution is better compile-time inference: if > the compiler can infer that a var is never used dynamically, why should we > pay the overhead for extra indirection / dynamic features? The answer to this appears to be the REPL - if the compiler goes ahead and infers

Re: Doc about auto-namespaced keywords (e.g. ::user)?

2013-07-10 Thread Chas Emerick
Hi Bastien, We talked about namespaced keywords in 'Clojure Programming'. A brief introduction to them can be found on page 14, which you can get for free @ http://clojurebook.com (look for the "first chapter" link on the right). They're used for more than e.g. unambiguously keying slots in a

Re: Clojure: Elegance vs. Performance?

2013-07-10 Thread Mark Engelberg
On Tue, Jul 9, 2013 at 11:39 PM, Mats Rauhala wrote: > Clojure people say that jvm doesn't support tco, which it doesn't. So > they implemented a recur macro that turns the function into an > explicitly tcoable function. But, take a look at scala. It can do > (naive) tco optimization without any e

Re: Doc about auto-namespaced keywords (e.g. ::user)?

2013-07-10 Thread Bastien Guerry
Hi John, John Gabriele writes: > They're mentioned in , though that doesn't > say anything about why or in what cases you'd use them. Thanks for the pointer. In the meantime I found this (quite old) blog post: http://kotka.de/blog/2010/05/Did_you_know_III.html and I

#|| notation for the Clojure reader

2013-07-10 Thread Pierre Allix
Hello, I'm using a Clojure library which generates symbols of the form a/b/1. They are symbols representing URI. These symbols cannot be serialized as strings and read back with read-string. a) the symbol function does not validate its inputs. It was discussed here https://groups.google.com

Re: [ANN] CHP Web Framework Documentation Update

2013-07-10 Thread Steven Degutis
Wow. You obviously put a lot of work into this. And it looks extremely well documented! On Wed, Jul 10, 2013 at 5:36 AM, Kelker Ryan wrote: > ClojureHomePage is a Clojure Web Framework > > > > *CHTML, Routing, and Sessions * > >- CHTML & Routes

[ANN] First release of Prismatic's hiphip (array) library

2013-07-10 Thread Jason Wolfe
We're excited to announce our first release of hiphip (array), a library for simple, performant array manipulation in Clojure. http://blog.getprismatic.com/blog/2013/7/10/introducing-hiphip-array-fast-and-flexible-numerical-computation-in-clojure Github: https://github.com/Prismatic/hiphip Than

Re: #|| notation for the Clojure reader

2013-07-10 Thread Dan Cross
On Wed, Jul 10, 2013 at 12:51 PM, Pierre Allix wrote: > [snip] > b) there was a proposal to implement a reader macro with a pipe notation ( e.g. > #|symbol with whitespace|) as in Common Lisp. > This would allow to read back symbols which don't follow the naming rules. > Just a nit: this isn't ex

Re: [ANN] Pedestal-app Tutorial has been released

2013-07-10 Thread Ryan Neufeld
Hey thanks Michael, I made the link quite a bit bigger. In terms of linking directly to the wiki: we want to keep one level of indirection for when we move the tutorial to home more flexible than a GitHub wiki. Thanks for the feedback. On Tuesday, July 9, 2013 12:58:16 PM UTC-4, Michael Klishi

test run startup time

2013-07-10 Thread Brian Craft
The clojure start-up time is killing me, while working in a tight edit-test-edit development loop. Is there any way to speed this up? E.g. could the edited code be dynamically loaded, and the test suites run w/o restarting the jvm? I have previously experimented with nailgun for starting the re

Re: test run startup time

2013-07-10 Thread Gary Trakhman
Real work is done with a repl embedded into a text editor with live eval. Running tests is just a function call away, clojure.test/run-tests. Here's a modern starting point: http://thinkrelevance.com/blog/2013/06/04/clojure-workflow-reloaded On Wed, Jul 10, 2013 at 1:36 PM, Brian Craft wrote:

Re: test run startup time

2013-07-10 Thread Jim - FooBar();
On 10/07/13 18:36, Brian Craft wrote: The clojure start-up time is killing me, while working in a tight edit-test-edit development loop. Is there any way to speed this up? E.g. could the edited code be dynamically loaded, and the test suites run w/o restarting the jvm? of course you can! that

Re: [ANN] First release of Prismatic's hiphip (array) library

2013-07-10 Thread Jim - FooBar();
great news! :) I think there is something missing from the readme on github though...in section "Performance: know your options" there is nothing showing what one should put in his project.clj to avoid tierred compilation. I'm guessing a simple markup issue... Jim On 10/07/13 18:13, Jason

Re: test run startup time

2013-07-10 Thread Jay Fields
There are significantly more productive ways to work, but they'll require you to know your environment well. I work in emacs with 2 repls running - 1 for running my app and 1 for running my tests. I use emacs-live[1], the unplugged-pack[2], & expectations[3] for my tests. In emacs 'switch projects

Damballa is hiring

2013-07-10 Thread Marshall Bockrath-Vandegrift
Damballa is currently hiring software engineers and scientists for our Research & Development (R&D) team. Damballa’s network appliances analyze network traffic for evidence of malware and advanced threat infections which have circumvented our customer’s preventative solutions. On the R&D team, we

Re: ClassCastException in APersistentVector.doEquiv with custom implementation of IPersistentVector

2013-07-10 Thread Vincent
I guess I can proxy APersistentVector, but the Clojure docs [1] advise to use reify in favour to proxy whenever possible. My goal is to have my byte stream behave like a standard Clojure vector. (Parts of that stream also represent maps, and I'd like to do the same without loading them into Clo

Re: Clojure: Elegance vs. Performance?

2013-07-10 Thread Stefan Kamphausen
> The Clojure philosophy is that it is rather irritating to think your > recursive call is going to be cleverly optimized into a loop, and then if > you're wrong, you have no good way to know that. So the idea is that you > use the word "recur" to indicate that *you* think it can be optimized

Re: test run startup time

2013-07-10 Thread Brian Marick
On Jul 10, 2013, at 12:36 PM, Brian Craft wrote: > The clojure start-up time is killing me, while working in a tight > edit-test-edit development loop. Is there any way to speed this up? I use autotest in a running repl. A screenshot and description about 2/3 of the way down this: https://g

cljx 0.3.0 released

2013-07-10 Thread Chas Emerick
Earlier today, we released [com.keminglabs/cljx "0.3.0"], which brings a bunch of significant changes and improvements: https://github.com/lynaghk/cljx Existing users should review the changelog entry, as this is a breaking release: https://github.com/lynaghk/cljx/blob/master/CH

Re: [ClojureScript] cljx 0.3.0 released

2013-07-10 Thread Giacomo Cosenza
Thanks Chas! This is really a good news for the things I'm doing right now. I'll update my stuff in a short time. My best Mimmo On Jul 10, 2013, at 8:26 PM, Chas Emerick wrote: > Earlier today, we released [com.keminglabs/cljx "0.3.0"], which brings a > bunch of significant changes and impro

Re: [ANN] First release of Prismatic's hiphip (array) library

2013-07-10 Thread Jason Wolfe
Fixed, thanks for the heads up! -Jason On Wednesday, July 10, 2013 10:49:19 AM UTC-7, Jim foo.bar wrote: > > great news! :) > > I think there is something missing from the readme on github though...in > section "Performance: know your options" there is nothing showing what > one should put in

Atom for vector of vectors (100 million) and a way to wrap around them?

2013-07-10 Thread Joseph Guhlin
Hello, I'm using clojure to create a database from various files. Because the database in batch insert mode is single threaded I am using an agent to handle communications with the database. Creating a node in the database doesn't have any dependencies, and I return a promise and deliver it in t

Re: [ANN] CHP Web Framework Documentation Update

2013-07-10 Thread Kelker Ryan
Thanks. It's currently alpha and there's a lot more to come. Are you by chance the same Degutis from 8th light? 11.07.2013, 02:12, "Steven Degutis" :Wow. You obviously put a lot of work into this. And it looks extremely well documented!On Wed, Jul 10, 2013 at 5:36 AM, Kelker Ryan

Re: matrix: masked arrays

2013-07-10 Thread Brian Craft
Cool, thanks. I had to change the return value to catch the all-NaN case: (cond (= 0 n) NaN :else (/ sum n)) On Wednesday, July 10, 2013 12:58:54 AM UTC-7, Mikera wrote: > > You could use ereduce (elementwise reduce) in core.matrix to do this. > Something like: > > (let [NaN Double/NaN >

matrix data types

2013-07-10 Thread Brian Craft
How are data types handled in core.matrix? I was surprised to see it returning rationals rather than floats. I don't see a way to control this in the api, e.g. like dtype in numpy. (element-type) is returning java.lang.Object for all inputs. Does this mean I'm creating arrays of clojure's wrapp

Re: matrix data types

2013-07-10 Thread Brian Craft
Trying to add vectorz, I'm getting this run-time error: java.lang.RuntimeException: Unable to find implementation: [:vectorz] It's in my project.clj. Is there some other magic I need to perform? On Wednesday, July 10, 2013 2:06:31 PM UTC-7, Brian Craft wrote: > > How are data types handled in c

Re: ClassCastException in APersistentVector.doEquiv with custom implementation of IPersistentVector

2013-07-10 Thread Cedric Greevey
If Clojure's code assumes IPersistentVectors to be Collections, why doesn't IPersistentVector extend Collection? I'd consider that to be a bug. On Wed, Jul 10, 2013 at 2:00 PM, Vincent wrote: > I guess I can proxy APersistentVector, but the Clojure docs [1] advise to > use reify in favour to pr

Re: ClassCastException in APersistentVector.doEquiv with custom implementation of IPersistentVector

2013-07-10 Thread Gary Trakhman
For reference, here's another vector implementation: https://github.com/clojure/clojure/blob/master/src/clj/clojure/gvec.clj On Wed, Jul 10, 2013 at 6:39 PM, Cedric Greevey wrote: > If Clojure's code assumes IPersistentVectors to be Collections, why > doesn't IPersistentVector extend Collection

vectorz doesn't handle scalars?

2013-07-10 Thread Brian Craft
Without vectorz: => (+ 5 (matrix [1 2 3])) [6 7 8] With vectorz: => (+ 5 (matrix [1 2 3])) ClassCastException java.lang.Double cannot be cast to mikera.arrayz.INDArray mikera.vectorz.matrix-api/eval12140/fn--12145 (matrix_api.clj:644) -- -- You received this message because you are subsc

Re: vectorz doesn't handle scalars?

2013-07-10 Thread Mikera
Hmmm it seems to work for me: (+ 5 (matrix [1 2 3])) => # What environment and what versions of vectorz-clj / Clojure are you using? Some of the older versions didn't support scalar to vector broadcasting so that might be the problem On Thursday, 11 July 2013 00:44:46 UTC+1, Brian Craft wr

Re: matrix data types

2013-07-10 Thread Mikera
Element types are dependent on the implementation. Some implementations support arbitrary (Object) data types - this includes the default implementation that supports Clojure persistent vectors, e.g. [1 nil :foo] is a valid vector. Mathematical operations on such vectors use standard functions

Re: vectorz doesn't handle scalars?

2013-07-10 Thread Brian Craft
[org.clojure/clojure "1.5.1"] [net.mikera/core.matrix "0.8.0"] [net.mikera/vectorz-clj "0.10.0"] On Wednesday, July 10, 2013 5:40:41 PM UTC-7, Mikera wrote: > > Hmmm it seems to work for me: > > (+ 5 (matrix [1 2 3])) > => # > > What environment and what versions of vectorz-clj / Clojure are you

Documentation / usage --- Array vs. Vector

2013-07-10 Thread vrakade
I see that Lists and Vectors are similar, but have different uses and for logical reasons. My question may be more about language of datatypes in Clojure than usage. Is it appropriate to use the term Array and Vector interchangeably when writing documentation about Clojure/EDN for non-Clojure p

Re: edn-format parsers (eg, Common Lisp)?

2013-07-10 Thread vrakade
This is an aside, but I wanted to add about translations... An EDN "generator" is somewhat redundant from Clojure, but I usually use fipp for standard formatting: https://github.com/brandonbloom/fipp Also clj-yaml for YAML output, and Chesire or data.json for JSON. (Note data.json has trouble w

Re: vectorz doesn't handle scalars?

2013-07-10 Thread vrakade
Confirmed: % cat project.clj (defproject abc "0.1.0-SNAPSHOT" :dependencies [ [org.clojure/clojure "1.5.1"] [net.mikera/core.matrix "0.8.0"] [net.mikera/vectorz-clj "0.10.0"]]) % lein ancient [..none..] % lein repl user=> (u

Re: edn-format parsers (eg, Common Lisp)?

2013-07-10 Thread Colin Fleming
Thanks for the pointer to fipp, that actually looks like just what I need! Fantastic. On 11 July 2013 13:58, wrote: > This is an aside, but I wanted to add about translations... > > An EDN "generator" is somewhat redundant from Clojure, but I usually use > fipp for standard formatting: https://

Re: vectorz doesn't handle scalars?

2013-07-10 Thread Brian Craft
I've tried a few other versions, all without success. What versions are you using? On Wednesday, July 10, 2013 5:40:41 PM UTC-7, Mikera wrote: > > Hmmm it seems to work for me: > > (+ 5 (matrix [1 2 3])) > => # > > What environment and what versions of vectorz-clj / Clojure are you using? > Some

Clojure: Superset of XML, HTML, CSS, JavaScript, Flash (SVG/ActionScript), etc.?

2013-07-10 Thread Alexander Gunnarson
This idea's been on my mind lately: could Clojure be used as a unifying force for all those disparate file formats and frameworks like: - XML / XLink / XPointer / XQuery, - JSON, - HTML / XHTML, - CSS, - JavaScript / jQuery, - Flash (SVG/ActionScript), - SQL, - and (of course) Java? As a disclaim

Possible to add dependency within leiningen plugin dynamically?

2013-07-10 Thread Chris Kuttruff
Eg: I have a leiningen plugin I'm building that calls some jdbc stuff, but the specific driver would be specified in the project that brings in my plugin as a dependency. Would this be possible? If so, how would I go about it? Was looking into leinjacker, but having trouble accomplishing wha