Live data from Hacker News

The Swift Programming Language

developer.apple.com

561–570 of 970 posts

Re: The Swift Programming Language

#561

Earlier quoted context omitted.

Basically, he just came up with something using FP that was more demo-able than somewhat hacky things people were already doing in other languages/environments. (For which, he deserves tons of credit.)

Bret victor's demos really have nothing to do with FP. The textual code demos in his learnable programming essay are all JavaScript and fairly imperative.

As were a lot of the things you could do years earlier in Smalltalk. FP with referential transparency makes it a whole lot easier and slicker. (Can also do it with data flow analysis.)

Re: The Swift Programming Language

#562
post #234

Earlier quoted context omitted.

>This will also be incredible for ease-of-setup. Install Xcode, and you're ready to go. No other dependencies. 1. Buy particularly expensive computer 2. Register as an apple developer 3. Install Xcode, and you're ready to go. > Setting up a dev environment can be one of the big reasons people fail to learn to program. Citation needed :)

Actually: 1. Buy a Mac mini for $600, which doesn't strike me as particularly expensive. 2. There is no step 2. 3. Download Xcode from the Mac App Store for free.

Yes, there is a step 2 at this very moment because I can't even download this version of XCode without having developer id.

Re: The Swift Programming Language

#563

Earlier quoted context omitted.

I don't get the hate. Yeah, syntax is unfamiliar, bu once I got used to it I began to really enjoy objective-c. Ymmv etc., but it's now one of my fav languages - though I guess this is mostly due to cocoa

I don't think syntax is really the issue. Using objc these days is clunky for reasons besides syntax.

Like dealing with ARC, which is still clunky:

    @lazy var asHTML: () -> String = {
        [unowned self] in
        if let text = self.text {
            return "\(text)"
        } else {
            return ""
        }
    }
Excerpt From: Apple Inc. “The Swift Programming Language.” iBooks. https://itun.es/us/jEUH0.l

Re: The Swift Programming Language

#564

You appear to be advocating a new: [ ] functional [X] imperative [X] object-oriented [X] procedural [X] stack-based [ ] "multi-paradigm" [ ] lazy [ ] eager [X] statically-typed [ ] dynamically-typed [ ] pure [X] impure [ ] non-hygienic [ ] visual [ ] beginner-friendly [ ] non-programmer-friendly [ ] completely incomprehensible programming language. Your language will not work. Here is why it will not work. You appear…

While half of the things you checked in that copy-paste are wrong, let me take the bait and say why it will work: - it's not just an arbitrary language, it's the new officially sanctioned programming interface for Apple's gigantic, wildly profitable ecosystem - it's much more concise than Objective-C - it's faster than Objective-C - it's safer than Objective-C - it has more features than Objective-C - ...yet it's ful…

There's no real objective measure for either 'conciseness' or 'safety', in general terms. Whether or not it's faster in the real world is yet to be seen, and creeping featuritis has never been the hallmark of a great programming language.

It makes good press release and marketing speak, but those assertions are a long way from making the OP 'wrong'.

Re: The Swift Programming Language

#566

Earlier quoted context omitted.

I immediately thought about that as well. I wonder how they pull it off? Swift is not a functional language, so they just save every single variable, or what?

Time travel debugging has existed for a long time, and it's not limited to functional languages; the most obvious way they could do this is through checkpointing.

Checkpointing is a natural fit with the Cocoa API, which uses an event loop. Just save the state of the application after each event is handled.

Re: The Swift Programming Language

#567
post #487

Will it still cost me an Arm, a Leg, and my first born to obtain the dev tools and compile code?

The beta currently requires that you are a member of one of the Developer programs (iOS or Mac) which costs $99 per year.

Release versions of Xcode are freely available at no cost (except that you need a Mac)

Re: The Swift Programming Language

#569
One of the things I look for in a language right off the bat, as it's a sign that powerful features can be built as libraries later, is some type of reflection api. There appears to be none (though attributes seem cool).

Re: The Swift Programming Language

#570
post #319

A lot of the syntax is incredibly similar to rust.

Yes, but Swift looks much cleaner thanks to ARC memory management. I wish Rust has something similar, all those sigils make it messy.

ARC is the reason Swift won't make it into the systems programming world. I - a firmware engineer - am glad Rust team stuck to their guns and kept it 0 overhead.
Post reply on HN