core.logic for constraint logic programming

2012-10-24 Thread nathanmarz
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 should use less than 200 CPU's and less than

Re: core.logic for constraint logic programming

2012-10-24 Thread nathanmarz
opened up an issue on Storm: https://github.com/nathanmarz/storm/issues/383 On Oct 24, 2:07 pm, David Nolen dnolen.li...@gmail.com wrote: On Wed, Oct 24, 2012 at 4:56 PM, nathanmarz nathan.m...@gmail.com wrote: I'm looking into rewriting Storm's resource scheduler using core.logic. I want

Re: core.logic for constraint logic programming

2012-10-24 Thread nathanmarz
Wow, thanks for the great information everyone. David – I don't know how we'll make it pluggable, I was thinking users could provide functions that return a set of constraints. And there would probably be a cost function that users could override as well. On Oct 24, 3:26 pm, Jamie Brandon

Clojure + jarjar to avoid dependency conflicts

2012-03-06 Thread nathanmarz
I've been playing around with the jarjar tool ( http://code.google.com/p/jarjar/ ) in order to package my jar to avoid dependency conflicts with other libs. It doesn't seem to work though with Clojure-created classfiles, even when using aot compilation. At runtime, when doing a require/use it

Re: Clojure 1.3 treatment of integers and longs

2011-10-21 Thread nathanmarz
to bend, it's you to adapt to the interop restrictions/conventions. If Java expects an Integer object somewhere make sure you are providing it. Luc P. On Thu, 20 Oct 2011 21:11:41 -0700 (PDT) nathanmarz nathan.m...@gmail.com wrote: Now I'm confused. So when I do this: (def i

Re: Clojure 1.3 treatment of integers and longs

2011-10-21 Thread nathanmarz
Yea let's chat on IRC. I'll ping you when I see you online. -Nathan On Oct 21, 4:24 am, Stuart Halloway stuart.hallo...@gmail.com wrote: Luc, what you're saying sounds to me like this is the way it is so deal with it. Can you give me some concrete code snippets showing why it's better to

Re: Clojure 1.3 treatment of integers and longs

2011-10-20 Thread nathanmarz
, 2011 at 5:14 PM, nathanmarz nathan.m...@gmail.com wrote: Here's a code example illustrating the problem I'm having: https://gist.github.com/1300034I've simplified it to the bare minimum necessary to illustrate the problem. Agree 100% that ints and longs are broken in Java. The hashcode

Re: Clojure 1.3 treatment of integers and longs

2011-10-20 Thread nathanmarz
Thanks, that clarifies the behavior. Regardless though, at some point the int is becoming a Long which is a change of type. I'm arguing that Clojure should box primitive ints as Longs. Stu, I wouldn't say Clojure's behavior makes it just work. For example, if I obtained by number using

Re: Clojure 1.3 treatment of integers and longs

2011-10-20 Thread nathanmarz
Oops, I meant Clojure should box primitive ints as Integers. :-) On Oct 20, 12:15 pm, nathanmarz nathan.m...@gmail.com wrote: Thanks, that clarifies the behavior. Regardless though, at some point the int is becoming a Long which is a change of type. I'm arguing that Clojure should box

Re: Clojure 1.3 treatment of integers and longs

2011-10-20 Thread nathanmarz
be explicit just as you do with pretty much any kind of Java interop. David On Thu, Oct 20, 2011 at 3:16 PM, nathanmarz nathan.m...@gmail.com wrote: Oops, I meant Clojure should box primitive ints as Integers. :-) On Oct 20, 12:15 pm, nathanmarz nathan.m...@gmail.com wrote

Re: Clojure 1.3 treatment of integers and longs

2011-10-20 Thread nathanmarz
20, 12:50 pm, David Nolen dnolen.li...@gmail.com wrote: On Thu, Oct 20, 2011 at 3:45 PM, nathanmarz nathan.m...@gmail.com wrote: But Clojure is already inconsistent. ints and Integers in interop are treated differently. The only way to make Clojure consistent is to either: Clojure

Re: Clojure 1.3 treatment of integers and longs

2011-10-20 Thread nathanmarz
ClassCastExceptions because the type changed. -Nathan On Oct 20, 6:19 pm, David Nolen dnolen.li...@gmail.com wrote: On Thu, Oct 20, 2011 at 4:11 PM, nathanmarz nathan.m...@gmail.com wrote: I'm not sure we're arguing about the same thing. I think that Clojure only supporting 64 bit

Re: Clojure 1.3 treatment of integers and longs

2011-10-20 Thread nathanmarz
arrange for the int version to be called, because no boxing would happen. On Oct 20, 9:11 pm, nathanmarz nathan.m...@gmail.com wrote: Now I'm confused. So when I do this: (def i (Integer/parseInt 1)) Is i a primitive int, a primitive long, or a Long object? -- You received

Re: Clojure 1.3 treatment of integers and longs

2011-10-19 Thread nathanmarz
Here's a code example illustrating the problem I'm having: https://gist.github.com/1300034 I've simplified it to the bare minimum necessary to illustrate the problem. Agree 100% that ints and longs are broken in Java. The hashcode/ equality stuff is messed up. Clojure can try really hard to hide

Clojure 1.3 treatment of integers and longs

2011-10-18 Thread nathanmarz
Hey all, I recently started upgrading Storm to Clojure 1.3, and I ran into various issues due to Clojure's treatment of integers and longs. In particular, I have a situation like the following: 1. A Java object returns me an int. Let's call this value v. 2. I put v into a map, and pass that map

Re: Clojure 1.3 treatment of integers and longs

2011-10-18 Thread nathanmarz
... David On Tue, Oct 18, 2011 at 5:00 PM, nathanmarz nathan.m...@gmail.com wrote: Hey all, I recently started upgrading Storm to Clojure 1.3, and I ran into various issues due to Clojure's treatment of integers and longs. In particular, I have a situation like the following: 1. A Java

Clojure DSL for Storm

2011-09-29 Thread nathanmarz
I've fleshed out and documented the Clojure DSL for Storm. There were quite a few people interested in this, and I figured the Clojure community at large would want to know about it. Here are the docs: https://github.com/nathanmarz/storm/wiki/Clojure-DSL And here is an example that uses

Re: Storm

2011-09-21 Thread nathanmarz
-Nathan On Sep 20, 10:41 pm, Baishampayan Ghose b.gh...@gmail.com wrote: Hi Nathan, On Tue, Sep 20, 2011 at 8:35 PM, nathanmarz nathan.m...@gmail.com wrote: Yesterday I open-sourced Storm at Strange Loop. Storm is a distributed and fault-tolerant realtime computation system hosted at https

Storm

2011-09-20 Thread nathanmarz
Yesterday I open-sourced Storm at Strange Loop. Storm is a distributed and fault-tolerant realtime computation system hosted at https://github.com/nathanmarz/storm Just want to preempt a few questions that I know people are wondering about the project: Is Storm mostly written in Java? If you

ANN: ElephantDB, a distributed database written in Clojure

2011-02-24 Thread nathanmarz
about the project, check out our introductory blog post and the GitHub repos. http://tech.backtype.com/introducing-elephantdb-a-distributed-database https://github.com/nathanmarz/elephantdb https://github.com/nathanmarz/elephantdb-cascalog -- You received this message because you are subscribed

Re: ANN: ElephantDB, a distributed database written in Clojure

2011-02-24 Thread nathanmarz
Clojure's not even close to being a bottleneck in this database. The performance is limited by the underlying storage engine which is currently Berkeley DB Java Edition. On Feb 24, 4:21 pm, rogerdpack rogerpack2...@gmail.com wrote: How was clojure speed-wise for you? Was it blazingly fast? Just

Generating type hints dynamically

2010-09-28 Thread nathanmarz
I'm having problems creating functions with the type hints generated dynamically. As a contrived example (my actual use case is somewhat complicated), let's say I want to make a macro that takes in as input a class symbol and returns a type hinted function that calls a method on the argument:

Re: Generating type hints dynamically

2010-09-28 Thread nathanmarz
That worked great, thanks. On Sep 28, 5:42 pm, ataggart alex.tagg...@gmail.com wrote: Type hints are just metadata. Instead of emitting the type-hint from the macro, you set the :tag metadata on the relevant symbol. On Sep 28, 5:20 pm, nathanmarz nathan.m...@gmail.com wrote: I'm having

Clojure-based query language for Hadoop

2010-04-16 Thread nathanmarz
page: http://github.com/nathanmarz/cascalog -- You received this message because you are subscribed to the Google Groups Clojure group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post