News for hackers. Stuff that matters.
Re:The Decade of Swift by skohan on Tuesday December 31, 2019 @06:09AM (#21920245)
Yeah that is exactly my point. In many cases all the extra work you put into writing Rust code for the additional performance is just that: extra. It doesn’t add any meaningful value to the final product, and it comes at the opportunity cost of that time you could have spent adding or improving features in a more productive language.
Re:The Decade of Swift by pjmlp on Tuesday December 31, 2019 @07:58AM (#21920706)
Yeah, while Rust is paving the way for affine type systems among mainstream languages, and it already influenced design decisions on other system programming languages, including Swift (memory ownership manifest), it isn't the first on my list for UI or distributed computing applications.
Re:The Decade of Swift by skohan on Tuesday December 31, 2019 @10:17AM (#21921500)
Yeah to me Rust almost feels like the prototype for the next great programming language. There are a lot of great ideas there, but there are also a lot of awkward edges. Like what it accomplishes from a technical perspective is super impressive, but it would be great if somebody could synthesize all of those concepts behind a cleaner front-end which really nails the ergonomics.
Re:The Decade of Swift by steveklabnik on Tuesday December 31, 2019 @11:09AM (#21921991)
A few people have tossed around the idea of “what if Rust but drop the commitment to zero cost abstractions.” That’s probably our principle that causes the most ergonomic hit.

Of course, Rust won’t start taking that path, but if I were to start a new language today, that’s what it would look like.

Re:The Decade of Swift by skohan on Tuesday December 31, 2019 @02:39PM (#21923985)
Interesting. There was a really good talk at the last CPPCon by Chandler Carruth about how there is really no such thing as a zero-cost abstraction. The main point being, while you might be able to optimize against a runtime performance cost for abstractions, the cost will almost always be shifted to compile time, or to the cognitive burden on the developer.

It really makes me think there must be something like the first law of thermodynamics for logical complexity.

Re:The Decade of Swift by steveklabnik on Tuesday December 31, 2019 @06:21PM (#21925492)
Yeah, I haven’t watched the talk, but as you’d expect, Chandler has his head on straight. This is a common misconception: zero cost refers to runtime only. There’s always cost. Some people have started saying “zero overhead” instead to make it more clear, but it takes a while to change entrenched terminology.