On 12/8/15 4:14 AM, deadalnix wrote:
On Friday, 4 December 2015 at 03:18:02 UTC, Steven Schveighoffer wrote:
The type system is static, and everything is done via inference, which
is very nice.
According to a swift dev I talked to, part of the algorithm is
exponential and they have compile time problem because of this.
Hm... I don't have the same problems.
Speed wise, I can't be sure. I'm sure others here have a better
understanding. All I've used it for so far is UI code on iOS.
Usability-wise, it's much easier to write swift than Objective C.
I've seen all kind of numbers. It seems that there are a lot of feature
that can be enabled/disabled, like overflow check, and it changes the
performance profile quite a lot.
I would imagine that with all property (and virtual at that) functions
for all class member variables, it can't be as performant in some cases,
but I'm assuming in at least some cases the compiler inlines that away.
One thing I would LOVE to see in D from swift is inference of enum names.
In D-speak, it looks like this:
enum Foo
{
Bar,
Baz
}
Foo foo;
switch(foo)
{
case .Bar: // Foo is implied
case .Baz:
}
void fun(Foo);
fun(.Bar); // Foo is implied
I don't think we could have this exact syntax, though.
switch(foo) with(Foo) {
case Bar:
case Baz:
}
Yes, again, that isn't the point.
-Steve