Re: Tools comparable to Luigi for Clojure or the JVM?

2015-09-16 Thread Ben Mabey
Drake is similar to what you want and it is written in Clojure: https://github.com/Factual/drake -Ben On 9/16/15 12:12 PM, Max Countryman wrote: Hi, I’m working on a project at work for which we’re currently considering a Python tool built by Spotify called Luigi[1]. Luigi is a tool for buil

Re: which are the pros and cons between stuartsierra/component and prismatic/graph?

2015-02-04 Thread Ben Mabey
On 2/4/15 5:46 AM, Juan A. Ruz wrote: Hi guys! Can anyone give some insight on the features or downsides of choosing component vs graph libs? Or maybe explain the advantages of using defrecords instead of plain fns? The two are not mutually exclusive. We use both to manage our system's lif

Re: Community Interest in a Clojure Application Config Library, using Zookeeper?

2014-05-21 Thread Ben Mabey
On 5/20/14, 3:33 PM, Thomas Steffes wrote: Hey folks, At Room Key we're using Apache Zookeeper and a home-grown clojure library called drcfg for real-time application configuration management. We're debating open-sourcing drcfg and are trying to gauge community interest in such a tool. We t

Re: Questions regarding Map vs Record and usage

2014-04-09 Thread Ben Mabey
On 4/9/14, 12:51 PM, Anthony Ortiz wrote: I see that there are several ways of instantiating a record : (->Book "Lord of the Rings", "Tolkien") (Book. "Lord of the Rings", "Tolkien") #user.Book{:title "Lord of the Rings", :author "Tolkien"} You missed one: (map->Book {:title "Lord of the R

Re: core.async threadpool size

2014-03-27 Thread Ben Mabey
marzo 2014 16:01:16 UTC+1, Ben Mabey ha scritto: I asked Timothy Baldridge about this on IRC when the change was made that added 42 and this was the reply I got: we're trying to strike a balance there, we don't want people to do IO inside a go block, but if they have to

Re: core.async threadpool size

2014-03-27 Thread Ben Mabey
I asked Timothy Baldridge about this on IRC when the change was made that added 42 and this was the reply I got: we're trying to strike a balance there, we don't want people to do IO inside a go block, but if they have to we'd don't want it to totally stall out. Here is the full conversation

Re: Concurrently updating two structures

2014-03-21 Thread Ben Mabey
For coordination of this type you could either a) use refs and the STM or b) put them in the same nested datastructure and put them both in an atom. The latter approach is what I would recommend and what people generally tend to do. If you go down this route you end up with the entire state of

Re: local mutable state

2014-03-21 Thread Ben Mabey
On 3/21/14, 5:44 AM, Andy Smith wrote: Im also interested as to why the mutable state approach would be less performant? In the single thread case the locks would be optimized out right? No locks are used when using atoms, only compare-and-swap (CAS) operations. While CAS operations are fast y

Re: core.async is very slow for some cases, what to do?

2014-03-11 Thread Ben Mabey
I've also ran into situations as well where the context switching of the thread pool is prohibitive. I swapped out the thread pool with a single threaded executor and saw a big speed improvement. The downside is that you can not specify what thread pool a go block should be ran on. This means

Re: Om-powered HTML slide-decks

2014-03-09 Thread Ben Mabey
On 3/9/14, 3:45 AM, Malcolm Sparks wrote: There are some HTML-based tools out there (reveal.js, slidy, impress.js, deck.js ...) for building slide-based presentations for conference talks. But you usually have to write your slides in raw HTML. This feels cumbersome when you're used to writing

Re: Clojure performance question

2014-03-03 Thread Ben Mabey
On 3/2/14, 7:06 PM, Mikera wrote: Some perspectives (as someone who has been tuning this stuff a lot, from a core.matrix standpoint in particular) On Saturday, 1 March 2014 13:02:26 UTC+8, bob wrote: Hi, Can I ask a newbie question about clojure performance? What make clojure per

Re: diagram of clojure interfaces and objects

2014-02-05 Thread Ben Mabey
On Wed Feb 5 13:16:01 2014, Andy Smith wrote: Hi, Does anyone know of a class diagram of all the java interfaces and classes that exist in clojure, including their inheritance relationships. Im trying to get a handle on all the many collection/sequence interfaces, but ideally I would like to vi

Re: go "kill infinite loop"

2014-01-13 Thread Ben Mabey
On Mon Jan 13 18:11:10 2014, t x wrote: Consider the following code block: (defn make-stupid [] (go (loop [] (recur (def x (make-stupid)) ;; ... is there a way to kill this infinite go-loop ? No, you can not kill the loop with the go channel that is bound to x. You need to r

Re: Comparing core.async and Reactive Extensions

2013-12-17 Thread Ben Mabey
On 12/17/13, 6:33 AM, Timothy Baldridge wrote: I won't go so far as to tell you which is better as that often comes down to a matter of taste. However, I will explain the technical differences. In this case I'll use my (somewhat limited) knowledge of C# Rx. Scala/Java's Rx may be different. R

Re: Enforcing constructor types on defrecord

2013-11-30 Thread Ben Mabey
On Sat Nov 30 08:03:18 2013, Ben Mabey wrote: On Sat Nov 30 07:41:52 2013, Josh Kamau wrote: Hi there ; Is there a way of enforcing constructor types when using defrecord? Josh -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Re: Enforcing constructor types on defrecord

2013-11-30 Thread Ben Mabey
On Sat Nov 30 07:41:52 2013, Josh Kamau wrote: Hi there ; Is there a way of enforcing constructor types when using defrecord? Josh -- -- 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

Re: core.async and performance

2013-11-29 Thread Ben Mabey
On Fri Nov 29 22:30:45 2013, kandre wrote: Maybe I'll just use my simpy models for now and wait for clj-sim ;) Any chance of sharing? Cheers Andreas On Saturday, 30 November 2013 15:40:10 UTC+10:30, Ben Mabey wrote: On 11/29/13, 9:16 PM, Cedric Greevey wrote: On Fri, Nov 29, 20

Re: core.async and performance

2013-11-29 Thread Ben Mabey
On 11/29/13, 9:16 PM, Cedric Greevey wrote: On Fri, Nov 29, 2013 at 11:03 PM, Ben Mabey <mailto:b...@benmabey.com>> wrote: On 11/29/13, 8:33 PM, Cedric Greevey wrote: Have you checked for other sources of performance hits? Boxing, var lookups, and especially reflection.

Re: core.async and performance

2013-11-29 Thread Ben Mabey
r if you're eschewing those in favor of go blocks for coordination...) On Fri, Nov 29, 2013 at 10:13 PM, Ben Mabey <mailto:b...@benmabey.com>> wrote: On Fri Nov 29 17:04:59 2013, kandre wrote: Here is the gist: https://gist.github.com/anonymous/7713596 Ple

Re: core.async and performance

2013-11-29 Thread Ben Mabey
bout 1s for 10^5 steps whereas the simpy version takes less than 1s for 10^6 iterations on my vm. Cheers Andreas On Saturday, 30 November 2013 09:22:22 UTC+10:30, Ben Mabey wrote: On Fri Nov 29 14:13:16 2013, kandre wrote: > Thanks for all the replies. I accide

Re: core.async and performance

2013-11-29 Thread Ben Mabey
On Fri Nov 29 14:13:16 2013, kandre wrote: Thanks for all the replies. I accidentally left out the close! When I contrived the example. I am using core.async for a discrete event simulation system. There are hundreds of go blocks all doing little but putting a sequence of events onto a channel

Re: [ANN] Component: dependency injection and state management

2013-11-21 Thread Ben Mabey
On Thu Nov 21 07:14:16 2013, Stuart Sierra wrote: On Thursday, November 21, 2013 7:22:10 AM UTC-5, abp wrote: > Why do you prefer declaring dependencies between > components of a system explicitly instead of using > prismatics Graph? 'Graph' by itself does not preserve the dependency relationshi

[ANN] Lambda Lounge Utah

2013-11-12 Thread Ben Mabey
Hi all, For you those of you living in the Salt Lake City area I am starting up a Lambda Lounge chapter. SLC doesn't have a Clojure user group but already this group is showing a big interest in Clojure so if you are in Utah please join us! http://www.meetup.com/Lambda-Lounge-Utah/ https://g

Re: Request for help optimising a Clojure program

2013-10-25 Thread Ben Mabey
On 10/24/13 5:46 AM, Paul Butcher wrote: On 24 Oct 2013, at 11:34, Phillip Lord > wrote: What does Scala do? I mean, given that it doesn't have the same problem, perhaps it has a solution? By default, Scala uses a tree-based set, not a hash-based set. So t

Re: Error - Clojure

2013-10-21 Thread Ben Mabey
On 10/21/13 4:57 PM, ingy abbas wrote: Exception in thread "main" java.lang.IllegalArgumentException: No value supplied for key: 1.7.1 (project.clj:1) at clojure.lang.Compiler.eval(Compiler.java:5441) at clojure.lang.Compiler.load(Compiler.java:5858) at clojure.lang.Compiler.loadFile

Re: Dependency management

2013-10-17 Thread Ben Mabey
On 10/17/13 9:38 AM, Andrei Serdeliuc wrote: Hi, I was wondering how people handle dependencies that aren't on clojars. We have a couple of clojure libs which are hosted on an internal github enterprise. So far I've been using lein's checkouts feature, but this seems fairly difficult when t

Re: streams, reading bytes

2013-10-10 Thread Ben Mabey
On 10/10/13 7:21 PM, Brian Craft wrote: I'm struggling with how to gzip/gunzip byte arrays from clojure. I don't really get how clojure.java.io streams supposed to be used. This appears to gzip a string: (let [baos (java.io.ByteArrayOutputStream.) gzos (java.util.zip.GZIPOutputStream. ba

Re: type checking clojure.set with core.typed

2013-09-30 Thread Ben Mabey
own tasks to do something similar for CI. Any CircleCI guys are on the list want to give us a real experience report? On 9/30/13 5:26 PM, Stuart Halloway wrote: Any experience reports? My experience so far: Type Checker: Found 1 error $ echo $? 0 On Mon, Sep 30, 2013 at 7:20 PM, Ben

Re: type checking clojure.set with core.typed

2013-09-30 Thread Ben Mabey
On 9/30/13 5:16 PM, Stuart Halloway wrote: I tried the following experiment with type checking clojure.set: (ns exploring.core-typed (:use clojure.core.typed clojure.repl) (:require [clojure.set :as set])) (ann ^:no-check clojure.set/difference [(Set Any) (Set Any) -> (Set Any)]) (set/diff

Re: core.async repl :reload-all issue?

2013-09-27 Thread Ben Mabey
t it did conform to Stuart's workflow. In my (more) real app I am trying to follow his workflow protocol and it was reloading fine but now is not maybe i need to read the link again, Thanks On Fri, Sep 27, 2013 at 2:06 PM, Ben Mabey <mailto:b...@benmabey.com>> wrote: Hi Rus

Re: core.async repl :reload-all issue?

2013-09-27 Thread Ben Mabey
Hi Russell, This doesn't look like a core.async specific problem, but rather the more general problem that protocols and records are not reload safe. What I believe is happening is the TimeoutQueueEntry type is being recompiled when you do reload all but old instances with the older compilati

Re: Video: Generating Beautiful (and Correct) Documentation from Unit Tests Files

2013-09-26 Thread Ben Mabey
On 9/25/13 8:33 PM, zcaudate wrote: I've put up a video of a new documentation plugin for leiningen Project Page: https://github.com/zcaudate/lein-midje-doc Youtube Video: http://www.youtube.com/watch?v=8FjvhDPIUWE&feature=youtu.be Sample Generated Documentation: http://z.caudate.me/lein-midj

Re: Clojure in Salt Lake City

2013-09-22 Thread Ben Mabey
On Sun Sep 22 21:24:24 2013, Jason Kapp wrote: Is there anyone out there that is using Clojure(Script) in Salt Lake City that would like to meetup? Hi Jason, I'm currently based in SLC and have been using clojure since 2010 (at work that is). We've had a couple of false starts of doing a Clo

Re: A macro for writing defn-like macros?

2013-09-03 Thread Ben Mabey
On 9/3/13 10:01 AM, Mark wrote: I find the vast majority of the time I'm tempted to write a macro (yeah, yeah, I know the first rule of macro club), is to defn-like things. Writing a defn-like macro to handle all the stuff defn does is pretty tough so I end up writing a barebones thing that do

Re: Rxjava + Clojure Users

2013-08-27 Thread Ben Mabey
On 8/27/13 10:03 AM, Dave Ray wrote: Hi. I'm writing to see if there's anyone out there using RxJava [1] from Clojure and to get their opinion on it's current, built-in support for non-Java languages. Just to recap, the current implementation knows about clojure.lang.IFn allowing functions

Re: profiler?

2013-08-27 Thread Ben Mabey
On 8/27/13 8:06 AM, Jay Fields wrote: What are you all using these days? I've been using YourKit and I'm fairly happy with it. Just making sure I'm not missing out on some new hotness. Cheers, Jay YourKit plus VisualVM in some cases (I'm not as familiar w/YourKit and I really like the VisualGC

Re: preference and implications of using as-> vs let

2013-08-19 Thread Ben Mabey
On 8/19/13 8:58 AM, Jay Fields wrote: In the past, I've written code like the following (defn foo [x y] (let [x-squared (* x x)] (if (pos? y) (+ x-squared y) (- x-squared y However, the introduction of as-> has led me to write the following, at times (defn foo [x y]

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

2013-07-17 Thread Ben Mabey
uot;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 17, 2013 at 2:47 PM, Ben Mabey >

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

2013-07-17 Thread Ben Mabey
to recur now...") (recur))) On Wed, Jul 17, 2013 at 2:47 PM, Ben Mabey <mailto:b...@benmabey.com>> wrote: 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 t

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: ClojureScript concurrency?

2013-07-12 Thread Ben Mabey
On Fri Jul 12 16:56:17 2013, Michał Marczyk wrote: At the risk of sounding pedantic, concurrency is not the same as parallelism. Multiple threads can be scheduled on a single core (and that's plenty useful). So, with the async stuff you mention, JavaScript already supports concurrency. ClojureScr

Re: Hotspot JIT optimisations

2013-06-16 Thread Ben Mabey
On Sun Jun 16 16:51:41 2013, Colin Fleming wrote: Hi all, This is slightly tangential to the current discussion on unnecessary type checks - does anyone have any good links to information about the JIT optimisations performed by Hotspot? One question I've been interested in recently is how well

Re: Making things go faster

2013-06-05 Thread Ben Mabey
On 6/4/13 10:16 PM, Kevin Downey wrote: midje makes each test a top level form, so test runs happen as a side effect of code loading, which means you cannot really run tests in a good way from the repl without doing some kind of ridiculous forced code reloading. I would definitely recommend sta

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-29 Thread Ben Mabey
On Wed May 29 09:18:10 2013, Softaddicts wrote: The REPL is a better alternative than a debugger. No REPL available = increase need for a debugger. If you write creepy code in the REPL, you would do the same in a text editor and then end up debugging it in the debugger... with the old fail/edi

Re: [GSoC] core.matrix NDArray project feature requests

2013-05-28 Thread Ben Mabey
On Tue May 28 02:40:33 2013, Dmitry Groshev wrote: Sorry, I wasn't clear enough in my proposal. I've mentioned clojurecheck [1] in it and the possibility of extending it, because in my Erlang experience property-based testing is extremely helpful for things that operates on something pure in com

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Ben Mabey
On 5/28/13 1:05 PM, Lee Spector wrote: On May 28, 2013, at 2:40 PM, Ben Mabey wrote: The flag is a system property: "-Dclojure.compiler.disable-locals-clearing=true". So you can add that string to your project.clj's :jvm-opts if you are using lein. This will, of course,

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Ben Mabey
On 5/28/13 12:19 PM, Lee Spector wrote: On May 28, 2013, at 2:16 PM, Ben Mabey wrote: You can disable locals clearing with a compiler flag. nrepl-ritz even has helper function that will compile the given form using that flag. If you want to disable locals clearing on a project wide basis

Re: "I don't feel the absence of a debugger, because I've learnt enough that I don't ever need a debugger."

2013-05-28 Thread Ben Mabey
On 5/28/13 10:37 AM, Cedric Greevey wrote: Huh. I just solved it. The debug exception handler has to do something a bit fancier, that's all: 1. Dig up the bytecode of the method executing the throw and copy it somewhere. 2. Unwind by one call. 3. Take the bytecode in 1, alter it to wrap the t

status of clj-nstools or similar tools?

2013-05-16 Thread Ben Mabey
Hi all, I like the idea of clj-nstools[1] in certain settings but I have never tried it in a project. (I like how it doesn't do any var copying like defalias and similar solutions do.) Has anyone used it on past projects that would be willing to give some experience reports (maybe Konrad him

Re: Understanding boxing

2013-05-13 Thread Ben Mabey
On Mon May 13 13:36:53 2013, Mark Engelberg wrote: What tools exist in Clojure for understanding whether a given variable is boxed or primitive? To get a better handle on boxing, I started playing around with things like: (def x 1) (def ^int x 1) (def x (int 1)) I want to know how Clojure is s

Re: Parallel code execution in ClojureScript?

2013-05-10 Thread Ben Mabey
On 5/7/13 3:39 PM, Ghassan Ayesh wrote: Hi: In Javascript language, and while the language is inherently functional, Javascript's *implementation* until now, does not support parallel code execution against available CPU cores, unlike Erlang for example or Clojure on JVM, so I am thinking tha

Re: Not using dependency injection - how do I share services around?

2013-05-10 Thread Ben Mabey
Hi Colin, On 5/10/13 5:04 AM, Colin Yates wrote: 1) to use (defonce *data-source*...) so that every body who requires that ns gets the same instance? While this has been done I view this as an antipattern. The big problem with this approach is that you now can only have a single *data-sourc

Re: [ANN] Himilsbach 0.0.1 is released

2013-05-05 Thread Ben Mabey
On Sun May 5 18:31:59 2013, Mikera wrote: On Tuesday, 30 April 2013 04:12:14 UTC+8, Jan Stępień wrote: Dear Clojurians, I'm very happy to announce Himilsbach 0.0.1. Himilsbach is a tiny actor library for intra-process messaging inspired by Erlang. Find it at https://github.com/jstepien/himi

Re: Clojure/West 2013 videos?

2013-03-21 Thread Ben Mabey
On 3/21/13 10:08 AM, John Gabriele wrote: Are there any videos available of the talks recently given at Clojure/West? Is there a central location where these will most likely be found at some point? Alex can confirm this but my guess is that they will be released on infoq slowly over time. Th

Re: Clojure Performance For Expensive Algorithms

2013-02-27 Thread Ben Mabey
On 2/27/13 9:59 AM, Isaac Gouy wrote: On Wednesday, February 27, 2013 1:13:10 AM UTC-8, Marko Topolnik wrote: On Wednesday, February 27, 2013 5:19:20 AM UTC+1, Isaac Gouy wrote: If idiomatic Clojure was used... The problem, of course, is that: the code one-person co

Re: Clojure Performance For Expensive Algorithms

2013-02-26 Thread Ben Mabey
10:45:33 PM UTC+1, Ben Mabey wrote: Yeah, I wish the Benchmarks allowed for idiomatic submissions and finely tuned submissions. That would allow you to get some sort of an idea how performant the dominant idiom is. Along those lines this older post did an interesting analysis o

Re: Clojure Performance For Expensive Algorithms

2013-02-24 Thread Ben Mabey
On 2/24/13 1:34 PM, Marko Topolnik wrote: I'm no Haskell expert, but it doesn't take much Googling to give strong evidence that the answer is "yes, you can get mutability in Haskell". Search through this Haskell program on the Benchmarks Game site for occurrences of the string "

Re: Convincing employer to go for Clojure

2013-01-09 Thread Ben Mabey
On 1/7/13 4:02 PM, David Jacobs wrote: What other tips do you have for convincing an employer that Clojure makes good business sense? (Of course I've already told them about domain-tailored abstractions, containing complexity, the ease of data manipulation with a functional language, etc.)

big atoms (was Re: STM - a request for "war stories")

2012-12-13 Thread Ben Mabey
Datomic stores the entire database in an atom (not an STM ref), and updates it with a call to swap! It is literally no more complex than a trivial hackneyed book example. :-) A lot of my systems have evolved into something similar and I've wondered what the implications of this approach ar

Re: Clojure Recursion (loop-recur) Questions

2012-11-27 Thread Ben Mabey
On 11/27/12 9:17 PM, Curtis wrote: Thank you Andy - This was fabulously helpful - I really appreciate your explanation. Would you permit me to include your answer in a blog post about the above question? On Monday, November 19, 2012 6:25:30 PM UTC-8, Andy Fingerhut wrote: If you are f

Re: Documenting clojure data structures

2012-10-31 Thread Ben Mabey
On 10/31/12 2:15 PM, Paul deGrandis wrote: If your concern is passing around associative data, contracts and general membership functions are the two most common approaches. If you're dealing with some unknown thing, you can see what protocols it satisfies and what functions/operations those p

Re: Documenting clojure data structures

2012-10-31 Thread Ben Mabey
On 10/31/12 12:04 PM, gaz jones wrote: you could try using contracts to specify what keys are supposed to be in the map, or just use pre/post conditions built in to clojure? https://github.com/fogus/trammel FYI, it looks like trammel's ideas are being moved over to https://github.com/clojure/c

Re: let in the middle of thread-first

2012-10-25 Thread Ben Mabey
On 10/25/12 6:24 PM, Jason Bennett wrote: Let's say I have a set of thread-first calls: (-> url a b c d e) And let's say that I need to process and save the result of function b as a second parameter to function e (function b returns a file, and function e needs the

Re: core.logic for constraint logic programming

2012-10-24 Thread Ben Mabey
On 10/24/12 2:56 PM, nathanmarz wrote: I'm looking into rewriting Storm's resource scheduler using core.logic. I want to be able to say constraints like: 1. Topology A's slots should be <= 10 and as close to 10 as possible (minimize the delta between assigned slots and 10) 2. All topologies shou

Re: Troubles working with nl.bitwalker.useragentutils

2012-10-24 Thread Ben Mabey
I'm completely lost here. Any tips? Maybe somebody has experience working with other UA parsing libraries? Hi Andrii, I have used the same library you are attempting to use in the past and it has worked well. My needs were simple and I found the bitwalker lib to be a great library for tho

Re: Midje popularity?

2012-10-17 Thread Ben Mabey
On 10/17/12 7:31 AM, Andreas Liljeqvist wrote: Hi. A couple of weeks ago I ported midje-mode over to nrepl. I did a post on the midje-group and made a pullrequest to the Midje-mode maintainer. Since I haven't got any response either on the mailinglist or the pullrequest I will ask here. Doe

Re: pmap performance degradation after 30-40 min of work?

2012-10-13 Thread Ben Mabey
I switched from pmap to (r/fold n (r/monoid into vector) conj coll)) and the same thing happened again! after approximately 50 minutes cpu utilisation dropped from 4/4 to 1/4...I don't understand! Jim Are you holding on to the head of the collection? That is often the source of memory

Re: ANN: a Clojure docs site, and github organization

2012-10-06 Thread Ben Mabey
On Oct 6, 2012, at 6:04 PM, Michael Klishin wrote: > > > 2012/10/7 Softaddicts >> The validity of a scanned signature or electronic keys is subject to >> interpretation >> and assessment on a per case basis especially in civil contracts by the >> diverse >> legal systems on Earth. >> >> It'

Re: clojure.lang.Keyword.hashCode is a hotspot in my app

2012-09-26 Thread Ben Mabey
On 9/25/12 11:37 PM, Ben Smith-Mannschott wrote: On Tue, Sep 25, 2012 at 1:53 AM, James Hess wrote: Hi experienced clojure gurus, According to VisualVM 24% of my time is spent in clojure.lang.Keyword.hashCode. I'm sure I am doing something wrong (i.e. I'm not blaming clojure's implementation).

Re: Literate Programming in org-babel (ob-clojure.el) is broken under nrepl.el

2012-09-12 Thread Ben Mabey
On 9/12/12 9:29 PM, Ben Mabey wrote: Thanks for the great example Gary! I've been meaning to try org-babel out for a while but never got around to it. I just tried your example and when I run org-babel-tangle the code blocks are not expanded into the source file, but rather the code

Re: Literate Programming in org-babel (ob-clojure.el) is broken under nrepl.el

2012-09-12 Thread Ben Mabey
Thanks for the great example Gary! I've been meaning to try org-babel out for a while but never got around to it. I just tried your example and when I run org-babel-tangle the code blocks are not expanded into the source file, but rather the code block names are just inserted into the source d

Re: A Performance Comparison of SBCL & Clojure

2012-08-28 Thread Ben Mabey
uld want to do that. It is more fair to compare memory use for problems that require a larger amount of memory, e.g. reverse-complement, k-nucleotide (for which the Clojure memory footprint can probably be reduced without a lot of effort), regex-dna, and binary-trees problems. Andy On A

Re: A Performance Comparison of SBCL & Clojure

2012-08-27 Thread Ben Mabey
Looking at clojure's benchmarks they seem to already be highly optimized (in terms of employing all the standard tricks). Does anyone have any idea if more could be done to lessen the gap between java and clojure[1]? Or are these benchmarks representative of the performance gap between clojur

Re: Follow-up questions on Stuart's InfoQ interview

2012-08-17 Thread Ben Mabey
On 8/17/12 3:03 PM, Rich Morin wrote: I took a break from reading "Programming Clojure, 2e" to watch Stuart's InfoQ interview: Stuart Halloway on Datomic, Clojure, Reducers http://www.infoq.com/interviews/halloway-datomic I have a couple

Re: Attractive examples of function-generating functions

2012-08-08 Thread Ben Mabey
On 8/8/12 10:48 AM, Brian Marick wrote: I'm looking for medium-scale examples of using function-generating functions. I'm doing it because examples like this: (def make-incrementer (fn [increment] (fn [x] (+ increment x ... or this: (def incish (partial map + [100 200 300]))

Re: What concurrency models to document?

2012-08-02 Thread Ben Mabey
On 8/2/12 10:04 AM, Brian Marick wrote: On Aug 2, 2012, at 8:50 AM, Meikel Brandmeyer (kotarak) wrote: You have to put quite a bit of thought in to get things right. Which raises the question: *is* concurrency actually a strong selling point for functional languages? Sane defaults are a sel

Re: community interest in machine learning (?)

2012-07-28 Thread Ben Mabey
On 7/28/12 4:52 PM, Timothy Washington wrote: Hey Jim, Encog does look very interesting. Right now, I'm trying (and failing) to implement the sigmoid function. I'm using wikipedia's reference , and trying to use Incanter's (incanter/exp) function

Re: Any downside of record compared to map

2012-07-23 Thread Ben Mabey
On 7/22/12 5:42 PM, Warren Lynn wrote: I plan to change all my major data structures to records instead of plain maps. Since record has everything a map provides, I figure there won't be any harm. But is that really so? Would appreciate the opinions from people who know better. Another downs

Re: Looking for an idiom regarding type hints

2012-07-21 Thread Ben Mabey
On 7/21/12 7:33 AM, ChrisR wrote: I am wondering if there is a simpler idiom to deal with functions on primitives that only differ by type hints (see example), this is the current idiom I am using which is starting to appear in my codebase, however I feel like whenever this much replication occu

Re: community interest in machine learning (?)

2012-07-20 Thread Ben Mabey
On 7/20/12 10:34 AM, Joshua Bowles wrote: Check this out for weka: https://github.com/antoniogarrote/clj-ml FYI, that fork isn't maintained anymore. I've updated it quite a bit and fixed a lot of reflection issues that were making it unusable in production: https://github.com/bmabey/clj-ml

Re: what is an xrel?

2012-07-20 Thread Ben Mabey
Hi David! My guess is as good as yours but I think rel is short for relation (as in a relation in relational algebra). The x might as well be a, b, or any other short variable name. In clojure-docs it looks like the examples for #'join use first-relation and second-relation instead of xrel a

Re: critique my code!

2012-07-11 Thread Ben Mabey
On 7/8/12 10:58 AM, William Morgan wrote: Excerpts from Alex Robbins's message of 2012-07-06 05:27:28 -0700: Reading through your code, many of your functions have large cond or condp clauses. Sometimes those can be replaced with multimethods. Thanks, that's good to know. I think in this case t

Re: ClojureScript instead of CoffeeScript for complete web app development?

2012-06-28 Thread Ben Mabey
On 6/24/12 10:31 PM, Christian M. wrote: I think the only problem (if it is a problem at all), which won't be solved soon is ClojureScript's performance resulting from creating a lot of implicit objects in very high level computations. Something like (filter (map (reduce ... ... (map ... ca

Re: Getting started with lein-cljsbuild

2012-05-28 Thread Ben Mabey
On 4/19/12 4:31 AM, Chris Perkins wrote: On Thursday, April 19, 2012 3:03:53 AM UTC-4, Evan Mezeske wrote: That's great news that you got it to work. I can't make any sense of the stack trace you're seeing with "lein deps", though, unfortunately. Other than installation, does t

Re: clojure jython interop

2012-05-25 Thread Ben Mabey
On 5/25/12 9:08 AM, Brent Millare wrote: Ok well installing is easy java -jar jython_installer-2.5.2.jar # to get python repl java -jar jython # to run script java -jar jython ./python.py I haven't looked into calling python functions (running in jython) from clojure though because unfortuna

Re: seeking a lazy way to interleave a constant

2012-04-09 Thread Ben Mabey
On 4/9/12 9:10 PM, Cedric Greevey wrote: On Mon, Apr 9, 2012 at 10:31 PM, Andrew wrote: Given a lazy sequence of numbers is there a way to interleave a constant and get another lazy sequence? Say the first sequence is 1 2 3 4 ... I'd like the second sequence to be 1 0 2 0 3 0 4 0 Thanks i

Re: seeking a lazy way to interleave a constant

2012-04-09 Thread Ben Mabey
On 4/9/12 8:31 PM, Andrew wrote: Given a lazy sequence of numbers is there a way to interleave a constant and get another lazy sequence? Say the first sequence is 1 2 3 4 ... I'd like the second sequence to be 1 0 2 0 3 0 4 0 Thanks in advance! Yep, and it is even called interleave. :)

Re: Adding primitive type hints to anonymous functions

2012-01-27 Thread Ben Mabey
On 1/26/12 5:07 AM, Cedric Greevey wrote: On Thu, Jan 26, 2012 at 5:54 AM, Tassilo Horn wrote: Cedric Greevey writes: On Thu, Jan 26, 2012 at 2:28 AM, Tassilo Horn wrote: At least, it seems that (fn ^double [^double x] (+ x 0.5)) compiles to a class supporting primitive, unboxed calls. Ye

Re: How to add a new type of collection?

2012-01-27 Thread Ben Mabey
On 1/27/12 9:11 AM, Walter van der Laan wrote: Are you somehow required to use the Java library? Otherwise you could also use a Clojure map as a sparse matrix. This will be much easier to implement. Using a clojure map to store a sparse matrix is not a good solution if you plan on doing any se

Re: No support for primitive type returns within protocols (1.3)?

2012-01-25 Thread Ben Mabey
On 1/25/12 1:41 PM, David Nolen wrote: On Wed, Jan 25, 2012 at 3:34 PM, Ben Mabey <mailto:b...@benmabey.com>> wrote: Hi again, Is it possible to add primitive type hints to protocols (as the return type)? My attempt below failed: (definterface IPrimitiveTester

No support for primitive type returns within protocols (1.3)?

2012-01-25 Thread Ben Mabey
Hi again, Is it possible to add primitive type hints to protocols (as the return type)? My attempt below failed: (definterface IPrimitiveTester (getType [^int x]) (getType [^long x]) (getType [^float x]) (getType [^double x]) (getType [^Object x])) (deftype PrimitiveTester [] IPr

Re: Adding primitive type hints to anonymous functions

2012-01-25 Thread Ben Mabey
On 1/25/12 2:25 AM, Tassilo Horn wrote: Hi again, I think, I got it. I wrote a little helper function to print the metadata of a form: --8<---cut here---start->8--- (use 'clojure.walk) (defn print-meta ([form level] (prewalk (fn [x]

Adding primitive type hints to anonymous functions

2012-01-24 Thread Ben Mabey
Does the new primitive support added in 1.3 extend to anonymous functions? If so, I am doing something wrong because I can't get them to work: (definterface IPrimitiveTester (getType [^int x]) (getType [^long x]) (getType [^float x]) (getType [^double x]) (getType [^Object x])) (defty

Re: How to add a new type of collection?

2012-01-24 Thread Ben Mabey
On 1/24/12 7:20 AM, Stuart Sierra wrote: The fundamental interfaces are all written in Java. ISeq, IPersistentCollection, and so on. You can implement then in deftype. Look at (ancestors (class [])) as a place to start. -S I believe the OP wanted to know if they could extend a java data str

Re: Matrix Multiplication Woes

2012-01-18 Thread Ben Mabey
On 1/17/12 5:22 PM, blcooley wrote: On Jan 17, 5:43 pm, Sam Ritchie wrote: Update -- I wrapped the JBLAS library and ended up with stellar performance, about 3x faster than numpy. https://gist.github.com/264a2756fc657140fdb8 You might not be interested at this point, but you can get better

Re: Proposal: libraries should have type hints

2011-11-22 Thread Ben Mabey
On 11/21/11 7:50 AM, Ralph wrote: I want to propose that Clojure libraries should be fully "type-hinted" -- that is, they should be compiled with the "*warn-on-reflection*" option turned on and type hints place wherever possible. I understand the argument against type-hinting end-user code until

Re: adding metadata to java objects

2011-11-17 Thread Ben Mabey
ated and so the original constructor never is called. The instantiated object is simply passed from one delegate to another with the different metadata associated on to it. -Ben On Nov 16, 2011, at 11:28 AM, Ben Mabey wrote: Hi, I would like to be able to add metadata to arbitrary java ob

adding metadata to java objects

2011-11-16 Thread Ben Mabey
Hi, I would like to be able to add metadata to arbitrary java objects that have already been instantiated. I know that you can use proxy to add metadata to objects that you create but in my case the object already exists (i.e. it is returned from another method call outside of my control). I

Re: Currently recommended CSV client, again ?

2011-10-04 Thread Ben Mabey
I needed a CSV recently and I wanted one that converted the rows to maps (using the headers) and supported converters. I found one[1] that did most of what I wanted and extended it a bit. The tests provide a good overview of the API: https://github.com/bmabey/csvlib/blob/master/test/csvlib_te

Re: Additional delay after pcalls?

2011-07-27 Thread Ben Mabey
On 7/27/11 11:19 AM, Ken Wesson wrote: On Wed, Jul 27, 2011 at 11:44 AM, mc4924 wrote: Hello everyone, I am a beginner with clojure and I am playing around with pcalls (I am using clojure 1.2.1). I see different behavior if I run some code from inside the REPL or launching it "form the command

  1   2   >