Re: Socket.IO and Clojure?

2013-07-17 Thread Clifton King
My company has been using with Socket.IO for async communication in production for a little while, and while it worked great in private beta, it has serious performance issues (as well as memory leaks) with only ~ 500 concurrent users. Ouch. The trouble with Socket.IO is that it tries to do too

Re: Prismatic Plumbing and Graph Open-Source Release

2013-07-17 Thread Vishi
Nice! Any more info on flip open source release? Possible timeframe? thanks On Tuesday, January 29, 2013 4:53:06 PM UTC-8, Aria Haghighi wrote: > > Yes, we'll be releasing flop soon. > > On Tuesday, January 29, 2013 4:49:45 PM UTC-8, ronen wrote: >> >> Amazing work Prismatic team, is there a pl

Re: How do I setup a Clojurescript REPL with emacs?

2013-07-17 Thread ktsujister
Here's how I did it. 1. I setup brepl environment with help of below tutorial. https://github.com/magomimmo/modern-cljs/blob/master/doc/tutorial-02.md in short, you'll need (repl/connect "http://localhost:9000/repl";) somewhere in your clojurescript code. 2. then open nrepl in emacs(I'm

Re: How do I setup a Clojurescript REPL with emacs?

2013-07-17 Thread Kelker Ryan
I could be wrong but, I think you can use the cljs-build plugin for lein and use the repl-listen command to start a REPL server. Can you not use M-x nrepl to connect? https://github.com/emezeske/lein-cljsbuild/blob/0.3.2/doc/REPL.md#repl-listen  18.07.2013, 13:04, "Chris Bui" :I'm trying to setup a

How do I setup a Clojurescript REPL with emacs?

2013-07-17 Thread Chris Bui
I'm trying to setup an environment for Clojurescript. The problem I'm having is not knowing how to set it up so that I can connect to a Clojurescript Browser REPL from emacs, so I can evaluate forms right from the editor and have it show up in the browser. Things I've tried: I tried using Ce

Re: [ANN] Vertigo: fast, idiomatic C-style structs

2013-07-17 Thread Zach Tellman
I actually haven't applied it yet. I'll post results once I have. On Wed, Jul 17, 2013 at 11:49 AM, Daniel wrote: > How did this affect performance in your Go AI? > > > On Tuesday, July 9, 2013 10:56:03 PM UTC-5, Zach Tellman wrote: >> >> Last year, I gave a talk at the Conj on my attempt to w

Re: Penumbra vs. LibGDX

2013-07-17 Thread JvJ
1) Phonegap seems like it just makes HTML5. So, does it work with android, IOS, and desktop? 2) I haven't done much clj-script development. What's the REPL situation like with that? 3) Nice job using PITA in that sense. On Wednesday, 17 July 2013 16:30:08 UTC-7, Chris Bui wrote: > > I haven't

Re: --> macro proposal

2013-07-17 Thread Sean Corfield
See this discussion: https://groups.google.com/forum/#!topic/clojure/67JQ7xSUOM4 (kinda hard to Google for functions with -> in their name so it took me a bit of digging!) Sean On Wed, Jul 17, 2013 at 10:15 AM, Steven Degutis wrote: > In that case, shouldn't it be named let-> instead of as->? >

Re: Socket.IO and Clojure?

2013-07-17 Thread Sean Corfield
Just to clarify, we don't _want_ to use Socket.IO on Node.js but combined with the client-side library it has a lot of benefits (multiple transports, automatic fallback, good cross-browser support, namespaces and rooms match our problem domain). The server component is sufficiently complex that we

Re: Socket.IO and Clojure?

2013-07-17 Thread Angel Java Lopez
If you leave Socket.IO, another option is direct WebSocket in Java https://github.com/TooTallNate/Java-WebSocket http://java-websocket.org/ On Wed, Jul 17, 2013 at 8:37 PM, Anand Prakash wrote: > Hi Sean, > We are in process for going with a similar solution on clojure. Lets keep > sharing notes

Re: Socket.IO and Clojure?

2013-07-17 Thread Anand Prakash
Hi Sean, We are in process for going with a similar solution on clojure. Lets keep sharing notes. We were on heroku till last week. Websockets wont work on heroku. Lack of sticky session caused other issues. So we moved to elabstic beanstalk. However elastic beanstalk doesn't support jetty and

Re: Penumbra vs. LibGDX

2013-07-17 Thread Chris Bui
I haven't worked with Penumbra, but I've tried getting LibGDX to work with Clojure and it's just a PITA. Totally agree that you lose the REPL with LibGDX. I'm writing another game now, although much if it is server side. I did however, discover that you can use Phonegap to write HTML5 applicati

Re: core.async: close! and control channels

2013-07-17 Thread Alan Shaw
Ah, that's put me on the right track. Thanks Timothy! -A On Wed, Jul 17, 2013 at 10:16 AM, Timothy Baldridge wrote: > After a channel is closed, any gets ( I think some part of your code is taking that nil return value and trying > to forward it on to a channel. That's what the error is about.

Re: Performance Patterns

2013-07-17 Thread Gary Trakhman
I have a variant of the timings macro that I used to profile some numeric code recently. You sprinkle it in your code, and it aggregates timings during a run by keywords of your choice.: (def ^:dynamic *times* nil) (defmacro timek "Evaluates expr and prints the time it took. Returns the va

Re: Performance Patterns

2013-07-17 Thread Marc Dzaebel
Frantisek, your timings macro is really helpful and you already have many interesting examples in the code. So I combine yours, mine and Alex recommendations as: - Programmatic creation of tests/docs to adapt to current Clojure versions - Systematically organized/grouped/sorted samples - Comment

Re: Performance Patterns

2013-07-17 Thread Marc Dzaebel
- really helpful links - accepting performance as more relevant, would IMHO strengthen Clojure So your wishes would be: - Systematically organized samples - Comments on causation - Using libraries to increase quality Thanks for your help, Marc -- -- You received this message because you are su

ANN: Fafnir, a library for inserting complex data structures into Datomic

2013-07-17 Thread Timothy Baldridge
Over the past few months I've been working a lot with Datomic and have often wanted a purely functional way to insert complex data structures (deep trees, graphs, etc.) into a database. I haven't been able to find a good library to help me with this, so I wrote my own: Introducing Fafnir. It's ava

Re: communicating quits to timeouts AND parent loop in core.async

2013-07-17 Thread Ben Mabey
Ah, very nice. I had not seen the alt! macro in use but upon close look it is just what I need when using the :default option. My go-loop macro now only requires the single stop channel: (defmacro go-loop [bindings & body] (let [stop (first bindings)] `(let [~stop (chan)] (go (wh

Re: communicating quits to timeouts AND parent loop in core.async

2013-07-17 Thread Ben Mabey
This approach works for the simple case but gets cumbersome it a more realistic loop with several timeouts and conditional logic. For example, here is a reduced use case which I am using my go-loop macro I posted earlier: (let [heads? (fn [] (> (rand) 0.5)) heads-time-out 1 lo

Re: communicating quits to timeouts AND parent loop in core.async

2013-07-17 Thread Jonas
You can also use the alt! macro: (let [stop (chan)] (go (loop [] (println "Hello World!") (alt! (timeout 1000) (do (println "I'm done sleeping...") (recur)) stop :ok))) (!! stop :now) (println "We're done.")) On Wednesday, July

Penumbra vs. LibGDX

2013-07-17 Thread JvJ
Lately, I've been working on games with Clojure and LibGDX. However, many of the advantages of interactive development are not present, because LibGDX apps are built around Java development, and don't work well if you try to run multiple apps within a single program (i.e. from the REPL). Penum

Re: communicating quits to timeouts AND parent loop in core.async

2013-07-17 Thread David Nolen
Why not the following? (let [stop (chan)] (go (loop [] (println "Hello World!") (let [[v c]] (alts! [(timeout 1) stop])] (if (= c stop) :done (do (println "I'm done sleeping, going to recur now...") (recur))) On Wed, Jul 1

Re: merge nested maps

2013-07-17 Thread JvJ
By the way, this is already in contrib: http://clojuredocs.org/clojure_contrib/clojure.contrib.map-utils/deep-merge-with On Wednesday, July 17, 2013 5:42:24 AM UTC-7, Chris Gill wrote: > > Thank you for finding and posting this! Been wracking my brain trying to > figure out a good way to do a fu

Re: [ANN] Vertigo: fast, idiomatic C-style structs

2013-07-17 Thread Daniel
How did this affect performance in your Go AI? On Tuesday, July 9, 2013 10:56:03 PM UTC-5, Zach Tellman wrote: > > Last year, I gave a talk at the Conj on my attempt to write an AI for the > board game Go. Two things I discovered is that it was hard to get > predictable performance, but even on

communicating quits to timeouts AND parent loop in core.async

2013-07-17 Thread Ben Mabey
Hi all, In a number of places where I'm trying core.async I have run across the pattern of having a loop inside a go block with some timeouts in the loop body. Contrived example: (go (while true (println "Hello World!") (In situations like these I almost always want to

Re: --> macro proposal

2013-07-17 Thread Alexander Yakushev
Thank you for the explanation, it makes sense to me now. On Wednesday, July 17, 2013 8:03:41 PM UTC+3, David Nolen wrote: > > While the macro can do what the original enhancement request suggested > that's not the actual problem the new threading macros were intended to > solve. They were primar

Re: [ANN] simple-sheck - A QuickCheck inspired testing tool

2013-07-17 Thread Reid Draper
On Jul 17, 2013, at 12:56 AM, Alex Baranosky wrote: > Hi Reid, > > I dig how nicely it integrates with clojure.test. Does simple-check > implement some form of shrinking? It does. The README has an example of the output when a property fails (and the input is shrunk), but it's also easy to

Re: core.async: close! and control channels

2013-07-17 Thread Timothy Baldridge
After a channel is closed, any gets ( wrote: > The problem I am having is in the function at line 41 of > https://github.com/nodename/async-plgd/blob/master/src/hoare/coroutines.clj. > Any insight into this is appreciated. > > -A > > > > On Wed, Jul 17, 2013 at 7:23 AM, Timothy Baldridge > wrote:

Re: --> macro proposal

2013-07-17 Thread Steven Degutis
In that case, shouldn't it be named let-> instead of as->? On Wed, Jul 17, 2013 at 12:03 PM, David Nolen wrote: > While the macro can do what the original enhancement request suggested > that's not the actual problem the new threading macros were intended to > solve. They were primarily added to

Re: --> macro proposal

2013-07-17 Thread David Nolen
While the macro can do what the original enhancement request suggested that's not the actual problem the new threading macros were intended to solve. They were primarily added to eliminate: (let [x ... x ... x ...] ...) Which is pretty ugly and also it's pretty easy to get into tro

Re: --> macro proposal

2013-07-17 Thread Alexander Yakushev
I'm sorry for jumping in then. Should have paid more attention to the dates. Nevertheless I wonder why while standing on such a solid ground, the Core team eventually gave in. I could see a use for cond->, but as-> is basically the same macro that was suggested in topics like this, and was reje

Re: core.async: close! and control channels

2013-07-17 Thread Alan Shaw
The problem I am having is in the function at line 41 of https://github.com/nodename/async-plgd/blob/master/src/hoare/coroutines.clj. Any insight into this is appreciated. -A On Wed, Jul 17, 2013 at 7:23 AM, Timothy Baldridge wrote: > True, but I'll mention the semantics of channels once again

Re: --> macro proposal

2013-07-17 Thread Nelson Morris
Note the original discussion was from 2010. On Wed, Jul 17, 2013 at 11:49 AM, Alexander Yakushev wrote: > What a twist. > > Does any of the participants care to comment on this one? A hundred posts > of bashing a person from the position of authority while the macro in > question already sits in

Re: --> macro proposal

2013-07-17 Thread Alexander Yakushev
What a twist. Does any of the participants care to comment on this one? A hundred posts of bashing a person from the position of authority while the macro in question already sits in Core. I am against the usage of it myself, and closely followed previous discussions on this topic to understand

Re: easier way to write "not not"?

2013-07-17 Thread Stefan Kamphausen
Just for the record: I stumbled across the same question just a week ago. -- -- 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 - please be pat

Re: core.async: close! and control channels

2013-07-17 Thread Timothy Baldridge
True, but I'll mention the semantics of channels once again. Go blocks are attached to channels, and channels exist on their own as values. No where in this entire system is there some global list of channels or go blocks (except for in the executors, but let's not get into that right now). This m

Re: core.async: close! and control channels

2013-07-17 Thread Laurent PETIT
2013/7/17 Timothy Baldridge : > It appears that you cannot call close! within a go block and so >> >> to signal the end of input to a channel you have to use another channel >> upon which the receiver can alt!. >> > > That's shouldn't be true. What problems did you run into with this? Silly sugges

Re: core.async: close! and control channels

2013-07-17 Thread Timothy Baldridge
It appears that you cannot call close! within a go block and so > to signal the end of input to a channel you have to use another channel > upon which the receiver can alt!. > > That's shouldn't be true. What problems did you run into with this? And yes, channels and go's are automatically GC'd w

Re: easier way to write "not not"?

2013-07-17 Thread Steven Degutis
user=> (mapv #(not (not %)) [1 :a true false nil]) [true true true false false] user=> (mapv boolean [1 :a true false nil]) [true true true false false] On Wed, Jul 17, 2013 at 3:45 AM, Kelker Ryan wrote: > Have you tried the complement form? > > 17.07.2013, 15:12, "JvJ" : > > Not that it's a

Re: merge nested maps

2013-07-17 Thread Chris Gill
Thank you for finding and posting this! Been wracking my brain trying to figure out a good way to do a full map merge On Thursday, April 25, 2013 5:26:53 PM UTC-4, Stuart Sierra wrote: > > Here's a way to do it from the Pedestal demo source > code

Re: Things get slow if hashmap has 1000 Elements

2013-07-17 Thread Thomas Heller
One side node, *repeatedly* produces a lazy-seq. Since the REPL forces that seq when it tries do print everything you get the desired results, but if you were to (def x (repeatedly 1000 addmod) and then inspects mobs it would be empty, since no one forced the seq. If you want to force side-eff

[EuroClojure 2013] Call for Presentations now open

2013-07-17 Thread Stefan Hübner
Hi all, we’re excited to announce EuroClojure 2013 to be held in Berlin, Germany: “EuroClojure is the first 2-day, full-blown conference in Europe for the Clojure community. After an extremely successful 2012 edition in London we are replicating in Berlin this year! The conference will be

Re: Things get slow if hashmap has 1000 Elements

2013-07-17 Thread vis
Awesome, thanks a lot! On Wednesday, July 17, 2013 11:19:06 AM UTC+2, puzzler wrote: > > This might help: > http://clojuredocs.org/clojure_core/clojure.core/*print-length* > -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, s

Re: is it possible to join on lazy seqs?

2013-07-17 Thread Niels van Klaveren
Perhaps you could post a minimal example of the two datasets you're trying to join ? To do multiple types of joins (left, right, inner, natural & cross) on collections of maps/records, I use Sean Devlin's table-utils library. There's no jar, but there's instructions on how to make a version wit

Re: Things get slow if hashmap has 1000 Elements

2013-07-17 Thread Mark Engelberg
This might help: http://clojuredocs.org/clojure_core/clojure.core/*print-length* -- -- 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 - please

Things get slow if hashmap has 1000 Elements

2013-07-17 Thread vis
Hello everyone, I have a ref, which is a hashmap of monsters (they key is a unique id, the value is the monster) like this: *(defrecord mob [name level hp-cur hp-max]) (def mobs (ref {})) (defn addmob [] (dosync (alter mobs assoc (gen-id) (->mob "test" 1 2 3)))* Now if I add 1000 monsters, li

Re: easier way to write "not not"?

2013-07-17 Thread Kelker Ryan
Have you tried the complement form? 17.07.2013, 15:12, "JvJ" :Not that it's a big deal, but is there a standard library function for #(not (not %))? -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@google