Re: Best practices for java libraries

2012-12-10 Thread xavriley
You might like to checkout some of the videos from ClojureX recently. One was called 'playing nice with Java' and the other was a 10 min lightning talk by Rich Hickey on how they use Java in the Datomic project. I've only just joined the list so I don't want to get swept up in spam filters on

Re: Interop question concerning optional args

2012-12-10 Thread Andy Fingerhut
You can pass in a length 0 array of java.nio.file.attribute.FileAttribute's like so: (java.nio.file.Files/createTempDirectory "mytempname" (make-array java.nio.file.attribute.FileAttribute 0)) Andy On Dec 10, 2012, at 8:54 PM, Dave Kincaid wrote: > I just came across this same problem while

Re: core.logic vs. Prolog

2012-12-10 Thread David Nolen
core.logic is still pretty young - some (many?) Prolog niceties may not be present. Don't know until you try ;) On Tue, Dec 11, 2012 at 12:29 AM, JvJ wrote: > I have some code that uses Prolog, but I want to get rid of the native > dependencies inherent in SWI Prolog/JPL. > > If I were to switc

core.logic vs. Prolog

2012-12-10 Thread JvJ
I have some code that uses Prolog, but I want to get rid of the native dependencies inherent in SWI Prolog/JPL. If I were to switch to core.logic, what would I lose and what would I gain? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to th

Re: Interop question concerning optional args

2012-12-10 Thread Dave Kincaid
I just came across this same problem while trying to use Java 7's java.nio.file.Files.createTempDirectory() (http://docs.oracle.com/javase/7/docs/api/java/nio/file/Files.html#createTempDirectory(java.lang.String, java.nio.file.attribute.FileAttribute...)) Clojure won't let me just do (java.nio

Re: Proposal/request: Give clojure.core/conj a unary implementation

2012-12-10 Thread Yoshinori Kohyama
+1 2012年11月4日日曜日 7時27分24秒 UTC+9 CGAT: > > It would be nice if clojure.core/conj had a unary implementation > >([coll] coll) > > The motivating use case is when one is conjoining sequences of > items to a collection all at once: > >(apply conj coll seqable) > > such as (apply conj #

Re: How to add an URL into the classpath?

2012-12-10 Thread Yoshinori Kohyama
Hi Vladimir and Alex, Thank you for very useful informations. With regards, Yoshinori Kohyama -- 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 moderat

How things are going about expansion, class creation and loading of procedures

2012-12-10 Thread Yoshinori Kohyama
Hello all. I thank developers of and on clojure always for giving me great programming experience. Now I want to reduce overhead of class-loading because I run applications in embedded computers with slow storage. How can I check * when each procedure is expanded, * if a class file is created

Re: A Working nrepl-ritz Setup?

2012-12-10 Thread Charles Comstock
Perhaps this discussion should move to the nrepl-el mailing list or the like, but I just discovered a bit more trying to figure this out. I noted that the .lein/profiles.clj documentation had been updated in the ritz/nrepl documentation. Namely that :hooks is scoped to the :user block and not a

Re: Is There A Way To Exit ClojureScript REPL

2012-12-10 Thread Asim Jalis
Thanks! Just realized it says that when the prompt starts—I hadn’t noticed it. On Mon, Dec 10, 2012 at 1:47 PM, Devin Walters wrote: > cljs/quit -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegrou

Re: A Working nrepl-ritz Setup?

2012-12-10 Thread Charles Comstock
No, that wasn't the problem, early on when I tried to use nrepl and ritz I experimented with clojure 1.5, but as far as I know all of these issues I encountered after switching back to 1.4. In response to someone elses question, I also was definitely using fresh copies of nrepl, presuming all t

Re: Best practices for java libraries

2012-12-10 Thread Grant Rettke
Sounds like a good candidate for the Clojure documentation project. On Mon, Dec 10, 2012 at 5:33 PM, Mikera wrote: > Some thoughts from various Java libraries I have wrapped: > > - Normal functions are generally best for wrapping > - It can often make sense to have a protocol that dispatched on t

Re: [ANN] Dibble - A new way to seed databases

2012-12-10 Thread Michael Drogalis
Thanks Brian! I'll check it out soon and let you know if I make any headway with integration. On Monday, December 10, 2012 1:35:58 PM UTC-5, Brian Marick wrote: > > Here's the SCNA talk link > > http://scna.softwarecraftsmanship.org/media#videos > > > On Nov 11, 2012, at 5:28 PM, Michael Drogal

Re: New System Architecture in Clojure

2012-12-10 Thread ArturoH
Mikera, Thank you for your reply, potentially it would include many machines. But the main motivation is to write less code, abstracting the actual implementation. I read that Storm is an implementation of Hadoop, I don't think I need to process that much data. But if I was I would like to be

Re: New System Architecture in Clojure

2012-12-10 Thread Mikera
I think Clojure would be a great choice for this. When you say "systemwide" though I assume you mean a lot of distributed processing across many machines? In that case you should probably be looking at Storm, Aleph, Pallet, Ring and the host of other Clojure libraries in that general area. What

Re: Best practices for java libraries

2012-12-10 Thread Mikera
Some thoughts from various Java libraries I have wrapped: - Normal functions are generally best for wrapping - It can often make sense to have a protocol that dispatched on the type of the Java object and/or clojure params for polymorphism and extension. Your public functions should often call t

Re: core.logic vs datomic

2012-12-10 Thread Herwig Hochleitner
In my very incomplete understanding, the main difference between datalog and core.logic is that datalog is set-oriented and core.logic is tuple-oriented. Also datalog is designed to join and filter on external datasources, while in core.logic, fresh vars (i.e. join points ??) also can be created in

New System Architecture in Clojure

2012-12-10 Thread ArturoH
Everybody, I'd like to define a systemwide data structure with Clojure. I'd like it to represent input data, and derived data. Some specified derived data could be temporary for the calculation of other derived data. I also would like to use functions to specify the derivation of data. The idea

Re: leiningen and updating project versions

2012-12-10 Thread Phil Hagelberg
On Sun, Dec 9, 2012 at 12:18 AM, Dave Sann wrote: > Has anyone looked at how to manage snapshots and dependencies in projects > with checkouts - where the checkouts (also snapshots) are being edited along > with the main project? We have so far punted on tasks that perform automated changes to pr

Re: Is There A Way To Exit ClojureScript REPL

2012-12-10 Thread Devin Walters
Have you tried :cljs/quit ? Cheers, -- '(Devin Walters) On Monday, December 10, 2012 at 3:23 PM, Asim Jalis wrote: > Is there a way to exit the ClojureScript REPL? None of these worked: Ctrl-D, > exit. (exit 1), quit, (quit 1). So eventually I killed the window. > > -- > You received this

Is There A Way To Exit ClojureScript REPL

2012-12-10 Thread Asim Jalis
Is there a way to exit the ClojureScript REPL? None of these worked: Ctrl-D, exit. (exit 1), quit, (quit 1). So eventually I killed the window. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.c

Best practices for java libraries

2012-12-10 Thread Michael Grubb
I've been searching for some best practices when it comes to wrapping existing Java libraries to make them more "clojurized." Unfortunately I've not found much. While I know enough to make something that works for me, I'd like to write it in such a manner that it can be used (and read) by others

Re: abysmal multicore performance, especially on AMD processors

2012-12-10 Thread Wm. Josiah Erikson
Interesting. I tried the following: :jvm-opts ["-Xmx10g" "-Xms10g" "-XX:+AggressiveOpts" "-server" "-XX:+TieredCompilation" "-XX:ReservedCodeCacheSize=256m" "-XX:TLABSize=1G" "-XX:+PrintGCDetails" "-XX:+PrintGCTimeStamps" "-XX:+UseParNewGC" "-XX:+ResizeTLAB" "-XX:+UseTLAB"] I got a slight slowdown

Re: abysmal multicore performance, especially on AMD processors

2012-12-10 Thread Marshall Bockrath-Vandegrift
"Wm. Josiah Erikson" writes: > Aha. Not only do I get a lot of "made not entrant", I get a lot of > "made zombie". However, I get this for both runs with map and with > pmap (and with pmapall as well) I’m not sure this is all that enlightening. From what I can gather, “made not entrant” just me

Re: class loaders stack constant grow in REPL

2012-12-10 Thread Chas Emerick
Good catch, guys. Interesting that I never noticed this; likely because Pomegranate's `classloader-hierarchy` function ends up starting its walk from (RT/baseLoader) (which will be changing to the context classloader shortly): https://github.com/cemerick/pomegranate/blob/master/src/mai

Re: Starting to use Clojure, Yeah!

2012-12-10 Thread Manuel Paccagnella
Welcome! :) Il giorno venerdì 7 dicembre 2012 04:16:28 UTC+1, Xiaodan Yuan ha scritto: > > Yeah! > -- 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 mode

Re: class loaders stack constant grow in REPL

2012-12-10 Thread Tassilo Horn
Colin Jones writes: Hi Colin, > Right, this is because nREPL uses clojure.main/repl each time it does > an evaluation. See http://dev.clojure.org/jira/browse/NREPL-31 for a > related issue that was addressed by modifying clojure.main/repl. > > I'm not sure where a fix for this would belong (nREP

Re: abysmal multicore performance, especially on AMD processors

2012-12-10 Thread Wm. Josiah Erikson
I tried some more performance tuning options in Java, just for kicks, and didn't get any advantages from them: "-server" "-XX:+TieredCompilation" "-XX:ReservedCodeCacheSize=256m" Also, in case it's informative: [josiah@compute-1-17 benchmark]$ grep entrant compilerOutputCompute-1-1.txt | wc -l 17

Re: class loaders stack constant grow in REPL

2012-12-10 Thread Vladimir Tsichevski
Thank you Colin, I think, the main problem is nobody has ever tried to write an article "Class loading in Clojure". If such article existed, it would make life much easier for many developers. Regards, Vladimir On Monday, December 10, 2012 8:32:36 PM UTC+4, Colin Jones wrote: > > Right, this i

Re: [ANN] Dibble - A new way to seed databases

2012-12-10 Thread Brian Marick
Here's the SCNA talk link http://scna.softwarecraftsmanship.org/media#videos On Nov 11, 2012, at 5:28 PM, Michael Drogalis wrote: > Interestingly enough, I did something very similar to Peano. The difference > is that my version used a "base value" and constraints are used to adjust > that v

Re: abysmal multicore performance, especially on AMD processors

2012-12-10 Thread Wm. Josiah Erikson
Aha. Not only do I get a lot of "made not entrant", I get a lot of "made zombie". However, I get this for both runs with map and with pmap (and with pmapall as well) For instance, from a pmapall run: 33752 159 clojure.lang.Cons::next (10 bytes) made zombie 33752 164

Re: class loaders stack constant grow in REPL

2012-12-10 Thread Colin Jones
Right, this is because nREPL uses clojure.main/repl each time it does an evaluation. See http://dev.clojure.org/jira/browse/NREPL-31 for a related issue that was addressed by modifying clojure.main/repl. I'm not sure where a fix for this would belong (nREPL or clojure.main), but I went ahead an

Re: abysmal multicore performance, especially on AMD processors

2012-12-10 Thread meteorfox
> > - Parallel allocation of `Cons` and `PersistentList` instances through > a Clojure `conj` function remains fast as long as the function only > ever returns objects of a single concrete type A possible explanation for this could be JIT Deoptimization. Deoptimization happens when

Re: Clojure contrib datalog

2012-12-10 Thread Bronsa
There's also https://github.com/fogus/bacwn 2012/12/10 Alexander Solovyov > Hi, > > I don't think it's maintained somewhere (at least I haven't seen > anything), but at some point in past I extracted it from sources of > clojure-contrib and put it on github (with few updates to code, nothing > m

Re: ClojureScript Browser REPL Unable To Find goog.async.Deferred

2012-12-10 Thread Brent Millare
This thread may be some help https://groups.google.com/forum/?fromgroups=#!searchin/clojure/brent/clojure/DmnPwrVvfW8/qgnp6MTVWusJ On Sunday, December 9, 2012 11:53:16 AM UTC-5, Asim Jalis wrote: > > Hi, > > I am trying to follow the Quick Start steps to get a ClojureScript REPL in > a browser.

Re: Clojure contrib datalog

2012-12-10 Thread Alexander Solovyov
Hi, I don't think it's maintained somewhere (at least I haven't seen anything), but at some point in past I extracted it from sources of clojure-contrib and put it on github (with few updates to code, nothing major): https://github.com/piranha/datalog On Sun, Dec 9, 2012 at 1:15 PM, Shantanu Ku

Re: Combining maps and finite domains in core.logic returns only one result

2012-12-10 Thread Frederik De Bleser
FYI this works with vectors: (run* [q] (fresh [x] (infd x (interval 1 3)) (== q [x]))) ;=> ([1] [2] [3]) But lcons seems to fail as well: (run* [q] (fresh [x] (infd x (interval 1 3)) (== q (lcons x 'foo ;=> ((1 . foo)) Kind regards, Frederik -- You received this mes

Combining maps and finite domains in core.logic returns only one result

2012-12-10 Thread Frederik De Bleser
Hey, I'm trying to combine maps with finite domains with some odd results. A simple query using finite domains correctly returns all values: (run* [q] (fresh [x] (infd x (interval 1 3)) (== q x))) ;=> (1 2 3) But putting this result in a map returns only the first value: (run* [q]

Re: STM - a request for "war stories"

2012-12-10 Thread Marko Topolnik
On Monday, December 10, 2012 3:17:27 PM UTC+1, Chas Emerick wrote: > > On Dec 10, 2012, at 8:37 AM, Marko Topolnik wrote: > > It's true that STM is "all or nothing", but it is so over the scope of >> refs you choose. If there's some side-effecting bit you need to do >> somewhere, then clearly

Re: STM - a request for "war stories"

2012-12-10 Thread Marko Topolnik
On Monday, December 10, 2012 3:15:04 PM UTC+1, Paul Butcher wrote: > > On 10 Dec 2012, at 13:37, Marko Topolnik > > wrote: > > But concurrency is *all* about performance and throughput. So where is > the benefit of using correct, slow concurrent mutation? I guess in a > write-seldom, read-ofte

Re: what Jetty jars do I need for WebSockets?

2012-12-10 Thread Jay Fields
The upside of using Java is that it's very widely documented. Also, I find people on this mailing list to be very helpful. Nonetheless, I'm sure it's frustrating to have to learn about Java when you just want to do some Clojure. I've previously written about using Webbit with Clojure: http://blog.

Re: what Jetty jars do I need for WebSockets?

2012-12-10 Thread larry google groups
Thank you. I will do that. I find that trying to learn both Clojure and the JVM (which automatically entails parts of the Java eco-system), is a little overwhelming at first. But I suppose that is true of learning anything new. On Sunday, December 9, 2012 9:04:44 PM UTC-5, Jay Fields wrote: >

Re: STM - a request for "war stories"

2012-12-10 Thread Chas Emerick
On Dec 10, 2012, at 8:37 AM, Marko Topolnik wrote: > It's true that STM is "all or nothing", but it is so over the scope of refs > you choose. If there's some side-effecting bit you need to do somewhere, > then clearly that's not going to fit within a transaction…but that bit will > often fit

Re: STM - a request for "war stories"

2012-12-10 Thread Paul Butcher
On 10 Dec 2012, at 13:37, Marko Topolnik wrote: > But concurrency is all about performance and throughput. So where is the > benefit of using correct, slow concurrent mutation? I guess in a > write-seldom, read-often scenario. I'm not at all sure that that's true. There are plenty of occasions

Re: STM - a request for "war stories"

2012-12-10 Thread Paul Butcher
On 10 Dec 2012, at 12:56, Chas Emerick wrote: > I'd be surprised if Paul doesn't hear from people directly I wish that that were true, but no, I've not had anyone get in touch off-list. Many thanks, Marko, for resurrecting the thread - I'm still definitely keen to hear of first-hand experience

Re: STM - a request for "war stories"

2012-12-10 Thread Marko Topolnik
On Monday, December 10, 2012 1:56:08 PM UTC+1, Chas Emerick wrote: > > On Dec 10, 2012, at 5:39 AM, Marko Topolnik wrote: > > I personally have never used STM in nontrivial ways (AFAIC), but that's > due more to the demands of the problems I run into more than anything else. > On the other ha

Re: STM - a request for "war stories"

2012-12-10 Thread Chas Emerick
On Dec 10, 2012, at 5:39 AM, Marko Topolnik wrote: > The very fact that there has been no reply to this for five days may mean > something. I can personally attest to STM being very difficult to put to > real-life use because there is always that one thing you absolutely need for > your problem

Re: Clojure raytracing scene description language

2012-12-10 Thread Mikera
Hi Brandon, I'm thinking to allow for animations via two main methods: a) A "time" parameter that can be inserted in formulae to allow variation over frames. Good for simple animation. b) Allowing procedural generation of multiple frames from regular Clojure code. So you could theoretically run a

Re: Clojure raytracing scene description language

2012-12-10 Thread Mikera
Yep, I'll probably use the trick I used in clisk and chunk the image up into different pieces that can be handed off to different processors. Also I'm planning to make the scene data structures immutable, so the concurrent access should work nicely. Long term goal might be to do some distributi

Re: Clojure raytracing scene description language

2012-12-10 Thread Mikera
Thanks for some great links! I want to build a custom renderer mainly because I like an interesting challenge :-) Also I've written a couple of renderers before and I reckon it's a fairly manageable task. I also think that to make a really good Clojure DSL it is important to design the underl

Re: abysmal multicore performance, especially on AMD processors

2012-12-10 Thread Marshall Bockrath-Vandegrift
cameron writes: > There does seem to be something unusual about conj and > clojure.lang.PersistentList in this parallel test case and I don't > think it's related to the JVMs memory allocation. I’ve got a few more data-points, but still no handle on what exactly is going on. My last benchmark s

Re: Clojure raytracing scene description language

2012-12-10 Thread Mikera
I'd like to keep it close to POVRay if possible. Although I think there is a good opportunity to "clojurize" the POVRay syntax and also iron out a few rough edges. Also, I'm hoping to the automatic generation of scenes much more powerful. The POVRay macro language is OK for what it is designed

Re: abysmal multicore performance, especially on AMD processors

2012-12-10 Thread Marko Topolnik
The main GC feature here are the Thread-Local Allocation Buffers. They are on by default and are "automatically sized according to allocation patterns". The size can also be fine-tuned with the -XX:TLABSize=nconfiguration option. You may consider tweaking this setting to optimize runtime. Basic

Re: STM - a request for "war stories"

2012-12-10 Thread Marko Topolnik
The very fact that there has been no reply to this for five days may mean something. I can personally attest to STM being very difficult to put to real-life use because there is always that one thing you absolutely need for your problem, that is mutable and not transactional. Most of the time i

Re: Clojure raytracing scene description language

2012-12-10 Thread Karsten Schmidt
Hi Mike, you could maybe take some inspiration from Structure Synth, which is based on CFDG (http://www.contextfreeart.org/)... http://structuresynth.sourceforge.net/learn.php Apart from that, wouldn't it be more worthwhile to just focus on the actual scenegraph generation and scene export in dif

Re: A Working nrepl-ritz Setup?

2012-12-10 Thread Chas Emerick
On Dec 8, 2012, at 6:37 PM, Charles Comstock wrote: > I still encounter some sort of issue where it appears that the documentation > querying functions, find-doc, and doc and the like are not being properly > brought into the repl namespace, which breaks ctrl-d d until I manually bring > that

Re: Clojure raytracing scene description language

2012-12-10 Thread Thomas
A very cool idea, something I was thinking about myself as well (but never had the time/knowledge for). Are you planning to make use of multithreading? (there is a another Clojure Raytraces on githubm and that one doesn't unfortunately). And sticking close to the pov syntax would make sense I t

Re: leiningen and updating project versions

2012-12-10 Thread Dave Sann
Hi Frank, I do use checkouts (i.e symlinked to the project). The main reason I don't do what you suggest is that the jar dependencies of checkouts are not automatically picked up transitively which can lead to some fiddly problems. I used to use lein-deps-shares for this but do not any more. s

Re: ANN: clj-schema, Schemas For Clojure Maps

2012-12-10 Thread Christophe Grand
Oh and clj-schema is really something I would use and promote. On Mon, Dec 10, 2012 at 10:01 AM, Christophe Grand wrote: > Hi Alex, > > To echo Laurent's concern: if you use schema to validate inputs you get > from another (sub)system then, in my opinion, a loose schema is a better > fit. > It's

Re: ANN: clj-schema, Schemas For Clojure Maps

2012-12-10 Thread Christophe Grand
Hi Alex, To echo Laurent's concern: if you use schema to validate inputs you get from another (sub)system then, in my opinion, a loose schema is a better fit. It's the must-understand/must-ignore schism once again. Must-ignore (loose schemas) requires care when revising a schema (since any piece o

Re: abysmal multicore performance, especially on AMD processors

2012-12-10 Thread cameron
Hi Marshall, I think we're definitely on the right track. If I replace the reverse call with the following function I get a parallel speedup of ~7.3 on an 8 core machine. (defn copy-to-java-list [coll] (let [lst (java.util.LinkedList.)] (doseq [x coll] (.addFirst lst x)) lst))

class loaders stack constant grow in REPL

2012-12-10 Thread Vladimir Tsichevski
Hi, just found that every interaction with Clojure REPL causes one more DynamicClassLoader put on the Thread context class loader chain. Here is how clojure.main/repl beginning looks like: (let [cl (.getContextClassLoader (Thread/currentThread))] (.setContextClassLoader (Thread/currentThr