Fork me on GitHub
#clojure-art
<
2015-12-22
>
eggsyntax14:12:49

@meow: @mikera: my sense is that there’s nothing wrong (or even unidiomatic) with using mutability quite freely as long as it’s confined within a limited scope, typically a single function. & see http://clojure.org/transients

meow14:12:52

@eggsyntax: Sure, and I do use transients sometimes.

meow14:12:48

Giving serious thought to writing a polygon mesh processing library using vectorz for the data representation.

meow14:12:56

This has to be the most concise implementation of Conway's Game of Life in clojure that I have seen, and I think I've seen a lot of them: https://github.com/mikera/core.matrix/blob/0cf43fe3b3a1992aec2fbe041ae0ab5ed34d02b5/src/test/clojure/clojure/core/matrix/demo/life.clj

meow14:12:55

Would also love to extend my ergo library of l-systems and cellular automata code to use vectorz as well. Very curious to see what kind of performance improvement I could get.

meow18:12:11

I know, right!

meow18:12:54

Of course, like all such efficient implementations it gives up a lot of flexibility.

meow18:12:52

I have some CA code that is very flexible, but I'm sure not as fast: https://github.com/decomplect/ion/blob/master/src/ion/ergo/core.cljc

meow21:12:06

@mikera: When you have some spare time I would love to see a few more examples of how I could use clisk functions on these polygon meshes. I made some changes to how the clisk functions get used. Now the call looks something like this: (op/colorize (partial mc/clisk-sampler clisk/vnoise))

meow21:12:59

I tried to use some other functions like (op/colorize (partial mc/clisk-sampler clisk/agate)) and the results aren't good. I'm sure I don't understand something fundamental.

meow21:12:49

(defn clisk-sampler [colorer mesh]
  (let [sampler (clisk/sampler (clisk/node colorer))
        fc (fn [_ face]
             (let [[x y z] (gu/centroid face)
                   color (sampler [x y z 0])]
               color))]
    [mesh fc]))