Re: Persistent Data Structures for Objective-C/LLVM

2014-12-19 Thread Raju Bitter
Wow, that's incredible! Who would have thought that anything written in ClojureScript - and running inside a JS engine - could ever be so much faster than an Objective-C implementation! On Thu, Nov 13, 2014 at 5:17 AM, Mike Fikes wrote: > I'm thinking Anton's persistent collections could be use

Re: Persistent Data Structures for Objective-C/LLVM

2014-11-12 Thread Mike Fikes
I'm thinking Anton's persistent collections could be useful on iOS. Out of curiosity, I made a small iOS project that compares the performance of Anton's map to ClojureScript's, when adding lots of key-value pairs (using transients): https://github.com/mfikes/persistent-objc-cljs Interestingly,

Re: Persistent Data Structures for Objective-C/LLVM

2014-11-12 Thread Anton Astashov
It is indeed waaay slower now than original NSArray/NSSet/NSDictionary (on large maps ~20x than NSMutableDictionary, on large vectors ~100x than NSMutableArray) but that's a tradeoff :). I'll continue to work on speeding it up though. On Wednesday, November 12, 2014 2:01:07 PM UTC-8,

Re: Persistent Data Structures for Objective-C/LLVM

2014-11-12 Thread Anton Astashov
All objects in Objective-C actually maintain their reference count. This is how ARC works. So, if there is only one reference to a vector, and we create a new modified vector with a new element, the changed nodes of the old vector will set reference count to 0 and will be disposed. On Wednesday

Re: Persistent Data Structures for Objective-C/LLVM

2014-11-12 Thread Stephen Wakely
Interesting. I would definitely look into this if I ever need to do another iOS app. How does it work in a language without garbage collection? If you replace an element in a vector and only keep a reference to the new vector there will be a stray element there that would need mopping up. Is ARC c

Re: Persistent Data Structures for Objective-C/LLVM

2014-11-12 Thread Anton Astashov
Sorry for resurrecting of such an old post, but I just wrote port of Clojure's data structures in Objective-C - https://github.com/astashov/persistent.objc - hopefully one day someone will find that useful. :) On Sunday, March 31, 2013 5:43:52 AM UTC-7, Matthias Benkard wrote: > > I implemented

Re: Persistent Data Structures for Objective-C/LLVM

2013-03-31 Thread Matthias Benkard
I implemented persistent, array-mapped Patricia trees in C a while ago: https://matthias.benkard.de/journal/118 It should be relatively straight-forward to build some Objective-C classes on top of that. (There's a reason the memory management routines are named bpt_{retain, release, deallo

Re: Persistent Data Structures for Objective-C/LLVM

2013-03-28 Thread David Nolen
As far as I know the immutable Objective-C collections are not efficient to update and likely perform terrible in this respect to Clojure collections. On Thu, Mar 28, 2013 at 1:07 PM, Omer Iqbal wrote: > Most foundation objective c data structures are immutable (NSArray, > NSDictionary, NSSet e

Re: Persistent Data Structures for Objective-C/LLVM

2013-03-28 Thread Karl Krukow
On 28/03/2013, at 18.07, Omer Iqbal wrote: > Most foundation objective c data structures are immutable (NSArray, > NSDictionary, NSSet etc), and are most probably more performant than clojure > counterparts, though terribly less elegant. > However there's the clojure-scheme project > (https://g

Re: Persistent Data Structures for Objective-C/LLVM

2013-03-28 Thread Omer Iqbal
Most foundation objective c data structures are immutable (NSArray, NSDictionary, NSSet etc), and are most probably more performant than clojure counterparts, though terribly less elegant. However there's the clojure-scheme project ( https://github.com/takeoutweight/clojure-scheme) which compiles

Persistent Data Structures for Objective-C/LLVM

2013-03-28 Thread Krukow
Hi, Kind of an unusual question, but is anyone in this group aware of a c, objective-c or LLVM-based implementation of the Clojure persistent data structures? - Karl -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send em