[OT] Apple introduces Swift as Objective-C sucessor

ponce via Digitalmars-d digitalmars-d at puremagic.com
Mon Jun 2 15:53:09 PDT 2014


>
> My thoughts while browsing the site:
> - function-leve type inference much like Rust
> - no constness in the type-system (I like it)
> - class are reference types, structs are values types, much 
> like D and C#
> - runtime dispacthed OO interfaces called "protocols". Blend 
> the difference between runtime or compile-time polymorphism. 
> Classes, structs and enums can implement a protocol. Available 
> as first class runtime values, so the protocol dispatch will be 
> slow like in Golang.
> - enumerations are much like Ocaml ADT, can be parameterized by 
> a tuple of values, value types, recursive definitions
> - worrying focus on properties.
> - strange closure syntax
> - optional chaining, another anti-feature in my eyes
> - normal arithmetic operator throw a trap on integer overflow 
> (!). This must be incredibly slow.
> - looks like Array is a fat slice to a reference-counted array
> - operator overloading is in, supercharged with custom 
> operator, custom precedence (!?)
> - builtin tuples syntax
> - break with C integer promotion, like Rust.
> - I haven't seen pointers
> - convenience is a keyword!

- no exceptions (!)
- unsigned integers; check
- type inference is "bidirectional by expression or statement"
- class have deterministic destructors, structs have no 
destructors; like D except reversed
- It seems the only RAII source is through RC and classes.
- no single root class


More information about the Digitalmars-d mailing list