[OT] Apple introduces Swift as Objective-C sucessor
Steven Schveighoffer via Digitalmars-d
digitalmars-d at puremagic.com
Mon Jun 2 14:15:36 PDT 2014
On Mon, 02 Jun 2014 17:00:40 -0400, H. S. Teoh via Digitalmars-d
<digitalmars-d at puremagic.com> wrote:
> On Mon, Jun 02, 2014 at 04:23:47PM -0400, Nick Sabalausky via
> Digitalmars-d wrote:
>> On 6/2/2014 3:49 PM, Steven Schveighoffer wrote:
>> >On Mon, 02 Jun 2014 15:45:28 -0400, Paulo Pinto <pjmlp at progtools.org>
>> >wrote:
>> >>
>> >>More information now made available
>> >>
>> >>https://developer.apple.com/swift/
>> >
>> >"Memory is managed automatically, and you don’t even need to type
>> >semi-colons."
>> >
>> >...
>> >
>>
>> Heh, yea, that's the #1 thing that jumped out at me as well. Sounds
>> like it probably sums up a lot about the language.
>>
>> The whole thing sounds like "We love how JS and Python allow mediocre
>> programmers to churn out bad software quickly, but since we *are*
>> Apple and love strategic lock-in just as much as MS, here's our own
>> goofy version of the exact same thing that we're going to push
>> instead."
>
> Seems everyone is fixating on semicolons, but seriously, am I the only
> one who sees the elephant in the room? Automatic memory management!!!
> Where's Manu and his GC tirades when you need him? ;-)
It will be ARC. Same as Objective C.
But I don't like that the memory management is automatic. More likely than
not, it will allocate things you don't want it to, or could avoid if you
had manual control. I'm skimming the book about this new language, and it
certainly will be more D-like than Objective C, which is nice, but there
are some things that I really don't like. Significant whitespace is one of
them.
They have template constraints similar to D. It looks something like this:
func foo<T where T == Int>(t: T)
I think everything after the where can be some condition, but I don't know
how expressive that is. The examples aren't very telling.
I still haven't figured out whether generics are runtime-based or
compile-time based. But some form of generics will be very nice to have.
-Steve
More information about the Digitalmars-d
mailing list