Re: [cider-emacs] [ANN] CIDER 0.7 is out!

2014-08-06 Thread Bastien
Bozhidar Batsov writes: > CIDER 0.7.0 is finally out! I wrote a short blog post about it, as > the release is quite massive and important: > > http://batsov.com/articles/2014/08/05/cider-0-dot-7/ Well done! And thanks again, -- Bastien -- You received this message because you are subscribe

Re: Clojure 1.7 and invokeStatic

2014-08-06 Thread Alex Miller
No flame war here, just healthy discussion. :) I don't mean to over-state the benefit; I have not yet found a program where var invocation was actually the bottleneck and in general a lot of these differences are noise compared to the real meat of the code. On Wednesday, August 6, 2014 7:13:01

Re: [ANN] Silk, an isomorphic routing library for Clojure and ClojureScript

2014-08-06 Thread Joel Holdbrooks
> Bidirectional routes are indeed especially important to render and dispatch > routes in Om etc. In secretary its a bit awkward since you have to write > stuff like (defroute front-page "/" [] :front-page) and then a separate > thingie for matching the keywords back to the routes. We have writ

Re: Clojure 1.7 and invokeStatic

2014-08-06 Thread Mike Thvedt
I didn't want to start a flame war, I just didn't want people being misled into thinking static vars are a big perf improvement for most code. It's better do use ordinary dynamic vars unless you're sure it will be beneficial for some tight loop somewhere. The usual case is the JIT inlines the v

Re: [ANN] Silk, an isomorphic routing library for Clojure and ClojureScript

2014-08-06 Thread whodidthis
Very nice one, Dom. Bidirectional routes are indeed especially important to render and dispatch routes in Om etc. In secretary its a bit awkward since you have to write stuff like (defroute front-page "/" [] :front-page) and then a separate thingie for matching the keywords back to the routes.

Re: Transducers are Coming

2014-08-06 Thread Jozef Wagner
Thank you for another great technique and concept!. I've been using reducers a lot lately and I've found that it is in some cases better (performance, fold support) to wrap local state in the intermediate result, rather than to keep it in an atom. See this *very* simplified example for compari

Re: [ANN] Silk, an isomorphic routing library for Clojure and ClojureScript

2014-08-06 Thread Craig
Hi Dom, Thanks! The comparison is much appreciated, as is the contribution to the community. regards, Craig On Wednesday, August 6, 2014 6:27:44 PM UTC+10, DomKM wrote: > > Hi Craig, > > Great question! Bidi is a fantastic > library and was my favorite Clojure ro

Re: Transducers are Coming

2014-08-06 Thread Ben Wolfson
if I'm reading the source correctly, ((partial map f) something) and ((map f) something) are completely different, yes? On Wed, Aug 6, 2014 at 1:13 PM, Alex Miller wrote: > > > On Wednesday, August 6, 2014 2:20:38 PM UTC-5, Robin Heggelund Hansen > wrote: >> >> I just want to check that I under

Re: Transducers are Coming

2014-08-06 Thread Alex Miller
On Wednesday, August 6, 2014 2:20:38 PM UTC-5, Robin Heggelund Hansen wrote: > > I just want to check that I understand this. Instead of returning and > manipulating lazy-seqs, you compose functions > yes > (sort of like they way you would in Haskell?) > > which return reqular seqs (non-

Re: Clojure 1.7 and invokeStatic

2014-08-06 Thread Alex Miller
I've compared the hotspot inlining on current vars through volatile reference, lazy vars ala fastload branch, and static calls ala direct branch and indeed the inlining is affected once things get hot. fastload avoids early loads but is ultimately slower. direct is about twice as fast due (I th

[ANN] core.async 0.1.319.0-6b1aca-alpha

2014-08-06 Thread Alex Miller
core.async 0.1.319.0-6b1aca-alpha (catchy right?) is now available. Try it via - Download: http://central.maven.org/maven2/org/clojure/core.async/0.1.319.0-6b1aca-alpha/ - Or securely: https://repo1.maven.org/maven2/org/clojure/core.async/0.1.319.0-6b1aca-alpha/ - Leiningen: [org.clojure/core.asyn

Re: Clojure 1.7 and invokeStatic

2014-08-06 Thread Gary Trakhman
I think that also implies that the JVM can't inline across the fences, so there's another cost. On Wed, Aug 6, 2014 at 3:42 PM, Mike Thvedt wrote: > I don't want to question your microbenchmarks, but I'm not sure you have > the correct interpretation. > > Read memory fences have little to no co

Re: Clojure 1.7 and invokeStatic

2014-08-06 Thread Mike Thvedt
I don't want to question your microbenchmarks, but I'm not sure you have the correct interpretation. Read memory fences have little to no cost. In particular, read memory fences are a no-op (literally) on x86 unless the cache line is invalidated. On Wednesday, August 6, 2014 5:54:32 AM UTC-5, R

Re: Clojure 1.7 and invokeStatic

2014-08-06 Thread Ghadi Shayban
Var indirection is not super cheap, as it has a volatile field, which is a memory fence. I have been working on Clojure with invokedynamic, and I have a demonstrable improvement on microbenchmarks. Obviously your application will have IO and myriad other costs, but I just want to echo that it

Re: Transducers are Coming

2014-08-06 Thread Robin Heggelund Hansen
I just want to check that I understand this. Instead of returning and manipulating lazy-seqs, you compose functions (sort of like they way you would in Haskell?) which return reqular seqs (non-lazy). So I guess the upside is more flexibility, but you get eager-evaluation. Or am I misunderstandi

[ANN] Clojure 1.7.0-alpha1

2014-08-06 Thread Alex Miller
Clojure 1.7.0-alpha1 is now available. Try it via - Download: http://central.maven.org/maven2/org/clojure/clojure/1.7.0-alpha1/ - Download securely: https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-alpha1/ :) - Leiningen: [org.clojure/clojure "1.7.0-alpha1"] Clojure 1.7.0-alpha1 has the

Re: Clojure 1.7 and invokeStatic

2014-08-06 Thread Mike Thvedt
Last sentence should be: "I've replaced vars with Java methods in some high-performance cases and found a 0% speedup." On Wednesday, August 6, 2014 5:54:32 AM UTC-5, Robin Heggelund Hansen wrote: > > Just read this blog post about Oxen ( > http://arrdem.com/2014/08/05/of_oxen,_carts_and_ordering/

Re: Clojure 1.7 and invokeStatic

2014-08-06 Thread Mike Thvedt
It's worth pointing out that var indirection is already cheap in Java--it is generally dominated by IO, memory access, object construction, dynamic dispatch... The JIT compiler will inline any var access if the var doesn't visibly change, and only needs to check one word of memory per var each

Re: Clojure 1.7 and invokeStatic

2014-08-06 Thread Robin Heggelund Hansen
Perfect explination, thanks! kl. 20:41:56 UTC+2 onsdag 6. august 2014 skrev Reid McKenzie følgende: > > Functions are objects implementing the IFn interface. This interface > defines a set of methods named "invoke" which return an object given up to > 21 arguments. Once the compiler is done em

Re: Clojure 1.7 and invokeStatic

2014-08-06 Thread Reid McKenzie
Functions are objects implementing the IFn interface. This interface defines a set of methods named "invoke" which return an object given up to 21 arguments. Once the compiler is done emitting any given function, an IFn object has been created. Def is a general operation which creates a value and

Re: Friend authentication with static files

2014-08-06 Thread Gary Verhaegen
What do you expect will be different from any other type of handler? What kind of granularity do you want to provide? On 5 August 2014 20:42, Jonathon McKitrick wrote: > I'm working on a singe-page web app, and each page comes from a file in > "public" rather than being generated by a compojure r

Transducers are Coming

2014-08-06 Thread Rich Hickey
I pushed today the initial work on transducers. I describe transducers briefly in this blog post: http://blog.cognitect.com/blog/2014/8/6/transducers-are-coming This work builds on the work done for reducers, bringing context-independent mapping, filtering etc to other areas, such as core.async

Re: GPU computing on core.matrix implementation

2014-08-06 Thread Mikera
Sounds like a great project, would be really great to have a core.matrix implementation running on the GPU! I'm not too familiar with aparapi. Since core.matrix uses fairly well-defined operations, it might be simpler to code the key ones directly in OpenCL rather than going via Java bytecode t

Re: Cannot get Friend to work (login or unauthorized handler)

2014-08-06 Thread Nelson Morris
The ordering of middleware is certainly causing some problems. From https://github.com/cemerick/friend#authentication: "Note that Friend itself requires some core Ring middlewares: params, keyword-params and nested-params". These are added as part of `handler/site`, and so that needs to be outsid

Re: Cannot get Friend to work (login or unauthorized handler)

2014-08-06 Thread Gary Verhaegen
I just checked, with the given code, after I switch the order of middlewares, a POST to /login gives me a 302 redirect to /login?&login_failed=Y while a POST with the correct credentials gives me a 303 to /. I'm sorry I cannot explain why, however. On Wednesday, 6 August 2014, Gary Verhaegen wro

Re: Cannot get Friend to work (login or unauthorized handler)

2014-08-06 Thread Gary Verhaegen
I was wrong, sorry. Looking at the code for c.f.workflows/interactive-form, you can indeed see where it intercepts a POST request to the provided :login-uri (lines 84-85 on current master). Which means I have absolutely no idea why it gives you a 404, except maybe if it is related to the other poi

Re: [ClojureScript] Re: [ANN] Silk, an isomorphic routing library for Clojure and ClojureScript

2014-08-06 Thread Joel Holdbrooks
Dom, We’re actually well aware of many of the flaws you have pointed out with Secretary. In fact, we even have open issues for some of them. > While I value all of these features that Secretary lacks, I think that last > one, impurity, is the most significant... Mutation is always possible, but

Re: Clojure 1.7 and invokeStatic

2014-08-06 Thread Robin Heggelund Hansen
Don't understand the compiler that well. Could you provide a short description of what is being done? kl. 13:05:40 UTC+2 onsdag 6. august 2014 skrev Jozef Wagner følgende: > > See this WIP branch https://github.com/clojure/clojure/tree/direct > > On Wednesday, August 6, 2014 12:54:32 PM UTC+2, Ro

Re: Cannot get Friend to work (login or unauthorized handler)

2014-08-06 Thread Jonathon McKitrick
I'm confused. None of the examples shown implemented the login POST handler. The docs implied it was already part of the middleware: >From https://github.com/cemerick/friend : >>> The example above defines a single workflow -- one supporting the POSTing of :username and :password parameters to (

Re: Cannot get Friend to work (login or unauthorized handler)

2014-08-06 Thread Gary Verhaegen
1. No, you have to provide it (as a non-protected route, obviously). 2. The order in which you apply the handler/site and friend/authenticate middlewares is reversed: friend needs the session (and others), so it should come "after" (or rather "within") the handler/site to work properly (in executio

Re: Cursive Plugin java integration

2014-08-06 Thread Bryan Hoyle
Darn, that's a shame. Thanks for the info and thanks for all the work on the project so far. On Wednesday, August 6, 2014 4:29:34 AM UTC-4, Colin Fleming wrote: > > Hi Bryan, > > Unfortunately this is a known issue right now, not all classes generated > from Clojure forms are represented by clas

Re: Create an instance of a record using a string to define the record's symbol

2014-08-06 Thread Colin Yates
Thanks both. On Wednesday, 6 August 2014 12:02:59 UTC+1, Ambrose Bonnaire-Sergeant wrote: > > The `new` reader macro must resolve its first argument at compile time. > > That's why (new (symbol s)) doesn't work. > > Thanks, > Ambrose > > > On Wed, Aug 6, 2014 at 6:55 PM, Colin Yates > wrote: > >>

Cannot get Friend to work (login or unauthorized handler)

2014-08-06 Thread Jonathon McKitrick
First, the code: (ns pts.server (:use [compojure.core]) (:require [ring.adapter.jetty :as jetty] [ring.util.response :as response] [compojure.handler :as handler] [compojure.route :as route] [cemerick.friend :as friend] (cemerick.frie

Re: Clojure 1.7 and invokeStatic

2014-08-06 Thread Jozef Wagner
See this WIP branch https://github.com/clojure/clojure/tree/direct On Wednesday, August 6, 2014 12:54:32 PM UTC+2, Robin Heggelund Hansen wrote: > > Just read this blog post about Oxen ( > http://arrdem.com/2014/08/05/of_oxen,_carts_and_ordering/?utm_source=dlvr.it&utm_medium=twitter). > > In i

Re: Create an instance of a record using a string to define the record's symbol

2014-08-06 Thread Ambrose Bonnaire-Sergeant
The `new` reader macro must resolve its first argument at compile time. That's why (new (symbol s)) doesn't work. Thanks, Ambrose On Wed, Aug 6, 2014 at 6:55 PM, Colin Yates wrote: > Ah OK, I didn't realise I needed to get into Java interop. > > For education - can you (or anyone) explain me

Re: Create an instance of a record using a string to define the record's symbol

2014-08-06 Thread Jozef Wagner
You can use record's positional constructor: user> (defrecord R [a]) user.R user> ((find-var (symbol "user/->R")) 5) #user.R{:a 5} JW On Wednesday, August 6, 2014 12:51:11 PM UTC+2, Ambrose Bonnaire-Sergeant wrote: > > Hi Colin, > > If you must call the Java constructor, you need reflection. >

Re: Create an instance of a record using a string to define the record's symbol

2014-08-06 Thread Colin Yates
Ah OK, I didn't realise I needed to get into Java interop. For education - can you (or anyone) explain me as to why what I was trying didn't work? Thanks Ambrose. On 6 August 2014 11:50, Ambrose Bonnaire-Sergeant < abonnaireserge...@gmail.com> wrote: > Hi Colin, > > If you must call the Java c

Clojure 1.7 and invokeStatic

2014-08-06 Thread Robin Heggelund Hansen
Just read this blog post about Oxen (http://arrdem.com/2014/08/05/of_oxen,_carts_and_ordering/?utm_source=dlvr.it&utm_medium=twitter). In it is mentioned that Rich is re-introducing invokeStatic to achieve a possible 10% performance increase for Clojure 1.7. I couldn't find any information abo

Re: Create an instance of a record using a string to define the record's symbol

2014-08-06 Thread Ambrose Bonnaire-Sergeant
Hi Colin, If you must call the Java constructor, you need reflection. user=> (defrecord B [c]) user.B user=> (def s "user.B") #'user/s user=> (.newInstance (first (.getDeclaredConstructors (Class/forName s))) (object-array [1])) #user.B{:c 1} Thanks, Ambrose On Wed, Aug 6, 2014 at 6:37 PM, Col

Create an instance of a record using a string to define the record's symbol

2014-08-06 Thread Colin Yates
Hi, tldr; if I have a (defrecord MyRecord) in ns a.b.c and I have a string "a.b.c.MyRecord" how I can invoke (a.b.c.MyRecord.) (or (new a.b.c.MyRecord)? I thought this was going to be as simple as (defn cfn "a.b.c.MyRecord") ((symbol cfn).) but that throws an ArityException: wrong number of ar

Re: Why does this not give output

2014-08-06 Thread Cecil Westerhof
2014-08-06 9:48 GMT+02:00 Thomas Heller : > dotimes is for doing things n times. doseq is for seqs. Use dotimes when > you can, doseq when you can't. > ​OK, I thought so, but wanted to be sure.​ And I also use doseq on a place where dotimes would not work: (doseq [arrayRange [10 100 1000 200

Re: [ANN] core.cache 0.6.4

2014-08-06 Thread Ambrose Bonnaire-Sergeant
Yes please, help wanted. On Wed, Aug 6, 2014 at 1:16 PM, Yehonathan Sharvit wrote: > Do you intend to support clojurescript? Do you need help? > > > On Wed, Aug 6, 2014 at 7:36 AM, Ambrose Bonnaire-Sergeant < > abonnaireserge...@gmail.com> wrote: > >> Not yet. >> >> >> On Wed, Aug 6, 2014 at 1

Re: [ClojureScript] Re: [ANN] Silk, an isomorphic routing library for Clojure and ClojureScript

2014-08-06 Thread Dom Kiva-Meyer
Hi Joel, Thanks for your feedback. Off topic, but Garden is awesome and Ankha has been indispensable when developing Om applications! Thanks for those. I didn't complain or suggest a patch because, aside from Bidi, I didn't find a Clojure or ClojureScript routing library that I could conceive of

Re: Cursive Plugin java integration

2014-08-06 Thread Colin Fleming
Hi Bryan, Unfortunately this is a known issue right now, not all classes generated from Clojure forms are represented by classes in IntelliJ yet. Some of them are - if you use deftype, defrecord, reify and proxy those should all work well. Unfortunately gen-class does not, yet, although I've had a

Re: [ANN] Silk, an isomorphic routing library for Clojure and ClojureScript

2014-08-06 Thread Dom Kiva-Meyer
Hi Craig, Great question! Bidi is a fantastic library and was my favorite Clojure routing library prior to Silk. The design of Silk was heavily influenced by that of Bidi. In terms of commonalities, both Silk and Bidi are bidirectional, pure (no side effects), based

Re: Why does this not give output

2014-08-06 Thread Thomas Heller
dotimes is for doing things n times. doseq is for seqs. Use dotimes when you can, doseq when you can't. On Wed, Aug 6, 2014 at 12:13 AM, Cecil Westerhof wrote: > 2014-08-05 19:04 GMT+02:00 Thomas Heller : > > If you don't need the result of the for loop (which you don't in your >> example) use