[OT] Apple introduces Swift as Objective-C sucessor

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


On Monday, 2 June 2014 at 19:19:27 UTC, Paulo Pinto wrote:
> Just thought it would be nice to give a heads up about Apple's 
> plans to replace Objective-C in the long run.
>
> The language was presented today at the WWDC Keynote, looks 
> like Ruby, uses ARC alongside the Objective-C runtime.
>
> http://live.arstechnica.com/apples-wwdc-2014-keynote/
>
> It also has a nice REPL experience, similar to Python's 
> worksheets in IPython.
>
> --
> Paulo

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!


More information about the Digitalmars-d mailing list