News for hackers. Stuff that matters.
Re:What's Going Down at the Tiobe Index? Swift, Surprisingly by plainOldText on Saturday April 27, 2019 @06:22PM (#19767999)
I actually like Swift: advanced type system and compiler, clean syntax, very fast.

I think optionals are a great way of saying: “Hey developer, this value can sometimes be nil; be sloppy or not, your call.”

Any language you pick is an interplay of choices and compromises. No such thing as perfect.

Re:What's Going Down at the Tiobe Index? Swift, Surprisingly by mpweiher on Sunday April 28, 2019 @06:11AM (#19770300)
> very fast

This is a common sentiment, but it rarely holds up to closer scrutiny (such as measurements...). Swift is both slow to run and very slow to compile. Both compile and runtime come with extremely high variance. Such unpredictability is arguably even worse than just plain slow performance.

Re:What's Going Down at the Tiobe Index? Swift, Surprisingly by plainOldText on Sunday April 28, 2019 @08:01AM (#19770640)
In most of these benchmarks [1] Swift's performance comes pretty close to that of Rust. So yeah, I would call that very fast.

[1] https://web.archive.org/web/20190402100249/https://benchmark...

Re:What's Going Down at the Tiobe Index? Swift, Surprisingly by raphlinus on Sunday April 28, 2019 @09:21AM (#19771006)
Try some JSON benchmarks with Codables in Swift vs serde in Rust. Rust smokes Swift, something like 20x.

Incidentally I've spent considerable effort on this problem, including writing a prototype faster JSON parser in Swift (still about 3x slower than Rust, but a huge speedup over what's there). I couldn't get anyone in the Swift community to care enough to motivate me to finish the work, which is indicative of a deeper problem: Swift just doesn't have "performance culture," the benchmark game results notwithstanding.

Re:What's Going Down at the Tiobe Index? Swift, Surprisingly by mpweiher on Tuesday April 30, 2019 @09:01AM (#19787483)
Hmm...when I look at those numbers, Swift only comes close in a very few, is significantly slower in most (50%-4x) and much slower in one (45x):

fannkuch / pidgins: essentially the same

binary-trees / fasta / Mandelbrot: ~ 1.5x slower

spectral-norm / reverse-complement: >= 2x slower

k-nucleotide / n-body: ~4x slower

regex-redux: 45x slower

Re:What's Going Down at the Tiobe Index? Swift, Surprisingly by notafrog on Sunday April 28, 2019 @07:45AM (#19770587)
Up until Swift 4, compilation took longer than with Objective-C according to my experience. Not sure how much Swift 5 has changed things.