News for hackers. Stuff that matters.
Re:IBM says Swift is ready for the enterprise by pjmlp on Monday September 26, 2016 @12:21PM (#12583139)
The compiler can provide better error messages and guide the user, whereas with library types, at least on C++'s case it requires help from external tooling.

With Rust, while you can make use of the type system, it is harder for the compiler to provide such guidance, unless the types are somehow blessed.

Re:IBM says Swift is ready for the enterprise by mikeash on Monday September 26, 2016 @12:46PM (#12583388)
What sort of guidance does Swift provide here? And nothing prevents Rust or C++ compilers from becoming aware of these types and providing specialized diagnostics for them.
Re:IBM says Swift is ready for the enterprise by pjmlp on Monday September 26, 2016 @02:13PM (#12584191)
I said it can, not that it does it already.

My Swift experience is constrained to the GNU/Linux version, so I don't know if XCode is already doing something in this direction.

Sure one can have blessed library types that the compiler knows about, but then from language design point of view it creates a decision between those types and others written by developers, but with similar semantics.

Re:IBM says Swift is ready for the enterprise by mikeash on Monday September 26, 2016 @02:47PM (#12584501)
Since you said it's easier than these other languages, I thought you were referring to how the languages work now.

There's nothing wrong with special treatment for stuff in the standard library. C and C++ already do this with many things (e.g. many compilers understand calls like memcpy and will emit optimized code based on the standard library semantics) and Swift gives special treatment to built-in types like Optional.

The distinction here is fairly blurred. The Swift implementation of weak pointers is mostly in the runtime library already, it's just that the compiler hides it a bit so you don't write the names of the calls directly.

Re:IBM says Swift is ready for the enterprise by pjmlp on Monday September 26, 2016 @04:13PM (#12585156)
Sure, I was more thinking about the language geek point of view.

Thanks for clarifying.

Re:IBM says Swift is ready for the enterprise by mikeash on Monday September 26, 2016 @04:59PM (#12585497)
Understood. If you have any ideas for cool diagnostics or other guides, I'd be interested in hearing. I couldn't think of anything offhand, but that's probably just my lack of imagination. I would love to see some static analysis help for finding retain cycles and recommending how to break them, but I'm not sure if that's practical.