Re: [swift-corelibs-dev] Rules on adding dependencies

2015-12-05 Thread Tony Parker
Hi Geordie, The choice of NSData instead of String was very deliberate for NSJSONSerialization. The reason is that JSON is received from disk or the network as a data blob, not a String. Converting it into a String requires figuring out the encoding and doing a conversion. NSJSONSerialization l

Re: [swift-corelibs-dev] Rules on adding dependencies

2015-12-05 Thread Tony Parker
> On Dec 5, 2015, at 9:17 AM, Geordie Jay wrote: > > Sorry to spam, but I’ve just run some tests re: memory usage and found that > running NSJSONSerialization.JSONObjectWithData() repeatedly results in huge > memory usage (unbounded into the gigabytes). The pure Swift version I’ve been > work

Re: [swift-corelibs-dev] Rules on adding dependencies

2015-12-05 Thread Geordie Jay
What I’m not so sure about is the most efficient way of working with NSData in this context, considering we are very much assuming the data to have come from a String of some kind (correct me if I’m wrong). So it seems to me like taking NSData insead of just a String is a regression into Objecti

Re: [swift-corelibs-dev] Rules on adding dependencies

2015-12-05 Thread Geordie Jay
I’m not sure about performance hit of calling C from Swift either (it should be statically linked, so I suspect there is none), but the performance is only marginally slower than NSJSONSerialization as is, in the pure Swift version I am making. My test character set is about 2000 characters long

Re: [swift-corelibs-dev] Rules on adding dependencies

2015-12-05 Thread Tom Leavy
I would rather go right to the end game here and just work on coding up an implementation of JSON encoding / decoding and making it conform to the NSJSONSerialization spec. I can set up a repo for us to work on it. The main decision here, is do we code a small lib in C and then call it from the

Re: [swift-corelibs-dev] Rules on adding dependencies

2015-12-04 Thread Tom Leavy
Thanks! Is there a list of current dependencies someplace? I understand you use a specific version of ICU as part of CoreFoundation. Thomas Leavy | Wickr Inc. VP Mobile Applications, Architecture | Newark, NJ On Dec 4, 2015, at 3:52 PM, anthony.par...@apple.com

Re: [swift-corelibs-dev] Rules on adding dependencies

2015-12-04 Thread Tony Parker
Good idea, I filed a bug for that here. https://bugs.swift.org/browse/SR-59 - Tony > On Dec 4, 2015, at 12:49 PM, Tom Leavy wrote: > > Hey Tony, > > That sounds like a good objective overall, thanks for clarifying. I think you > guys should write that so

Re: [swift-corelibs-dev] Rules on adding dependencies

2015-12-04 Thread Tom Leavy
Hey Tony, That sounds like a good objective overall, thanks for clarifying. I think you guys should write that someplace in the documentation on github (if it hasn’t been already) Thomas Leavy | Wickr Inc. VP Mobile Applications, Architecture | Newark, NJ > On Dec 4, 2015, at 2:39 PM, anthony

Re: [swift-corelibs-dev] Rules on adding dependencies

2015-12-04 Thread Tony Parker
Hi Tom, I believe it’s important for us to keep our dependencies to an absolute minimum for the core libraries, since they will be distributed very widely. I would prefer to have our own implementation of the JSON parser in Foundation rather than use one from another project. The one from Darw