Re: OutOfMemoryError when using Plumatic Schema and infinite lazy lists

2017-12-10 Thread Jason Wolfe
Hi Alan, With validation turned on, Schema eagerly validates your full inputs so this is the expected (if a bit unfortunate) behavior. There is a little context on the issue and some potential workarounds here : https://github.com/plumatic/schema/issues/340#issuecomment-185321295 Best, Ja

Re: Lazy Flatten; One seq at a Time

2017-11-21 Thread Jason Wolfe
I think this will do it: (lazy-cat (first coll) (when-let [n (next coll)] (lazy-flatten n On Tuesday, November 21, 2017 at 2:34:15 PM UTC-8, Matt Anderson wrote: > > I have a f

Re: [ANN] Clojure 1.9.0-alpha5

2016-06-13 Thread Jason Wolfe
The warning should be fixed in schema 1.1.2. -Jason On Monday, June 13, 2016 at 10:46:09 AM UTC+8, Josh Tilles wrote: > > On Sunday, June 12, 2016 at 10:29:56 PM UTC-4, Alan Thompson wrote: >> >> I would have expected the namespaces to avoid this kind of conflict. Why >> don't they? >> > > Becau

Re: lazy-seq and somewhat greedy apply

2016-06-03 Thread Jason Wolfe
In case it's useful, here is a fully lazy variant of 'apply concat': https://github.com/plumatic/plumbing/blob/master/src/plumbing/core.cljx#L179 -Jason On Friday, June 3, 2016 at 2:26:43 AM UTC+8, Andy L wrote: > > Hi, > > I have a riddle I am not sure how to solve: > ``` > user=> (defn just-a-

Re: Validation of prismatic schema

2016-05-17 Thread Jason Wolfe
Hi! Can you please elaborate on the problem you are trying to solve? I notice a couple potential problems in your post, but it's difficult to provide helpful suggestions because you don't show the actual code you're running (for instance, the data you show appears to be in JSON and not Clojur

Re: strange (for me) problem with "No matching ctor found for class ..."

2016-05-07 Thread Jason Wolfe
Hi Johannes, I've run into this before. Here is a ticket [1] and some context and a potential workaround [2]: [1] http://dev.clojure.org/jira/browse/CLJ-1206 [2] https://groups.google.com/d/msg/clojure/BZwinR2zNgU/8HGOgzOxzosJ -Jason On Thursday, May 5, 2016 at 1:32:21 AM UTC+7, Johannes w

Re: Validation Benchmark

2016-04-19 Thread Jason Wolfe
ks! I've just updated the README to explain check and checker as well. > > > On Tue, Apr 19, 2016 at 7:30 AM, Jason Wolfe wrote: >> >> Thanks for putting this together! >> >> For schema, I think using `s/validate` is not a fair comparison with the >> o

Re: Validation Benchmark

2016-04-18 Thread Jason Wolfe
Thanks for putting this together! For schema, I think using `s/validate` is not a fair comparison with the other libraries -- as you mention, it throws an exception on error, and it also has to parse the schema each time. I think `s/checker` is the correct construct to use here -- it return

Re: Prismatic Schema -- Type signature of reducing functions

2016-04-02 Thread Jason Wolfe
Simplest would be to do something like this: (def Schema (s/cond-pre s/Int (s/constrained clojure.lang.Reduced #(integer? @% although this doesn't allow you to use the schema in both places. The right way would be to make a new `Reduced` schema: (defrecord Reduced [schema] schema.core/S

[ANN] schema-generators 0.1.0 (now with ClojureScript!)

2016-03-24 Thread Jason Wolfe
We've released schema-generators 0.1.0, which includes ClojureScript support via cljc: https://github.com/plumatic/schema-generators This library allows you to generate test data from most plumatic/schemas out of the box, as well as automatically "complete" partial datums -- which can both be

Re: Prismatic Schema - Why is "both" deprecated?

2016-03-07 Thread Jason Wolfe
t; > > On Sunday, 6 March 2016 18:48:21 UTC-8, Jason Wolfe wrote: >> >> In place of (s/both long (s/pred odd?)) you can do (s/conditional odd? >> long), but (s/constrained long odd?) probably provides better error messages >> (since it validates long before odd?). I

Re: Prismatic Schema - Why is "both" deprecated?

2016-03-06 Thread Jason Wolfe
In place of (s/both long (s/pred odd?)) you can do (s/conditional odd? long), but (s/constrained long odd?) probably provides better error messages (since it validates long before odd?). I think there are some examples in the readme. If this isn't what you're looking for, can you please provid

Re: Prismatic Schema - Self-reference in schema definitions

2016-03-06 Thread Jason Wolfe
If I'm understanding correctly, this sounds like a `schema.experimental.abstract-map-schema` to me (it's basically shorthand for what Bobby suggests) . There's an example in the readme. Best, Jason On Sunday, March 6, 2016 at 5:28:31 AM UTC+5:30, JvJ wrote: > > I've been using Schema, and the

Re: defmulti with prismatic schema

2016-01-18 Thread Jason Wolfe
You can find some context here and in the linked PRs: https://github.com/plumatic/schema/pull/119 Basically, the reason we don't have defmulti is that it's difficult to implement properly, and didn't seem worth the effort and maintenance cost. The simplest workaround is to create a schematize

Re: Prismatic Schema: Defining a schema for key-value pairs

2016-01-16 Thread Jason Wolfe
Currently, you would have to define your own schema type to control the error messages: https://github.com/plumatic/schema/wiki/Defining-New-Schema-Types-1.0 If you want to submit an issue, we can look into ways to make this simpler. Thanks! On Saturday, January 16, 2016 at 11:52:20 PM UTC, J

Re: Prismatic Schema: Defining a schema for key-value pairs

2016-01-16 Thread Jason Wolfe
Schemas are "path-independent", so you have to do this at the level of the map. The easiest way would be to use s/constrained with a predicate, e.g., user> (def my-map (s/constrained {Class Object} (fn matching-kvs? [m] (every? #(isa? (type (val %)) (key %)) m #'user/my-map user> (s/validat

Re: questions of Prismatic Schema and Org Babel Clojure

2015-12-26 Thread Jason Wolfe
This isn't a schema issue. Without invoking Schema: user> (do (defrecord Foo []) Foo) user.Foo user> (clojure.pprint/pprint (do (defrecord Foo2 []) Foo2)) CompilerException java.lang.RuntimeException: Unable to resolve symbol: Foo2 in this context, compiling:(/private/var/folders/_g/_nhxhpvn24

Re: [ANN] prismatic/schema 1.0 adds automatic test data generation

2015-10-26 Thread Jason Wolfe
is on clojure 1.7.0. > > -Jason > > > On Mon, Oct 26, 2015 at 11:58 AM, Jason Felice > wrote: > >> Thanks! >> >> I'll try it out this week and let you know. >> >> On Sun, Oct 25, 2015 at 8:28 PM, Jason Wolfe wrote: >> >>>

Re: [ANN] prismatic/schema 1.0 adds automatic test data generation

2015-10-25 Thread Jason Wolfe
FYI -- we just released Schema 1.0.2, which adds `s/constrained` for postconditions. -Jason On Thursday, September 3, 2015 at 3:05:29 PM UTC-3, Jason Felice wrote: > > > On Wed, Sep 2, 2015 at 9:56 PM, Jason Wolfe > > wrote: >> >> Outside of that, I can still po

Re: [ANN] prismatic/schema 1.0 adds automatic test data generation

2015-09-02 Thread Jason Wolfe
Since (as far as I can tell), I can't verify the type is numeric before > applying pos? > > I could do this: (s/conditional number? (s/pred pos?)), but I'm going to > guess this will defeat test.check support, which I'd like to use. > > Thoughts? > > On Tue, S

Re: [ANN] prismatic/schema 1.0 adds automatic test data generation

2015-09-02 Thread Jason Wolfe
; (require '[schema.coerce]) > > > > > CompilerException java.lang.RuntimeException: No such var: s/spec, > compiling:(schema/coerce.clj:31:28) > > > > - Matt > > On Tuesday, September 1, 2015 at 2:02:30 PM UTC-4, Jason Wolfe wrote: >> >> We&

[ANN] prismatic/schema 1.0 adds automatic test data generation

2015-09-01 Thread Jason Wolfe
We're excited to finally bring Schema out of alpha, while introducing some new exciting features around testing: test.check integration and data completion. Check out the blog post for details about these new applications. http://blog.getprismatic.com/schema-1-0-released/ We've also rewritten

Re: [ANN] sniper, emacs assistant for deleting dead code

2015-07-31 Thread Jason Wolfe
j-refactor -- feel free to do so, and I'm happy to answer questions if you have them. Otherwise, what kind of API are you looking for? > > > On Thursday, July 30, 2015 at 6:37:49 AM UTC+1, Jason Wolfe wrote: >> >> Didn't realize that existed, thanks! Looks lik

Re: [ANN] sniper, emacs assistant for deleting dead code

2015-07-29 Thread Jason Wolfe
Thanks for the feedback, I'll update the readme to add that now. On Wed, Jul 29, 2015 at 10:32 PM, dennis zhuang wrote: > Cool work. > > But missing installation or user guide in readme.md? I don't know how to > use it in my project. I want to try it. > > > 2015-07-30 13:26 GMT+08:00 benedek faz

Re: [ANN] sniper, emacs assistant for deleting dead code

2015-07-29 Thread Jason Wolfe
Didn't realize that existed, thanks! Looks like it's doing a similar (but more sophisticated) thing to find the references. But it doesn't look like it has the same graph analysis to understand cyclic references, etc, unless I missed it. On Wed, Jul 29, 2015 at 10:26 PM, benedek fazekas wrote:

[ANN] sniper, emacs assistant for deleting dead code

2015-07-29 Thread Jason Wolfe
Inspired by YAGNI, I made this code analyzer and emacs assistant for deleting dead code (and then used it to delete 10% of our codebase): https://github.com/w01fe/sniper *Motivation:* Over the years we've accumulated lots of dead code mixed into our namespaces, and getting rid of it manually

Re: [ANN] Clojure 1.7.0-RC2

2015-06-17 Thread Jason Wolfe
Thanks Alex (hope you had a great vacation)! Everything is looking good for us with RC2. On Wednesday, June 17, 2015 at 10:44:39 AM UTC-7, Alex Miller wrote: > > Clojure 1.7.0-RC2 is now available. > > Try it via > - Download: https://repo1.maven.org/maven2/org/clojure/clojure/1.7.0-RC2/ > - Lei

Re: Question regarding java array

2015-06-15 Thread Jason Wolfe
Might also be something to do with this: https://github.com/Prismatic/hiphip#performance-know-your-options On Monday, June 15, 2015 at 3:27:59 PM UTC-7, Ritchie Cai wrote: > > My java was 1.8.0_05-b13. Upgraded it. Now it's around 9ms, close enough. > > Thanks a lot. > > On Monday, June 15, 20

Re: [ANN] Clojure 1.7.0-RC1 now available

2015-05-22 Thread Jason Wolfe
or CLJ-1589 changed dispatch for InternalReduce, causing > a bug similar to CLJ-1237 [2]. > > [1] > https://github.com/clojure/clojure/commit/1242c4878f3d4ef30535a22f6c74144637504fbe > [2] http://dev.clojure.org/jira/browse/CLJ-1237 > > On Friday, May 22, 2015 at 5:01:25

Re: [ANN] Clojure 1.7.0-RC1 now available

2015-05-22 Thread Jason Wolfe
Just deployed to our staging environment and ran into an unexpected stack overflow error. Here's a reduced test case: user> (->> (range 1) (mapcat (fn [_] (java.util.ArrayList. (range 10 (reduce (constantly nil))) java.lang.StackOverflowError: RT.java:509 clojure.lang.RT.s

Re: [ANN] Clojure 1.7.0-RC1 now available

2015-05-22 Thread Jason Wolfe
We haven't shipped it to production yet, but I just verified that our full test suite at Prismatic passes on RC1 after fixing a few tests that were erroneously depending on hash ordering. Thanks everyone for all the hard work on this release! On Thursday, May 21, 2015 at 9:31:08 AM UTC-7, A

Re: [ANN] Clojure 1.7.0-beta1 released

2015-04-20 Thread Jason Wolfe
Just tried the beta on our test suite. Aside from warnings from new Clojure functions now shadowed by existing functions and obvious cases of hash sensitivity, there are a couple less clear-cut cases (which likely fall into the above hash case but will require further investigation), and we al

Re: Help sought on issue with AOT, hadoop, classloaders, and consistency of Clojure fn classes

2015-02-02 Thread Jason Wolfe
On Mon, Feb 2, 2015 at 7:12 AM, Marshall Bockrath-Vandegrift < llas...@gmail.com> wrote: > On Friday, January 30, 2015 at 5:00:31 PM UTC-5, Jason Wolfe wrote: > > Thanks for the recommendation. For now we're looking for a simple >> low-level interface to MR, but we

Re: Help sought on issue with AOT, hadoop, classloaders, and consistency of Clojure fn classes

2015-01-30 Thread Jason Wolfe
en or vice-versa? > > > On Thursday, January 29, 2015 at 2:39:54 AM UTC-5, Jason Wolfe wrote: >> >> First off, I apologize in advance for not having a reduced test case, and >> express my sincere gratitude in advance for any assistance. I've been >>

Re: Help sought on issue with AOT, hadoop, classloaders, and consistency of Clojure fn classes

2015-01-29 Thread Jason Wolfe
fo give enough context for anyone to offer a better solution? Thanks! Jason On Wednesday, January 28, 2015 at 11:39:54 PM UTC-8, Jason Wolfe wrote: > > First off, I apologize in advance for not having a reduced test case, and > express my sincere gratitude in advance for any assistance.

Re: Help sought on issue with AOT, hadoop, classloaders, and consistency of Clojure fn classes

2015-01-29 Thread Jason Wolfe
b and futz around with loading and reloading a few times I can get all the code to load, but haven't figured out yet if it's possible to turn this into a klutzy workaround... > > > On Wednesday, January 28, 2015 at 11:39:54 PM UTC-8, Jason Wolfe wrote: >> >> First off,

Re: Help sought on issue with AOT, hadoop, classloaders, and consistency of Clojure fn classes

2015-01-29 Thread Jason Wolfe
ound? Thanks for the quick reply! > > Sean > > On Jan 28, 2015, at 11:39 PM, Jason Wolfe > > wrote: > > First off, I apologize in advance for not having a reduced test case, and > express my sincere gratitude in advance for any assistance. I've been >

Help sought on issue with AOT, hadoop, classloaders, and consistency of Clojure fn classes

2015-01-28 Thread Jason Wolfe
First off, I apologize in advance for not having a reduced test case, and express my sincere gratitude in advance for any assistance. I've been tearing my hair out for a day or so and not making headway, and figured someone here might recognize some keywords and have a pointer in the right dir

Re: multimethod, record, type, and protocol pitfalls?

2014-10-27 Thread Jason Wolfe
Not sure if this is exactly what you're looking for, but there might be some relevant info here: https://github.com/Prismatic/eng-practices/blob/master/clojure/20130926-data-representation.md Comments/suggestions/questions welcome. -Jason On Sunday, October 26, 2014 8:48:29 AM UTC-7, Daniel

Re: Modelling in Clojure

2014-10-21 Thread Jason Wolfe
Hi Tom, Maybe this post from would be of use? https://github.com/Prismatic/eng-practices/blob/master/clojure/20130926-data-representation.md It's my best attempt (albeit a year or so old) to answer many of these questions. Happy to answer questions if you've got them. Cheers, Jason On Thu

Re: Why is my function faster with eval?

2014-10-10 Thread Jason Wolfe
Zipmap doesn't use transients, so calling it at runtime will be significantly slower than constructing a literal map. http://dev.clojure.org/jira/browse/CLJ-1005 On Friday, October 10, 2014 11:42:14 AM UTC-7, Michael Blume wrote: > > So I'm reading a bunch of rows from a huge csv file and mars

Re: Useless Java error messages

2014-09-01 Thread Jason Wolfe
Looks like you figured this out, but sharing in case it helps others. It turns out the JVM actually has a special caching mechanism for making NullPointerExceptions fast (and near-impossible to debug): http://stackoverflow.com/a/3010106 This link also has a JVM opt to stop this optimization, a

Re: Prismatic Schema: Unclear exception in subsequence validation

2014-08-13 Thread Jason Wolfe
Hi Francois, There have been a few threads about this on the plumbing mailing list, and there's an ongoing thread on Github as well. https://github.com/Prismatic/schema/pull/134#issuecomment-52088191 The upshot is that it's a fundamental limitation of `either` that it can't provide good error me

Re: Is Clojure fit for giant space-efficient in-memory tree structures?

2014-07-01 Thread Jason Wolfe
Vertigo might be worth a look? https://github.com/ztellman/vertigo On Thursday, June 26, 2014 9:04:34 PM UTC-7, Vjeran Marcinko wrote: > > Hi, > > I am planning to play with implementing some giant in-memory index that is > basically tree-like structure containing counters on certain tree nod

Re: 56 second GC on Heroku - seems a bit long

2014-06-17 Thread Jason Wolfe
Have you tried increasing your permgen size? Loading our codebase uses up just about all of the default Java permgen, and when it gets close to out I believe I've seen it thrashing the GC on the main heap. On Tuesday, June 17, 2014 6:38:46 AM UTC-7, Brian Marick wrote: > > > On Jun 16, 2014

ANN: [prismatic/plumbing 0.3.0] release adds ClojureScript support

2014-05-28 Thread Jason Wolfe
We’re excited to announce that Prismatic’s Plumbing and Graph library is now supported in ClojureScript, via cljx! We’ve also added an experimental parallel, asynchronous Graph compilation strategy using core.async that works in both Clojure and ClojureScript, and made a number of smaller addi

Re: Style - Keyword access or accessors?

2014-04-24 Thread Jason Wolfe
FWIW, internally we use a combination of schema and religious use of letk or safe-get and safe-get-in (from prismatic/plumbing) to pull things out of object-like maps, which together with reasonable test coverage seem to catch almost all of the keyword typos before they become bugs. The other

[ANN]: prismatic/schema and /plumbing 0.2.0

2014-01-09 Thread Jason Wolfe
It’s a twofer: [prismatic/schema “0.2.0”] Changes to the internal protocol for checking schemas, improving performance and enabling new applications such as schema coercion. Breaking changes: - Cross-platform leaves s/String and s/Number are now s/Str and s/Num - The Schema protocol has chang

Re: Core.async, Rules for passing clojure vals to go block

2014-01-03 Thread Jason Wolfe
duated input arguments. The only other way I can think to do that, > without using eval, would be to curry afn, for each input param. > Can you just use `apply`? > > > Tim Washington > Interruptsoftware.com <http://interruptsoftware.com> > > > On Fri, Jan 3, 2014

Re: Core.async, Rules for passing clojure vals to go block

2014-01-03 Thread Jason Wolfe
s are welcome. > > *"java.lang.RuntimeException: Can't embed object in code, maybe print-dup > not defined: clojure.lang.Atom@1c99db7 (NO_SOURCE_FILE:0)"* > > > > Thanks > > Tim Washington > Interruptsoftware.com <http://interruptsoftware.com

Re: Core.async, Rules for passing clojure vals to go block

2014-01-03 Thread Jason Wolfe
Thanks for the report. Schema fns inside of go blocks seem to work fine for me. It seems likely that you're seeing an exception inside the go block, which is swallowed by default: user> (clojure.core.async/go (println "A")) # A user> (clojure.core.async/go (throw (RuntimeException.)) (printl

Re: Should I be using deftype, gen-class or defrecord instead of this hack?

2013-12-13 Thread Jason Wolfe
You might find this post helpful: https://github.com/Prismatic/eng-practices/blob/master/clojure/20130926-data-representation.md It describes (my perspective on) the various Clojure data representation methods, their pros and cons, and some guidelines on when each may be appropriate. -Jason

Re: [ANN] strucjure 0.4.0

2013-12-09 Thread Jason Wolfe
Congrats, looks awesome -- looking forward to trying it out! -Jason On Monday, December 9, 2013 11:05:18 AM UTC-8, Jamie Brandon wrote: > > Better late than never :) > > https://github.com/jamii/strucjure > > Strucjure is a library for describing stuff in an executable manner. It > gives you p

Re: Typedef-like functionality for Clojure records?

2013-09-26 Thread Jason Wolfe
I'm not sure if this would meet your need (it doesn't help with your proximate defrecord issue), but if you're primarily interested in documentation and validation you could consider prismatic/schema [1] as a translation target, and just represent your data with maps. [1] https://github.com/Pri

Re: Efficiently typing an argument of implementation in deftype

2013-09-20 Thread Jason Wolfe
FWIW I observed the same thing profiling 1.5.1 with Yourkit a couple months ago and tried adding caching to the Clojure compiler, but I wasn't able to get any speedup. It wasn't clear to me if I messed something up, or if the profiler was just lying about where the execution time was actually g

Re: Hotspot predictability

2013-09-17 Thread Jason Wolfe
I've found similar things with compiling schema validators. Be careful with doseq benchmarks like this though, if you aren't careful hotspot can completely eliminate parts of the computation as dead code if it can infer the results aren't used. Criterion has a neat trick for making sure this

Re: Functional purity and "globals" in Clojure

2013-09-11 Thread Jason Wolfe
At Prismatic, we do this using Graph: https://github.com/Prismatic/plumbing I really try to avoid global vars, but passing through the seven parameters or resources you need through four layers of intermediate functions is also a hassle. Graph makes it easier to define your service in a functi

[ANN] Introducing prismatic/schema, a Clojure(Script) library for declarative data description and validation

2013-09-05 Thread Jason Wolfe
We're very excited to announce our first release of prismatic/schema, a cross-platform library for describing and validating data shapes. https://github.com/prismatic/schema http://blog.getprismatic.com/blog/2013/9/4/schema-for-clojurescript-data-shape-declaration-and-validation We'd love to he

Re: eval/macros with functions with metadata

2013-08-28 Thread Jason Wolfe
Sounds interesting, I'd love to hear more about the use case. We ran into this issue as well when implementing the new positional compilation for Graph. We filed a ticket [1], and worked around it with a funny trick: Suppose you want to eval a complicated thing, and the crux of the issue is

Re: Does this abstraction have any existing name?

2013-07-26 Thread Jason Wolfe
This is 'map-leaves' in our open-source lib plumbing.map (besides the option for additional args): https://github.com/Prismatic/plumbing/blob/master/src/plumbing/map.clj Cheers, Jason On Friday, July 26, 2013 8:49:14 AM UTC-7, Yoshinori Kohyama wrote: > > Hello group. > > I wrote a tiny macro t

Re: Prismatic Plumbing and Graph Open-Source Release

2013-07-18 Thread Jason Wolfe
;>> >>> Amazing work Prismatic team, is there a plan to release Flop? >>> >>> http://lanyrd.com/2012/clojurewest/spdfg/ >>> >>> Thanks! >>> Ronen >>> >>> >>> On Tuesday, January 29, 2013 8:46:54 PM UTC+2, Aria Haghig

Re: [ANN] First release of Prismatic's hiphip (array) library

2013-07-10 Thread Jason Wolfe
what > one should put in his project.clj to avoid tierred compilation. I'm > guessing a simple markup issue... > > Jim > > > On 10/07/13 18:13, Jason Wolfe wrote: > > We're excited to announce our first release of hiphip (array), a > > library for

[ANN] First release of Prismatic's hiphip (array) library

2013-07-10 Thread Jason Wolfe
We're excited to announce our first release of hiphip (array), a library for simple, performant array manipulation in Clojure. http://blog.getprismatic.com/blog/2013/7/10/introducing-hiphip-array-fast-and-flexible-numerical-computation-in-clojure Github: https://github.com/Prismatic/hiphip Than

Re: Clojure generates unnecessary and slow type-checks

2013-07-02 Thread Jason Wolfe
I know this is getting ridiculous but I'm preparing a presentation and > I was sort of counting on this example...Of course, it goes without > saying that I'm using unchecked-math and :jvm-opts ^replace[] . > > > am I doing something wrong? > > thanks for your time &

Re: Clojure generates unnecessary and slow type-checks

2013-06-29 Thread Jason Wolfe
This looks very interesting, thanks for sharing! I'll think about it a bit while working on our codebase and see if I can contribute any good examples. On Fri, Jun 28, 2013 at 7:17 AM, Mikera wrote: > On Thursday, 20 June 2013 08:45:47 UTC+1, Jason Wolfe wrote: >> >> On Sat

Re: Clojure generates unnecessary and slow type-checks

2013-06-20 Thread Jason Wolfe
On Saturday, June 15, 2013 4:37:06 AM UTC-7, Mikera wrote: > > On Friday, 14 June 2013 18:15:34 UTC+1, Jason Wolfe wrote: > >> Hey Mikera, >> >> I did look at core.matrix awhile ago, but I'll take another look. >> >> Right now, flop is just trying to

Re: ANN: Potemkin 0.3.0

2013-06-19 Thread Jason Wolfe
We're starting to use potemkin at Prismatic, and the part we've found most useful which Zach didn't mention in his post are the smart types. Especially definterface+, which is like a love child of defprotocol and definterface: - Same syntax as defprotocol, and defines functions in your namespa

Re: Clojure generates unnecessary and slow type-checks

2013-06-18 Thread Jason Wolfe
Yes, I agree that this is very confusing behavior -- I just chimed in on the pull request. Thanks again for your help and this follow-up. On Tue, Jun 18, 2013 at 12:03 PM, Stuart Sierra wrote: > Great. Glad we found it! > > Since this was so confusing, I've filed an issue with Leiningen to make

Re: Clojure generates unnecessary and slow type-checks

2013-06-18 Thread Jason Wolfe
d extra stuff to the host jvm-opts, thanks so much for your help with this! -Jason > > -S > > > On Thursday, June 13, 2013 4:50:48 PM UTC-4, Jason Wolfe wrote: >> >> Taking a step back, the core problem we're trying to solve is just to sum >> an array

Re: Clojure generates unnecessary and slow type-checks

2013-06-18 Thread Jason Wolfe
Hi Rich, I don't see any difference between 1.5.1 and 1.6.0 master. The good news is that Stuart Sierra nailed the problem above -- I had no idea that leiningen messed with jvm-opts in the host process, and that seems to have been solely responsible for the performance issues (so we're at Jav

Re: Clojure generates unnecessary and slow type-checks

2013-06-16 Thread Jason Wolfe
On Sat, Jun 15, 2013 at 4:37 AM, Mikera wrote: > On Friday, 14 June 2013 18:15:34 UTC+1, Jason Wolfe wrote: >> >> Hey Mikera, >> >> I did look at core.matrix awhile ago, but I'll take another look. >> >> Right now, flop is just trying to make it e

Re: Clojure generates unnecessary and slow type-checks

2013-06-16 Thread Jason Wolfe
On Fri, Jun 14, 2013 at 5:46 PM, Mikhail Kryshen wrote: > JIT will probably remove unnecessary checkcast instructions. What looks > suspicious to me is that i and asize are converted to longs (notice i2l > opcodes). I noticed earlier that loops with long counters are measurably > slower for the sa

Re: Clojure generates unnecessary and slow type-checks

2013-06-14 Thread Jason Wolfe
ully we can collaborate: I'm keen to get > the best optimised numerical functions we can in Clojure. Also, I think you > may find the core.matrix facilities very helpful when moving to higher level > abstractions (i.e. 2D matrices and higher order multi-dimensional arrays) > > >

Re: Clojure generates unnecessary and slow type-checks

2013-06-14 Thread Jason Wolfe
Thanks for your response. I attempted to answer this in my clarification, but our goal is to attack this 'general advice' and make it possible to get the same speed for array handling in natural-seeming Clojure without writing Java. In particular, we want to create macros that make it easy to

Re: Clojure generates unnecessary and slow type-checks

2013-06-13 Thread Jason Wolfe
Taking a step back, the core problem we're trying to solve is just to sum an array's values as quickly as in Java. (We really want to write a fancier macro that allows arbitrary computations beyond summing that can't be achieved by just calling into Java, but this simpler task gets at the crux

Re: Clojure in production

2013-06-11 Thread Jason Wolfe
Hi Plínio, At Prismatic (getprismatic.com), our entire backend (web crawling, machine learning, topic modeling, real-time ranking, API, web-servers, ...) is written in Clojure, and our frontend is moving towards 100% ClojureScript -- you can check out our blog at http://blog.getprismatic.com/ f

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

2013-05-11 Thread Jason Wolfe
Hi Colin, This is one of the reasons we created graph: https://github.com/prismatic/plumbing which is a general declarative mechanism for describing complex function compositions. There's not an awesome public example yet, but we use Graph at Prismatic to build our production services, where

Re: [ANN] Prismatic's Plumbing/Graph 0.1.0 is released with huge performance improvements

2013-05-02 Thread Jason Wolfe
the new release! > > Looking at the change log, I'm not sure I understand the following: > "Explicit output-schema metadata on a fnk is taken as gold, rather than > being merged with explicit data by analyzing the fnk body, and must be > explicit rather than a spec&quo

[ANN] Prismatic's Plumbing/Graph 0.1.0 is released with huge performance improvements

2013-05-01 Thread Jason Wolfe
Version 0.1.0 of Prismatic's Plumbing/Graph has just been released. The biggest change is backwards-compatible performance improvements of up to 40x for eager compilation, brining Graph to within 20% or so of hand-coded performance for trivial node functions. This was work done by Leon Barre

Re: Performance of calling primitive type hinted functions passed as arguments

2013-04-24 Thread Jason Wolfe
^clojure.lang.IFn$LO should work, although my guess is that this is considered an implementation detail and subject to change with new versions of Clojure. On Wednesday, April 24, 2013 10:15:49 AM UTC-7, Alice wrote: > > So, is there a way to type hint on cb that it has a function accepting > a

Re: What's the point of -> ?

2013-03-13 Thread Jason Wolfe
That's what <- is for :) https://github.com/Prismatic/plumbing/blob/master/src/plumbing/core.clj#L234 On Tuesday, March 12, 2013 4:37:58 AM UTC-7, Marko Topolnik wrote: > > On Tuesday, March 12, 2013 10:54:35 AM UTC+1, Laurent PETIT wrote: > >> >> or perhaps >> >> (-> response :body :postalCode

Re: Prismatic Plumbing and Graph Open-Source Release

2013-03-08 Thread Jason Wolfe
Hi, On Thu, Mar 7, 2013 at 7:53 PM, Brent Millare wrote: > Hi, > > Very nice work. I'm interested in using graph but just curious in terms of > your priorities for future development. Thanks! > I noticed that you listed as a todo, you might want to save the body of a > fnk which I see as a pote

Re: Prismatic Plumbing and Graph Open-Source Release

2013-02-10 Thread Jason Wolfe
> > > > Prismatic has open-sourced our Plumbing and Graph library on github< > https://github.com/prismatic/plumbing>. > > Jason Wolfe gave a talk< > http://blog.getprismatic.com/blog/2012/10/1/prismatics-graph-at-stran...>about > > how we use graph for sys

Re: Prismatic Plumbing and Graph Open-Source Release

2013-02-08 Thread Jason Wolfe
:c] (fnk [[:a b]] (inc b))}) > {:a {:b 1}}) > > >> {:a {:c 2}} > > So my question is: how do I refer to nested nodes in the output > selector using Graph? Conditionally, on that being impossible, would > there be any merit in the vector scheme that I have suggested ? >

Re: Prismatic Plumbing and Graph Open-Source Release

2013-02-07 Thread Jason Wolfe
emata is always 'true'. It's a bit odd, but to support specifications of functions/graphs that return nested maps, the outer layers need to be maps. It's true that the innermost layers could be represented as sets, but we chose to keep things uniform instead. > > > On Thu

Re: Prismatic Plumbing and Graph Open-Source Release

2013-02-07 Thread Jason Wolfe
er News thread, if that's your thing: http://news.ycombinator.com/item?id=5183236 Cheers, Jason On Tuesday, January 29, 2013 10:46:54 AM UTC-8, Aria Haghighi wrote: > > Hey all, > > Prismatic has open-sourced our Plumbing and Graph library on > github<https://github.c

Re: Prismatic Plumbing and Graph Open-Source Release

2013-02-07 Thread Jason Wolfe
January 29, 2013 10:46:54 PM UTC+4, Aria Haghighi wrote: >> >> Hey all, >> >> Prismatic has open-sourced our Plumbing and Graph library on >> github<https://github.com/prismatic/plumbing>. >> Jason Wolfe gave a >> talk<http://blog.getprisma

Re: Prismatic Plumbing and Graph Open-Source Release

2013-02-07 Thread Jason Wolfe
n possible syntax ? > > Thanks again, > > Edmund > On Tuesday, 29 January 2013 18:46:54 UTC, Aria Haghighi wrote: >> >> Hey all, >> >> Prismatic has open-sourced our Plumbing and Graph library on >> github<https://github.com/prismatic/plumbing

Re: Prismatic Plumbing and Graph Open-Source Release

2013-02-06 Thread Jason Wolfe
, > > Las > > 2013/1/29 Aria Haghighi > > >> Hey all, >> >> Prismatic has open-sourced our Plumbing and Graph library on >> github<https://github.com/prismatic/plumbing>. >> Jason Wolfe gave a >> talk<http://blog.getprismatic.com/blog/2

Re: ANN: babbage 1.0.0, a library for easily gathering data and computing summary measures in a declarative way

2013-02-02 Thread Jason Wolfe
Hi -- author of Prismatic's Graph here. (just released last week: https://github.com/prismatic/plumbing) This looks like a very cool library -- thanks for the release! You're right that our fnk and defnk take keyword rather than positional arguments, and in that sense are 'idiosyncratic'. But

Re: Question on mandatory arguments for -> and ->> macros

2012-10-11 Thread Jason Wolfe
On Thursday, October 11, 2012 10:29:57 AM UTC-7, Shantanu Kumar wrote: > > > > On Tuesday, 9 October 2012 06:07:06 UTC+5:30, Jason Wolfe wrote: >> >> >> >> On Sunday, October 7, 2012 9:27:15 PM UTC-7, Shantanu Kumar wrote: >>> >>> >>>

Re: Question on mandatory arguments for -> and ->> macros

2012-10-08 Thread Jason Wolfe
On Sunday, October 7, 2012 9:27:15 PM UTC-7, Shantanu Kumar wrote: > > > > On Monday, 8 October 2012 04:57:06 UTC+5:30, Stuart Sierra wrote: >> >> From the look of the source, there's no reason why ->> couldn't have >> arity-1. I guess it just doesn't come up much. >> > > Arity-1 for ->> would b

Re: heaps in clojure

2011-09-13 Thread Jason Wolfe
There is java.util.PriorityQueue, which is heap-based: http://download.oracle.com/javase/1,5.0/docs/api/java/util/PriorityQueue.html -Jason On Sep 13, 4:44 am, Sunil S Nandihalli wrote: > Hi Everybody, >  I have a very large, but with finite size, collection. I would like to get > like first 1

Re: Thoughts on CUDA + Clojure

2011-09-08 Thread Jason Wolfe
I haven't looked at aparapi [1] in detail, but it seems interesting and potentially useful for your quest: [1] http://developer.amd.com/zones/java/aparapi/pages/default.aspx -Jason On Sep 8, 11:43 am, Timothy Baldridge wrote: > I've been kicking around an idea for some time, of starting a > Clo

Re: generic math, comparator and arithmetic libs

2011-09-01 Thread Jason Wolfe
A couple nitpicks: > Right, and that's also the reason why there should be not=, with a default > implementation that does (not (= ...)). It can be expensive to establish > equality for a complex data structure, whereas inequality can be ascertained > at the first difference encountered. In th

Reify creates two objects?

2011-08-29 Thread Jason Wolfe
I came across the following behavior today, and wanted to make sure it's expected (on 1.2 and 1.3-beta2). Each time a reify form is executed, two fresh objects seem to be created; one is immediately thrown away, and the other is returned from the form: user=> (defn foo [] (let [x (reify Object (fi

Re: swank-clj 0.1.0 - a refactored swank-clojure, with sldb support

2011-05-28 Thread Jason Wolfe
On May 23, 5:49 am, "Hugo Duncan" wrote: > On Sun, 22 May 2011 18:09:50 -0400, Jason Wolfe wrote: > > 1.  The usual repl entry point is not used, and so, e.g., (set! *warn- > > on-reflection* true) fails. > > Thanks, I raised an issue to track this   > https

Re: swank-clj 0.1.0 - a refactored swank-clojure, with sldb support

2011-05-22 Thread Jason Wolfe
Looks really awesome -- I've been waiting for this since I switched to Clojure from CL! I played around with it a bit, and there are a couple issues that prevent it from being usable out of the box for me. 1. The usual repl entry point is not used, and so, e.g., (set! *warn- on-reflection* true)

Re: Fun: Write the fastest code that flattens nested maps of a particular type

2011-04-14 Thread Jason Wolfe
Here are some potentially interesting observations. First, as similar lazy and eager versions as I could come up with: (defn flatten-maps-lazy [coll] (lazy-seq (when-let [s (seq coll)] (let [m (first s)] (cons (dissoc m :c) (flatten-maps-lazy (con

Re: int or long as map key

2011-03-28 Thread Jason Wolfe
> Clojure 1.3.0-alpha* uses its own = function for map lookups specifically to > avoid this problem.  The = function is true for numbers of different types > but the same value.  Note that Java code dealing with Clojure maps using the > java.util.Map interface will still get the standard Java beha

  1   2   3   4   >