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,

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

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? >> > >

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

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

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

Re: Validation Benchmark

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

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

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]

[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
f neither > of them are? > > > 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 valida

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

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

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

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>

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,

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,

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

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

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 <ja...@w01fe.com > > wrote: >> >> Outside of tha

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

2015-09-02 Thread Jason Wolfe
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're excited to finally bri

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

2015-09-02 Thread Jason Wolfe
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, Sep 1, 2015 at 2:02 PM, Jason Wolfe <ja...

[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

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

2015-07-31 Thread Jason Wolfe
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 like it's doing a similar (but more sophisticated) thing to find

[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] 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

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 killme2...@gmail.com 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

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/ -

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, 2015 at

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,

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.seq

Re: [ANN] Clojure 1.7.0-RC1 now available

2015-05-22 Thread Jason Wolfe
-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 PM UTC-4, Jason Wolfe wrote: Just

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

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 also keeping an eye on parkour

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

2015-01-30 Thread Jason Wolfe
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 tearing my hair out for a day or so and not making headway, and figured someone here might recognize some keywords

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

2015-01-29 Thread Jason Wolfe
PM, Jason Wolfe ja...@w01fe.com javascript: 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 tearing my hair out for a day or so and not making headway, and figured someone here might

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

2015-01-29 Thread Jason Wolfe
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. I've been tearing my hair out for a day or so

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

2015-01-29 Thread Jason Wolfe
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, I apologize in advance for not having a reduced test case

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

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

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

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,

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

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 nodes,

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

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

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)) #ManyToManyChannel

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

2014-01-03 Thread Jason Wolfe
Interruptsoftware.com http://interruptsoftware.com On Fri, Jan 3, 2014 at 2:39 PM, Jason Wolfe ja...@w01fe.com javascript: wrote: 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

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

2014-01-03 Thread Jason Wolfe
* into individuated 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 at 7:20 PM, Jason Wolfe ja...@w01fe.com

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 pattern

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]

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

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

[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

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 to

Re: Prismatic Plumbing and Graph Open-Source Release

2013-07-18 Thread Jason Wolfe
to release Flop? http://lanyrd.com/2012/clojurewest/spdfg/ Thanks! Ronen On Tuesday, January 29, 2013 8:46:54 PM UTC+2, Aria Haghighi wrote: Hey all, Prismatic has open-sourced our Plumbing and Graph library on github. Jason Wolfe gave a talk about how we use graph for systems composition

[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

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

2013-07-10 Thread Jason Wolfe
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 simple, performant array manipulation in Clojure. http://blog.getprismatic.com

Re: Clojure generates unnecessary and slow type-checks

2013-07-02 Thread Jason Wolfe
On Fri, 14 Jun 2013 00:11:52 -0700 (PDT) Jason Wolfe ja...@w01fe.com wrote: 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

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 mike.r.anderson...@gmail.comwrote: On Thursday, 20 June 2013 08:45:47 UTC+1, Jason Wolfe wrote

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 make it easy to write *arbitrary* array operations

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

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

Re: Clojure generates unnecessary and slow type-checks

2013-06-18 Thread Jason Wolfe
run it without Leiningen to make sure I know what's going on. This was our issue. We had no idea that Leiningen added 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

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 the.stuart.sie...@gmail.com wrote: Great. Glad we found it! Since this was so confusing, I've filed an

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 mikh...@kryshen.net 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

Re: Clojure generates unnecessary and slow type-checks

2013-06-16 Thread Jason Wolfe
On Sat, Jun 15, 2013 at 4:37 AM, Mikera mike.r.anderson...@gmail.com 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 easy to write *arbitrary* array

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-14 Thread Jason Wolfe
may find the core.matrix facilities very helpful when moving to higher level abstractions (i.e. 2D matrices and higher order multi-dimensional arrays) On Thursday, 13 June 2013 21:50:48 UTC+1, Jason Wolfe wrote: Taking a step back, the core problem we're trying to solve is just to sum

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/

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
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 Thx Sent from my phone On May 1, 2013 8:46 PM, Jason Wolfe ja...@w01fe.com javascript

[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

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 :postalCodes (- (map

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 brent.mill...@gmail.com 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

Re: Prismatic Plumbing and Graph Open-Source Release

2013-02-10 Thread Jason Wolfe
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 systems composition at Strange loop last year. Please give the library a whirl and let us know if you're using

Re: Prismatic Plumbing and Graph Open-Source Release

2013-02-08 Thread Jason Wolfe
hope I haven't obscured my question. I also get the feeling that I must be missing something very obvious in your code for how to do this ! Edmund On Thursday, 7 February 2013 19:27:13 UTC, Jason Wolfe wrote: On Thu, Feb 7, 2013 at 10:54 AM, AtKaaZ atk...@gmail.com wrote: Hello

Re: Prismatic Plumbing and Graph Open-Source Release

2013-02-07 Thread Jason Wolfe
has open-sourced our Plumbing and Graph library on githubhttps://github.com/prismatic/plumbing. Jason Wolfe gave a talkhttp://blog.getprismatic.com/blog/2012/10/1/prismatics-graph-at-strange-loop.htmlabout how we use graph for systems composition at Strange loop last year. Please give

Re: Prismatic Plumbing and Graph Open-Source Release

2013-02-07 Thread Jason Wolfe
Haghighi wrote: Hey all, Prismatic has open-sourced our Plumbing and Graph library on githubhttps://github.com/prismatic/plumbing. Jason Wolfe gave a talkhttp://blog.getprismatic.com/blog/2012/10/1/prismatics-graph-at-strange-loop.htmlabout how we use graph for systems composition at Strange

Re: Prismatic Plumbing and Graph Open-Source Release

2013-02-07 Thread Jason Wolfe
, 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 githubhttps://github.com/prismatic/plumbing. Jason Wolfe gave

Re: Prismatic Plumbing and Graph Open-Source Release

2013-02-07 Thread Jason Wolfe
in the Hacker 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. Jason Wolfe gave a talk about

Re: Prismatic Plumbing and Graph Open-Source Release

2013-02-06 Thread Jason Wolfe
library on githubhttps://github.com/prismatic/plumbing. Jason Wolfe gave a talkhttp://blog.getprismatic.com/blog/2012/10/1/prismatics-graph-at-strange-loop.htmlabout how we use graph for systems composition at Strange loop last year. Please give the library a whirl and let us know if you're

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'.

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: On Monday, 8 October 2012 04:57:06 UTC+5:30, Stuart Sierra wrote: From the look

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 be useful to let

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 sunil.nandiha...@gmail.com wrote: Hi Everybody,  I have a very large, but with finite size, collection. I would

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 tbaldri...@gmail.com wrote: I've been kicking around an idea for some time,

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 those

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

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 duncan.h...@gmail.com wrote: On Sun, 22 May 2011 18:09:50 -0400, Jason Wolfe ja...@w01fe.com 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*

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

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

  1   2   3   >