Re: abysmal multicore performance, especially on AMD processors

2012-12-12 Thread cameron
Hi Marshall, the megamorphic call site hypothesis does sound plausible but I'm not sure where the following test fits in. If I understand correctly we believe that it's the fact that the base case (an PersistentList$EmptyList instance) and the normal case (an PersistsentList instance) have dif

Re: STM - a request for "war stories"

2012-12-12 Thread john
So is the bottom line: STM Should have not been added to clojure ( because it is not pratical) Many Grettings John -- 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 ne

Re: why is nth called here?

2012-12-12 Thread Dennis Haupt
if anyone is interested, i used reduces instead of reductions. 2012/12/11 Dennis Haupt > i just saw my error :/ > > > Am 11.12.2012 22:22, schrieb Ben Wolfson: > > nth is called in doing the destructuring for the argument lists in > > your fns defined in try-find-sequence. > > > > On Tue, D

Re: STM - a request for "war stories"

2012-12-12 Thread Marko Topolnik
I wouldn't say that it should not have been added since its presence isn't harming anything. You could say, though, that rarely anyone would realize something was missing if Clojure didn't have the STM. On Wednesday, December 12, 2012 9:50:31 AM UTC+1, john wrote: > > So is the bottom line: STM

Re: start-process-shell-command: Spawning child process: invalid argument

2012-12-12 Thread Myrna van de Burgwal
I also have a problem when I type in 'M-x slime' in Emacs. It causes the same error (spawning child process: invalid argument). I assume I installed slime correctly and I rewrote ~/.emacs. What could ben the problem? -- You received this message because you are subscribed to the Google Groups "C

Re: start-process-shell-command: Spawning child process: invalid argument

2012-12-12 Thread Stathis Sideris
I've had this problem before when emacs was trying to start an external executable whose path contained spaces. Are you running Windows by any chance? Is your Java under "Program Files"? Try moving it to a space free path like "C:\development\tools\". On Wednesday, 12 December 2012 12:20:46 UTC

Re: abysmal multicore performance, especially on AMD processors

2012-12-12 Thread Marshall Bockrath-Vandegrift
Andy Fingerhut writes: > I'm not practiced in recognizing megamorphic call sites, so I could be > missing some in the example code below, modified from Lee's original > code. It doesn't use reverse or conj, and as far as I can tell > doesn't use PersistentList, either, only Cons. ... > Can you

Re: abysmal multicore performance, especially on AMD processors

2012-12-12 Thread Marshall Bockrath-Vandegrift
cameron writes: >   the megamorphic call site hypothesis does sound plausible but I'm > not sure where the following test fits in. ... > I was toying with the idea of replacing the EmptyList class with a > PersistsentList instance to mitigate the problem > in at least one common case, however i

clojure.string/capitalize API

2012-12-12 Thread Pierre Allix
Hello, The clojure.string/capitalize function is defined as follow: Converts first character of the string to upper-case, all other characters to lower-case. I think it does not follow principle of least astonishment. I would have expected to convert only the first character. Moreover convert

Re: clojure.string/capitalize API

2012-12-12 Thread Chris Ford
This seems like quite a specialised function to have in a core string library. To me, the only behaviour that would be generic enough to include in a core library would be to capitalise all the letters of the string. On 12 December 2012 17:12, Pierre Allix wrote: > Hello, > > The clojure.string

Re: abysmal multicore performance, especially on AMD processors

2012-12-12 Thread Andy Fingerhut
Lee: I believe you said that with your benchmarking code achieved good speedup when run as separate JVMs that were each running a single thread, even before making the changes to the implementation of reverse found by Marshall. I confirmed that on my own machine as well. Have you tried runnin

Re: abysmal multicore performance, especially on AMD processors

2012-12-12 Thread Lee Spector
On Dec 12, 2012, at 10:03 AM, Andy Fingerhut wrote: > > Have you tried running your real application in a single thread in a JVM, and > then run multiple JVMs in parallel, to see if there is any speedup? If so, > that would again help determine whether it is multiple threads in a single > JVM

Re: clojure.string/capitalize API

2012-12-12 Thread Grant Rettke
On Wed, Dec 12, 2012 at 8:12 AM, Pierre Allix wrote: > I think it does not follow principle of least astonishment. I would have > expected to convert only the first character. Moreover converting the other > characters make the function almost useless, I for instance had this string > to capita

Re: abysmal multicore performance, especially on AMD processors

2012-12-12 Thread Christophe Grand
Lee, while you are at benchmarking, would you mind running several threads in one JVM with one clojure instance per thread? Thus each thread should get JITted independently. Christophe On Wed, Dec 12, 2012 at 4:11 PM, Lee Spector wrote: > > On Dec 12, 2012, at 10:03 AM, Andy Fingerhut wrote: >

Re: clojure.string/capitalize API

2012-12-12 Thread Jim foo.bar
There is an easy solution to your problem...Just hange the fn definition slightly. For example I am regularly using this: (defn un-capitalize [^String s] (let [Cfirst (subs s 0 1) Crest (subs s 1) ] (str (.toLowerCase Cfirst) Crest))) It is pretty obvious what you need to do to convert the abo

Re: abysmal multicore performance, especially on AMD processors

2012-12-12 Thread Lee Spector
On Dec 12, 2012, at 10:45 AM, Christophe Grand wrote: > Lee, while you are at benchmarking, would you mind running several threads in > one JVM with one clojure instance per thread? Thus each thread should get > JITted independently. I'm not actually sure how to do that. We're starting runs wit

Re: STM - a request for "war stories"

2012-12-12 Thread Warren Lynn
On Wednesday, December 12, 2012 4:46:06 AM UTC-5, Marko Topolnik wrote: > > I wouldn't say that it should not have been added since its presence isn't > harming anything. You could say, though, that rarely anyone would realize > something was missing if Clojure didn't have the STM. > > > Alth

Re: Need ideas for carving project into namespaces

2012-12-12 Thread Jim foo.bar
On 12/12/12 00:16, Mark Engelberg wrote: I would much prefer to have some sort of core function that serves as a polymorphic constructor. This way users don't need to require the concrete implementations individually. I faced the same sort of issue a couple of months ago. Just like you, I wa

Re: clojure.string/capitalize API

2012-12-12 Thread Marek Kubica
On Wed, 12 Dec 2012 09:44:28 -0600 Grant Rettke wrote: > Fro that principle, who is the least astonished who is it based on? I jsut wanted to say, people coming e.g. from Python. But then I realized it does the same thing and afterwards I was enlightened that it doesn't matter since I never use

Re: Need ideas for carving project into namespaces

2012-12-12 Thread Mark Engelberg
On Wed, Dec 12, 2012 at 8:22 AM, Jim foo.bar wrote: > On 12/12/12 00:16, Mark Engelberg wrote: > > I would much prefer to have some sort of core function that serves as a > polymorphic constructor. This way users don't need to require the concrete > implementations individually. > > > I faced t

Re: STM - a request for "war stories"

2012-12-12 Thread Paul Butcher
Hey Stuart, Thanks for the response. What I'm trying to do is keep each chapter focussed on an approach, rather than a language. For example, in the chapter on Actors, I'll be showing examples in Scala, but the discussion won't be (I hope!) particularly Scala-specific. I hope to leave the read

Re: Need ideas for carving project into namespaces

2012-12-12 Thread Karsten Schmidt
What's stopping you to include the immigrate fn into your own library? Source is here: http://clojuredocs.org/clojure_contrib/clojure.contrib.ns-utils/immigrate There's also Zach Tellman's Potemkin lib, which can be used to immigrate individual vars: https://github.com/ztellman/potemkin (Although

Re: Need ideas for carving project into namespaces

2012-12-12 Thread Jim - FooBar();
On 12/12/12 17:37, Mark Engelberg wrote: Yes and no. That's basically what I'm trying to do, but I only have a handful of concrete implementations to choose from, so I don't mind writing a hard-coded cond that chooses between them based on some sort of keyword that the user passes in. So the

Re: Need ideas for carving project into namespaces

2012-12-12 Thread Mark Engelberg
Thanks. I was hoping that someone would see a way to organize the namespaces to avoid circular dependencies, but perhaps there's simply no way to do that short of what I already outlined. I especially appreciate the pointer to Potemkin. Just reading through the "apologia", it sounds like it is m

Re: Need ideas for carving project into namespaces

2012-12-12 Thread Mark Engelberg
On Wed, Dec 12, 2012 at 9:53 AM, Jim - FooBar(); wrote: > Yes it would...You're using reflection so no need to :use or :require the > namespaces any more. > Point your browser here if you're not following: > https://github.com/jimpil/Clondie24/blob/master/src/Clondie24/lib/util.clj > What gets th

Re: Need ideas for carving project into namespaces

2012-12-12 Thread Michał Marczyk
@Jim: That function generates factory functions which themselves use no reflection and incur no performance penalty at all. The only performance hit visible at runtime comes from the fact that generating those factory functions involves compiling code at runtime (but you should hopefully be able t

Clojurescript Component-Entity-System game engine

2012-12-12 Thread aboy021
I just read a fascinating post by Chris Granger(of Light Table fame) - Chris Granger - Anatomy of a knockout In it he talks about using a Component Entity System a

Re: How to emulate Java sub-classing using closure with a macro?

2012-12-12 Thread Gary Verhaegen
I'm a little late here, but I wanted to point out that there is a pretty good match between what you're describing as an FSM and Akka actors. In case you're still looking into this, you might want to check out Okku, my (very thin) Clojure wrapper for Akka. On Sunday, November 18, 2012, timc wrote:

way to test if a coll is a record?

2012-12-12 Thread Ben Wolfson
Given something like this: (defrecord F [a]) This fails: (clojure.walk/postwalk identity [(F. 1)]) because although (coll? (F. 1)) is true, (empty (F. 1)) fails ("can't create empty"). I've had to write an alternative to walk anyway (it discards metadata), and I'd like it to be able to accommo

Re: way to test if a coll is a record?

2012-12-12 Thread Andy Fingerhut
I haven't dug into the details, but this Clojure ticket looks like it might be related, if not the same issue: http://dev.clojure.org/jira/browse/CLJ-1105 It has been vetted by Stuart Halloway, so patches are welcome, but likely wouldn't get in until after Clojure 1.5 is released (my guess). A

Re: Need ideas for carving project into namespaces

2012-12-12 Thread Karsten Schmidt
FWIW, also having struggled with overcoming circular ns deps in the past, I adopted the approach/compromise below which still provides an IMHO decent/sound usercode experience. A contrived example: core.clj (ns mylib.core (:require [mylib.types]) (:import [mylib.types Rect Circle]))

max doesn't return max?

2012-12-12 Thread Dennis Haupt
maybe i am blind, but why does max return the complete lazy seq here instead of the maximum number? if i just print as-products, i get a list of numbers. (count solution) tells me there are 1000+ and yet max gives me the complete list? (ns euler.Problem8) (def digits "73167176531330624919225119

Re: max doesn't return max?

2012-12-12 Thread Timothy Baldridge
(doc max) user=> (doc max) - clojure.core/max ([x] [x y] [x y & more]) Returns the greatest of the nums. nil max doesn't take a sequence, it takes one or more values and finds the max of them. So use (apply max coll) to get what you want. Timothy On Wed, Dec 12, 2012 a

Re: Autotest for Clojure/Midje?

2012-12-12 Thread Wes Williams
thanks Brian that was just what I was looking for! just getting started with Midje and this made it much faster. On Tuesday, December 11, 2012 11:00:03 AM UTC-8, Brian Marick wrote: > > > On Dec 11, 2012, at 12:38 PM, Timothy Baldridge > > > wrote: > > > For a project I'm working on it would b

Re: max doesn't return max?

2012-12-12 Thread Juan Martín Muñoz Facorro
Arguments to *max* should be supplied explicitly. If you want to use a sequence you should use *apply* with *max*: (apply max [1 2 0.5]) Regars, Juan On Wednesday, December 12, 2012 6:12:20 PM UTC-3, HamsterofDeath wrote: > > maybe i am blind, but why does max return the complete lazy seq here

Re: abysmal multicore performance, especially on AMD processors

2012-12-12 Thread cameron
On Thursday, December 13, 2012 12:51:57 AM UTC+11, Marshall Bockrath-Vandegrift wrote: > > cameron > writes: > > > the megamorphic call site hypothesis does sound plausible but I'm > > not sure where the following test fits in. > > ... > > > I was toying with the idea of replacing the Empt

Re: Slime and heroku setup question

2012-12-12 Thread Jim Crossley
FWIW, direct socket access via an ssh tunnel is allowed on OpenShift, so connecting to the remote REPL (either nREPL or Swank) is simple and requires no HTTP transport, but all of Phil's general advice regarding the remote disk applies there, too. For an example, see http://immutant.org/news/2012/

Re: abysmal multicore performance, especially on AMD processors

2012-12-12 Thread Christophe Grand
See https://github.com/flatland/classlojure for a, nearly, ready-made solution to running several Clojures in one JVM. On Wed, Dec 12, 2012 at 5:20 PM, Lee Spector wrote: > > On Dec 12, 2012, at 10:45 AM, Christophe Grand wrote: > > Lee, while you are at benchmarking, would you mind running sev

Re: Slime and heroku setup question

2012-12-12 Thread Jonathon McKitrick
So basically, I need to get used to editing in emacs, uploading to heroku, and (perhaps) interactively testing via a remote repl, correct? Sorry to belabor the point, but I'm trying to flatten the learning curve. On Wednesday, December 12, 2012 2:22:33 AM UTC-5, Phil Hagelberg wrote: > > On Tue

Re: Slime and heroku setup question

2012-12-12 Thread Sean Corfield
You should be able to run your app locally and do all your testing and development locally. Heroku is "just" a remote server for deployment. I'd suggest ignoring Heroku at first and focusing on getting your Clojure app running locally. Presumably you are building a Ring / Jetty app? On Wed, Dec 1

ANN: stream-stream 0.2.0

2012-12-12 Thread Stephen Compall
This is the second release of a simple data-conversion library between input streams, output streams, and purely lazy lists of blocks read from them. It's for Clojure-JVM 1.4.0. Clojars has it: https://clojars.org/com.nocandysw/stream-stream . See https://answers.launchpad.net/stream-stream/+faq

Re: ANN: stream-stream 0.2.0

2012-12-12 Thread Frank Siebenlist
Hi Stephen, Could you give a few use cases that shows what your library can be used for? Is it only for those of us that require a stream/seq of single bytes/chars? Would that make it easier to generate sha1's for example? Is it useful for sound/video-like streams? Sorry if I missed the point c

Re: ANN: stream-stream 0.2.0

2012-12-12 Thread Stephen Compall
On Wed, 2012-12-12 at 18:41 -0800, Frank Siebenlist wrote: > Could you give a few use cases that shows what your library can be used > for? Sure; it is, after all, a little abstract. The library helps you separate I/O from pure, composable functions, while retaining performance. It does for inpu

Re: ANN: stream-stream 0.2.0

2012-12-12 Thread Frank Siebenlist
Thanks Stephen - that's helpful. Just a few more Qs: In your example you have bs = (read-block-seq r), where "bs is a lazy seq of Java char arrays…" Does that imply that bs is an immutable seq? That I can reread - peek at the first chars without consuming? Also, can it be used with stdin? Can I

Re: ANN: stream-stream 0.2.0

2012-12-12 Thread Ambrose Bonnaire-Sergeant
Lovely, glad that Typed Clojure helps clarify things. Exciting to see it being used in real code! Thanks, Ambrose On Thu, Dec 13, 2012 at 10:10 AM, Stephen Compall wrote: > This is the second release of a simple data-conversion library between > input streams, output streams, and purely lazy li

Re: ANN: stream-stream 0.2.0

2012-12-12 Thread Stephen Compall
On Wed, 2012-12-12 at 19:57 -0800, Frank Siebenlist wrote: > In your example you have bs = (read-block-seq r), > where "bs is a lazy seq of Java char arrays…" > > Does that imply that bs is an immutable seq? > That I can reread - peek at the first chars without consuming? Absolutely. > Also, can

Clojure videos deleted from blip.tv?

2012-12-12 Thread Alex Grigorovich
Hi, I was trying to watch Rich's videos on http://clojure.blip.tv and got a 404 Not Found. Searching blip.tv for "clojure" brings up on entry that is "pending deletion". Are these videos available elsewhere? What's going on? -- Thanks, Alex -- You received this message because you are subscr

Re: Clojure videos deleted from blip.tv?

2012-12-12 Thread Ben Smith-Mannschott
I have no idea what is going on. Looks to me like blip decided to redo their web site and in the process throw out old content. or something. I've got local copies of: Alex Miller_ _Tree Editing with Zippers_.m4v Chris Houser_ _Finger Trees_ Custom Persistent Collections_.m4v Christophe Grand_