News for hackers. Stuff that matters.
Re:Introducing Swift by pohl on Monday June 02, 2014 @07:51PM (#7837283)
Swift isn't intended to be a systems language

FWIW, Swift is categorized as a systems language in the opening pages. But, then, so does Go in its FAQ. To Swift's credit, at least it has deterministic memory management through ARC.

Re:Introducing Swift by mzl on Tuesday June 03, 2014 @01:34AM (#7838304)
While having some support for garbage collection is good, reference counting is not is a rather expensive way to implement that for applications. This becomes especially bad in multicores since it may dramatically increase the number of writes to shared object cache lines.
Re:Introducing Swift by pohl on Tuesday June 03, 2014 @08:58AM (#7839823)
Wouldn't a lot of that be mitigated, though, by using tagged pointers in place of RC structs where possible? Seems like an obvious optimization.
Re:Introducing Swift by mzl on Wednesday June 04, 2014 @02:39AM (#7844293)
Not really sure what the tag in the pointer would be used for. Could you give an example.

In general, reference counting has the problem that it needs to update the reference count. If you have a read-only data-structure these updates to the references will introduce writes that may severely impact performance since a write introduces cache consistency communication, while reads are communication-free.

Re:Introducing Swift by pohl on Wednesday June 04, 2014 @08:51AM (#7845240)
Yeah, you're right. I didn't think it through when I asked. I conflated this scenario with the technique they use to put small objects like NSNumber on the stack.