[rust-dev] Integer overflow, round -2147483648
danielmicay at gmail.com
Mon Jun 23 13:32:55 PDT 2014
On 23/06/14 04:10 PM, Tony Arcieri wrote:
> On Monday, June 23, 2014, Daniel Micay <danielmicay at gmail.com
> <mailto:danielmicay at gmail.com>> wrote:
> Rust is not a language designed for an imaginary sufficiently smart
> compiler. It targets real architectures and the real LLVM backend.
> I hate to keep throwing hypotheticals at you, but here's another one:
> what if Apple invests in LLVM development which improves the performance
> of Swift semantics?
> To be clear, Swift semantics eschew the dichotomy of checked overflow vs
> the fast path. Swift offers both, but makes the "safe" operators the
> With safe operators as the default, and Swift being marketed as a
> performance-oriented language, Apple is incentivized to optimize Swift's
> overflow handling for performance. They have the resources, expertise,
> and connections to make these sorts of changes to LLVM.
> I know it's a gamble, but if you "borrowed" Swift's semantics, wouldn't
> you potentially reap a free lunch from what Apple contributes upstream
> to LLVM to better optimize Swift?
> I don't have the crystal ball. Maybe Apple won't submit anything
> upstream to LLVM in this regard. Maybe Swift will be a dud.
> But if Swift succeds, and Rust were to adopt similar semantics, and
> Apple were to submit its LLVM optimizations for this upstream, I feel
> like Rust could reap many of the benefits too.
Swift isn't aimed at the same niche as Rust. It doesn't have references
at values, and you can't take references into values or arbitrary other
parts of data. It only has value types and atomically reference counted
reference types. It's in the same tier as C#, and isn't trying to
compete with the performance of C++ code.
It would be an enormous mistake to ship a language with region typing /
move semantics and worse before than Java. I can't see a language like
that succeeding at all. If you want Swift, feel free to use Swift.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: OpenPGP digital signature
More information about the Rust-dev