[rust-dev] Integer overflow, round -2147483648

Tony Arcieri bascule at gmail.com
Mon Jun 23 13:10:45 PDT 2014


On Monday, June 23, 2014, Daniel Micay <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
default.

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.


-- 
Tony Arcieri
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140623/affb9370/attachment.html>


More information about the Rust-dev mailing list