Re: [ANN] Introducing Yagni, a Leiningen plugin for finding unused code

2015-06-24 Thread Yehonathan Sharvit
Does yagni work with cljs projects? On Wednesday, 24 June 2015 02:27:46 UTC+3, Andrew Oberstar wrote: Haven't tried it yet, but looks good. Nice work! Andrew Oberstar On Tue, Jun 23, 2015 at 12:39 PM W. David Jarvis vena...@gmail.com javascript: wrote: Hello everyone. I'm happy to

Re: [ANN] Introducing Yo-yo, a protocol-less, function composition-based alternative to Component

2015-06-24 Thread Atamert Ölçgen
On Tue, Jun 23, 2015 at 11:47 PM, James Henderson ja...@jarohen.me.uk wrote: Hi Atamert - thanks :) I thought it might be preferable to keep the call to (latch)explicit - it means that ylet can be used in nested calls, too - for example, to set up and compose groups of

Re: Writing REST api the right way

2015-06-24 Thread Tommi Reiman
Hi. About the documentation - at least ring-swagger[1] doesn't force you to use Schema as the runtime validation library, it just expects the route (and parameter) definitions to be presented to it as Schemas. So, you could validate the routes using bouncer and extract the ring-swagger schemas

Compojure character encoding

2015-06-24 Thread Jonathon McKitrick
I have a web app that apparently cannot consume UTF-8 encoding. Can compojure generate responses in latin-1 encoding? -- 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

pr-str and safe serialization

2015-06-24 Thread Ignacio Thayer
I think this might be rehashing some old stuff, but I haven't seen discussion on it recently and I see this behavior is still present in 1.7 so I thought I'd ask. It's the same underlying issue as this:

Re: [ANN] Introducing Yagni, a Leiningen plugin for finding unused code

2015-06-24 Thread juan.facorro
That's a good point. On Wednesday, June 24, 2015 at 6:53:43 PM UTC-3, Fluid Dynamics wrote: FMIIW, but I think they serve orthogonal purposes. Google Closure finds code (mostly library parts your program doesn't use) that your particular program doesn't need and omits it from the build to

Re: Writing REST api the right way

2015-06-24 Thread Fluid Dynamics
On Wednesday, June 24, 2015 at 4:03:39 PM UTC-4, Mike Grabowski wrote: Thanks for the reference, I've seen it before and it looks interesting, especially thanks to the failover built-in. It also greatly shows how Clojure can reduce the `Java boilerplate`. Speaking on the performance note,

Re: Writing REST api the right way

2015-06-24 Thread Fluid Dynamics
On Wednesday, June 24, 2015 at 6:37:14 PM UTC-4, raould wrote: 350ms sounds fast enough for a low-frequency user interaction. In fact, once login is fast enough not to annoy your users, you don't *want* any more speed from it, as further speedup then only benefits blackhats trying to

Re: Writing REST api the right way

2015-06-24 Thread Raoul Duke
That would apply to common actions like typing and entering. Login being slower than that isn't likely to be as much of a bother as you likely only do it infrequently, maybe as much as once a day if you're paranoid and clear cookies nightly. Yeah, to me that is the sort of reasoning that

Re: [ANN] Introducing Yagni, a Leiningen plugin for finding unused code

2015-06-24 Thread Fluid Dynamics
FMIIW, but I think they serve orthogonal purposes. Google Closure finds code (mostly library parts your program doesn't use) that your particular program doesn't need and omits it from the build to save disk and bandwidth. Yagni finds obsolete code that is no longer reached in your program or

Re: pr-str and safe serialization

2015-06-24 Thread Fluid Dynamics
On Wednesday, June 24, 2015 at 4:56:06 PM UTC-4, Ignacio Thayer wrote: I think this might be rehashing some old stuff, but I haven't seen discussion on it recently and I see this behavior is still present in 1.7 so I thought I'd ask. It's the same underlying issue as this:

Re: Writing REST api the right way

2015-06-24 Thread Raoul Duke
350ms sounds fast enough for a low-frequency user interaction. In fact, once login is fast enough not to annoy your users, you don't *want* any more speed from it, as further speedup then only benefits blackhats trying to brute-force one of your users' accounts. So, it might be a feature, not

Re: [ANN] Introducing Yagni, a Leiningen plugin for finding unused code

2015-06-24 Thread W. David Jarvis
Indeed. I'd argue it's better not to have unused code in the codebase in the first place, regardless of what the Closure compiler does to help when it comes to compiling assets. I haven't tested this with cljs projects, but on the face of it I don't see why Yagni's methodology wouldn't work.

Re: Compojure character encoding

2015-06-24 Thread James Reeves
Yes, you can return a full response map with the desired encoding: (GET / [] {:status 200 :headers {Content-Type text/html; charset=ISO-8859-1} :body Hello World}) Or use the ring.util.response namespace: (GET / [] (- (resp/response Hello World) (resp/charset

Re: Compojure character encoding

2015-06-24 Thread James Reeves
Well, JSON should be encoded in unicode (either UTF-8, UTF-16 or UTF-32, with UTF-8 as the default), so the clients shouldn't be having a problem if their JSON parsers are correct. However, you may want to try the :escape-non-ascii option that Cheshire and Ring-JSON have. e.g.

[ANN] CIDER 0.9.1

2015-06-24 Thread Bozhidar Batsov
Hi everyone, CIDER 0.9.1 (codename “EuroCIDER”) is out! The release notes are here https://github.com/clojure-emacs/cider/releases/tag/v0.9.1 This release fixes pretty much all serious issues that were discovered shortly after 0.9.0 went live and (as you probably have guessed by now) is

Re: pr-str and safe serialization

2015-06-24 Thread Matching Socks
There are currently no votes for either Jira issue! - No.1532, pr-str captures stdout from printing side-effects of lazily evaluated expressions - No.1611, clojure.java.io/pushback-reader -- You received this message because you are subscribed to the Google Groups Clojure group. To post to

Re: Writing REST api the right way

2015-06-24 Thread Alan Moore
Mike, I think you might be better off keeping as much as you can the same between the two test scenarios so that you are only comparing the differences between nodejs and clojure -- and not all kinds of other variables like co-located services/cpu-load on your various hosts, network latency

Re: Compojure character encoding

2015-06-24 Thread Jonathon McKitrick
Thanks, James. To clarify, Compojure has no problems serving the JSON content. But the SBCL common lisp app and a third-party app (Klipfolio) both are choking on the output. I was able to fix the SBCL app by telling Babel to use latin-1 encoding, but I need another solution for the output to

Online hacktahon on June 27 - Clojure available

2015-06-24 Thread Maria Martin
Hi everyone, Just to let you know about an online hackathon that may be of interest to you: http://www.codingame.com/challenge/code-of-the-rings The concept is: 24 hours to code and optimize a solution to a problem. It's free and open to all. There are other games to train on the platform (page

[ANN] aleph-middleware: Ring middleware that support deferred responses.

2015-06-24 Thread Atamert Ölçgen
Hi, https://github.com/muhuk/aleph-middleware This is library that provides deferred-friendly versions of some of the middleware that's shipped with ring-core. Specifically ones that modify responses. They were choking on deferred's so I had to modify them a bit. Let me know if it's useful.

Re: transducer (+ closures) efficiency question

2015-06-24 Thread Leon Grapenthin
Correction: The result in the example should be [1 2 3] of course. On Wednesday, June 24, 2015 at 6:34:20 PM UTC+2, Leon Grapenthin wrote: Using a set as filter predicate is idiomatic Clojure. If you don't know whether your filter coll is a set, you can write your filter-contains as (def

Re: transducer (+ closures) efficiency question

2015-06-24 Thread Herwig Hochleitner
2015-06-24 18:19 GMT+02:00 Ben Wolfson wolf...@gmail.com: I meant a difference in speed. A var-root fetch is a volatile read, which can have several adverse performance effects. Most importantly, it hinders inlining, since the JIT has to place a guard for every inlining site of a volatile

Re: transducer (+ closures) efficiency question

2015-06-24 Thread Ben Wolfson
On Wed, Jun 24, 2015 at 8:29 AM, Herwig Hochleitner hhochleit...@gmail.com wrote: 2015-06-24 1:25 GMT+02:00 Ben Wolfson wolf...@gmail.com: On Tue, Jun 23, 2015 at 4:17 PM, Ghadi Shayban gshay...@gmail.com wrote: Tangentially: (remove even?) Will be faster than (remove (fn [i] (even?

Re: transducer (+ closures) efficiency question

2015-06-24 Thread Leon Grapenthin
Using a set as filter predicate is idiomatic Clojure. If you don't know whether your filter coll is a set, you can write your filter-contains as (def filter-contains (comp filter set)) E. g. use as (into [] (filter-contains [1 2 3]) [1 2 3 4]) ;- [4] I am not up to date about optimizations

Re: transducer (+ closures) efficiency question

2015-06-24 Thread Herwig Hochleitner
2015-06-24 1:25 GMT+02:00 Ben Wolfson wolf...@gmail.com: On Tue, Jun 23, 2015 at 4:17 PM, Ghadi Shayban gshay...@gmail.com wrote: Tangentially: (remove even?) Will be faster than (remove (fn [i] (even? i))) because in the first case the dereference of the var 'even?' happens only once

Re: [ANN] Introducing Yagni, a Leiningen plugin for finding unused code

2015-06-24 Thread juan.facorro
Yehonathan Sharvit, I think Google's Closure compiler already has dead code elimination, so it's available for ClojureScript even if Yagni doesn't provide it :). Cheers, Juan On Wednesday, June 24, 2015 at 5:11:01 AM UTC-3, Yehonathan Sharvit wrote: Does yagni work with cljs projects? On

Re: Writing REST api the right way

2015-06-24 Thread Stuart Sierra
On Tuesday, June 23, 2015, Mike Grabowski wrote: ... I just can't stop thinking about non-blocking evented IO interactions. It just does not feel right to me to block the thread when e.g. logging in an user. Unfortunately, there are no NIO drivers for the database engines I am interested in

Re: transducer (+ closures) efficiency question

2015-06-24 Thread Alan Shaw
As with all discussions involving interoperability, I'd love to see the same questions answered for the JS target too. (This would of course apply to books such as the new Clojure Applied. ) On Jun 24, 2015 9:48 AM, Herwig Hochleitner hhochleit...@gmail.com wrote: 2015-06-24 18:19 GMT+02:00

Re: Writing REST api the right way

2015-06-24 Thread Mike Grabowski
Thanks for the reference, I've seen it before and it looks interesting, especially thanks to the failover built-in. It also greatly shows how Clojure can reduce the `Java boilerplate`. Speaking on the performance note, I am not entirely sure what's causing my REST API to be slower than