Get a LAZY list of records from a database query ?

2014-03-14 Thread Frank Behrens
Hi, I wonder if its possible to convert this database query (its CLR) into a lazy sequence. The reader loop is wrapped in the opening and closing of the db-connection and reader. When i 'take a few records from the sequence, will then the connection be closed because it's getting out of scope

Re: Get a LAZY list of records from a database query ?

2014-03-14 Thread Shantanu Kumar
Hi Frank, You can look at the source code of `resultset-seq` (in Clojure-JVM) to see how it does a similar thing. You must consume the entire set of messages before closing the connection though. The `clojure.java.jdbc` library ensures that, for example. You may also want to discuss this on Cl

Re: Adatx - Test driven development... literally.

2014-03-14 Thread Ludwik Grodzki
Tim. Thank you for the William Byrd video link, more research for me to follow up on. I have not seen core.logic examples that would suggest I could do the program search in clojure's program space vs in the MiniKanren program space. I need to look at core.logic more closely. That and core.type

Re: Om-powered HTML slide-decks

2014-03-14 Thread Malcolm Sparks
Yes, I believe it will be posted there soon. On 13 March 2014 17:35, Laurens Van Houtven <_...@lvh.cc> wrote: > Hi Malcolm, > > > Love the code, excited about the talk as well. Will it eventually end up on > infoq.com/Clojure? > > > thanks in advance > lvh > > -- > You received this message becaus

Re: Help a Startup use Clojure!

2014-03-14 Thread Víctor R . Escobar
Hi everyone, about David's document, I think you need to realize that it is a perfect blog post for programmers. In a business usually the focus is in the benefit (increase benefit or reduce costs). If I would be your boss perhaps I would understand that you want to switch to another technology

Re: [GSoC] Proposal: persistent probabilistic data structures

2014-03-14 Thread Matteo Ceccarello
Nicola, thank you :) It's really nice to see that I'm not alone! Everybody, I just updated the proposal, following the guidelines suggested by the wiki. Cheers, Matteo Il giorno giovedì 13 marzo 2014 23:06:11 UTC+1, Nicola Mometto ha scritto: > > > Matteo, > best of luck with your proposal, al

Re: Adatx - Test driven development... literally.

2014-03-14 Thread Timothy Washington
Right. Yes, it looks very interesting, and I need to research it too. Well I'm certainly keen on hearing about your results. Tim Washington Interruptsoftware.com On Fri, Mar 14, 2014 at 7:13 AM, Ludwik Grodzki wrote: > Tim. > > Thank you for the William Byrd vi

Clojure on the Mac App Store

2014-03-14 Thread Zach Oakes
After a lot of work, Nightcode is now on the Mac App Store. It remains free and open source, so this paid version is meant as a form of donation (though not tax deductible...). Since the sandboxing required by the MAS made it quite difficult to accomplish, I decided to

Re: Help a Startup use Clojure!

2014-03-14 Thread David Sargeant
I wanted to give a little history and a follow-up to my own situation. I originally crafted "The Case for Clojure" document for the developers in my company. The idea was to make a compelling argument for migrating our decent size codebase from PHP to Clojure. I would agree that showing your

Re: [GSoC 2014] Looking for mentors: cljs graphics package (in the spirit of p5.js / quil / three.js)

2014-03-14 Thread Adam Clements
I'm keen to see graphics frameworks on clojure move away from imperative api call wrappers and towards a more declarative approach, where you define as data what you want to draw. I have done this for a number of personal projects, using a hiccup like syntax to define my drawing operations, and the

Problems getting function metadata

2014-03-14 Thread Adam Krieg
I'm trying to get the meta data off a function that was stored in a map, (defn my-fun [x] x) (def fun-map {:function my-fun}) (meta (var my-fun)) ; this works (meta (var (:function fun-map))) ; This fails with CompilerException java.lang.ClassCastException: clojure.lang.PersistentList cannot b

Re: Working with big datasets, merging two ordered lists by key

2014-03-14 Thread Frank Behrens
I am still working on the solution, (see gist ) and want to share my current thoughts. The problem is to process over a join on two big datasets (from different sources). Right now I a quite confident as I break the problem into smaller parts, and I am starting

Re: Problems getting function metadata

2014-03-14 Thread Mauricio Aldazosa
With your first example you obtain the metadata of the var (that's the place where defn stores the metadata). In the second one, take a look at the value that is stored in the map: user> (:function fun-map) # Thats the func

Re: Problems getting function metadata

2014-03-14 Thread Jozef Wagner
Metadata can be attached to many kinds of objects: functions, vars, collections, references, etc. Metadata added in defn is added to the global Var which is holding the newly created function. user=> (defn ^{:foo 42} my-fn []) #'user/my-fn user=> (:foo (meta #'my-fn)) ;; same as (:foo (meta (v

Re: STM and persistent data structures performance on mutli-core archs

2014-03-14 Thread Raoul Duke
cough cough erlang cough ahem -- 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. To unsubscribe from t

Re: STM and persistent data structures performance on mutli-core archs

2014-03-14 Thread Эльдар Габдуллин
He talks about simple things actually. When you have any sort of immutable data structure and you want to change it from multiple threads you just must have a mutable reference which points to the current version of that data structure. Now, updates to that mutable reference are fundamentally se

Re: STM and persistent data structures performance on mutli-core archs

2014-03-14 Thread Gary Trakhman
On Fri, Mar 14, 2014 at 12:58 PM, Raoul Duke wrote: > cough cough erlang cough ahem > > Care to elaborate? :-) > -- > 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 fr

Re: STM and persistent data structures performance on mutli-core archs

2014-03-14 Thread Raoul Duke
>> cough cough erlang cough ahem > Care to elaborate? :-) "Now his point is that GC acts a super GIL which effectively kills all the hard work done on the language and application design level." erlang's approach to gc / sharing data / multi process / smp is i think an interesting sweet spot. the

Re: STM and persistent data structures performance on mutli-core archs

2014-03-14 Thread Gary Trakhman
Shared memory is kind of a degenerate case of message-passing when you think about cache-coherency protocols and such. I'd argue erlang's message-passing isn't inherently superior, but kind of obfuscates the issue. What's the sequential fraction of an arbitrary erlang program, can you even know (

Re: STM and persistent data structures performance on mutli-core archs

2014-03-14 Thread Raoul Duke
i am probably out of my depth here, i do not have extensive real-world experience with the various ways to approach parallelism and concurrency (to be distinguished of course), more run of the mill stuff. so if i sound like i'm missing your point or am clueless i ask for your patience :-) > What's

Re: STM and persistent data structures performance on mutli-core archs

2014-03-14 Thread Gary Trakhman
On Fri, Mar 14, 2014 at 1:35 PM, Raoul Duke wrote: > i am probably out of my depth here, i do not have extensive real-world > experience with the various ways to approach parallelism and > concurrency (to be distinguished of course), more run of the mill > stuff. so if i sound like i'm missing yo

Re: STM and persistent data structures performance on mutli-core archs

2014-03-14 Thread Gary Trakhman
"Everything has tradeoffs. One more example was when Martin explained how he was able to get a 10x performance boost by pinning a JVM to each socket in a server, then pinning that JVM's memory to the RAM sockets closest to that CPU socket. Then he carefully setup shared memory message passing via b

Re: STM and persistent data structures performance on mutli-core archs

2014-03-14 Thread Raoul Duke
> that closely match or can be massaged to match or 'have sympathy' for the > hardware realities. I think this can get lost when we stray too far. i wish this were somehow more modeled, composed, and controllable up in our ides and source code, rather than being esoteric tweaky options in the var

Re: STM and persistent data structures performance on mutli-core archs

2014-03-14 Thread Gary Trakhman
Yes I agree, that was my next thought. I wish we could do these knobs in a single JVM. On Fri, Mar 14, 2014 at 2:20 PM, Raoul Duke wrote: > > that closely match or can be massaged to match or 'have sympathy' for the > > hardware realities. I think this can get lost when we stray too far. > >

Re: STM and persistent data structures performance on mutli-core archs

2014-03-14 Thread guns
On Fri 14 Mar 2014 at 02:15:07PM -0400, Gary Trakhman wrote: > "Everything has tradeoffs. One more example was when Martin explained how > he was able to get a 10x performance boost by pinning a JVM to each socket > in a server, then pinning that JVM's memory to the RAM sockets closest to > that C

Re: declare and def

2014-03-14 Thread Plínio Balduino
Excellent explanation. Thank you everybody. Plínio On Thu, Mar 13, 2014 at 12:54 PM, Andy Fingerhut wrote: > The Clojure lint tool Eastwood (https://github.com/jonase/eastwood) uses > this {:declared true} metadata to distinguish between a declare followed > later by a def on the same var (no

Re: shenandoah

2014-03-14 Thread John Mastro
Jacob Goodson wrote: > I was wondering, would a GC like this one(or Azul's) make a > significant impact so that I, or others, could make games in a more > pure fashion? I WANT MY EFFIN PURITY! I'm not particularly knowledgeable about either game development or advanced garbage collection technolog

Re: shenandoah

2014-03-14 Thread Raoul Duke
> unreachable. The "normal" GC would then have a lot less to do, helping > achieve shorter pauses. i have long wondered a similar wonder. :-) (i also naively day-dream one could get the C# "IDisposing" style for free with something like that.) the BitC folks have talked about all sorts of things a

Re: [GSoC 2014] Looking for mentors: cljs graphics package (in the spirit of p5.js / quil / three.js)

2014-03-14 Thread Omer Shapira
Very true, but for more than just the occasional doodle, this idea needs to be complete, because pipelines like OpenGL/WebGL use imperative calls. One way of doing it would be keeping the entire state of the OpenGL context (not including data) cached as an object and just interact with it, so a

CLJS Advanced Compilation & JS Libraries lacking externs

2014-03-14 Thread David Nolen
I've written up an explanation how to make this work http://swannodette.github.io/2014/03/14/externs-got-you-down/ David -- 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 fro

Re: STM and persistent data structures performance on mutli-core archs

2014-03-14 Thread Andy C
Maybe one day this idea http://en.wikipedia.org/wiki/Lisp_machine will come back, I mean in a new form .. In any case, I think that it would be great to see some performance benchmarks for STM A. -- You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Re: Adatx - Test driven development... literally.

2014-03-14 Thread William Byrd
Hey everyone! Adatx looks like fun! I tried coming up with a simple miniKanren/cKanren program that can synthesize the program on the adatx github page: https://github.com/webyrd/mad-at-x I just implemented a simple evaluator for expressions including +, -, integers from 0-11 (extending the d

purely functional math renderer

2014-03-14 Thread t x
Hi, I'm aware of MathJax, JsMath, MathQuill, MathDox. However, I'm wondering if anyone have implemented a pure clojure math renderer (not just a binding, but with the actual rendering in Clojure). What I find frustrating about existing solutions is their im-pureness. The basic idea is: