Re:Swift architecture at Uber
by edgyswingset on Wednesday April 26, 2017 @11:41PM
(#14209022)
The Swift compiler has some serious issues with the way it does type inference. Try compiling code with a line of basic arithmetic on a few numeric literals.
[ Parent
| on HN ]
That has literally nothing to do with what the parent comment is talking about. And that's not naivety either. That's because the way type inference, operating overloading, and literals work together ends up being a combinatorial explosion.
Re:Swift architecture at Uber
by bendecoste on Thursday April 27, 2017 @12:13AM
(#14209124)
Kotlin has all of these features and build times don't (noticeably) suffer.
Re:Swift architecture at Uber
by arcticbull on Thursday April 27, 2017 @01:00AM
(#14209283)
As does Rust.
Re:Swift architecture at Uber
by slavapestov on Thursday April 27, 2017 @01:01AM
(#14209289)
From what I've heard Rust has serious build-time issues as well, mostly because of it's inability to perform separate compilation of generic code. Unlike Swift, Rust specializes everything at compile-time, similar to C++ templates.
Re:Swift architecture at Uber
by steveklabnik on Thursday April 27, 2017 @02:09AM
(#14209534)
That's not exactly true, while that is usually what Rust people write, you can choose to have stuff not monomorphized. I'm also not exactly sure what you mean by "separate" here.
As usual, compile times depend on what you're used to. It is something we're working on improving though; we want it to be very fast! We expect incremental recompilation to move out of nightly soonish; that will help quite a bit.
No it doesn't. Rust doesn't have overloading, or operator overloading, or literal overloading. It literally has none of the pieces that cause the combinatorial explosion in Swift.
Rust does have operator overloading though the traits in the std::ops module. There are only a few (&&, ||, etc) that can't be overridden.
Oh you're right about that. I was thinking of custom operators when I said no operator overloading, but of course that's not actually what we were discussing. Still, no literal overloading. Also, there are other differences between Rust and Swift's type systems that allow Rust to do type inference in a way that Swift cannot.