Live data from Hacker News

The Swift Programming Language

developer.apple.com

511–520 of 970 posts

Re: The Swift Programming Language

#511

Earlier quoted context omitted.

It's fun once. It's impractical for someone editing the code later though, I don't want to have to look up the unicode character each time I want to remember it, and I don't want to have to copy and paste it either, it's better to stick with the characters available on a keyboard.

OS X handles some of this by assigning mnemonics to keyboard keys with the meta key (on mac keyboards, Option, or the "windows" key on the standard layout) held down. For instance, the registered trademark symbol ® is just option+r. ∑ is option-w. Diacritics are two-stroke combinations, to get é, you'd type option-e, which puts the ´ on the screen, and then type the e to complete the character. Some of them definitel…

> Some of them definitely make more sense than others, but it sure beats copypasting out of character map!

Sure, but even making your own keyboard layout beats copypasting out of character map for any characters that you use regularly (and if you switch from US-English to US-International as your base layout, you get a lot characters that aren't on US-English for free without making a new layout.)

Re: The Swift Programming Language

#512

I really hope this language is going to become an open standard quickly. Here's hoping the language design is not too tightly coupled to the OS APIs.

This is going to be as open as objective-C. (Whether objective-C is open is left as an exercise for the reader.)

Re: The Swift Programming Language

#513
post #355

Earlier quoted context omitted.

"93x faster" sounds roughly like a 46.5x improvement in marketing.

It's not only possible, it's even not uncommon for a C programmer to get a 90X improvement in speed in their own C program. If you have naive memory management, or incorrectly implemented concurrency or parallelism, you can easily lose 2 orders of magnitude speed.

My most painful personal experience dealing with this exact problem was with CUDA warps, during my undergrad research work.

Re: The Swift Programming Language

#514

The live REPL is totally out of Bret Victor, very impressive.

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.

Re: The Swift Programming Language

#515
post #37

I'm not even an iOS developer but this is by far the most exciting thing I heard in the keynote. As an amatuer/hobbyist programmer who's self-taught with Ruby, JavaScript, etc., the one thing that was keeping me from experimenting with iOS apps was Objective-C. I know I could tackle it, but it's been hard to take the plunge. I don't know much about Swift yet, but from what I've seen it looks very exciting. So if Appl…

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

My dislike is that it uses [] for method calls. It's like making Objective-English where we swap Z and A and j for o, just for the hell of it.

If thzt sjunds like fun tj yju, thzn gj fjr Jboective-C.

Re: The Swift Programming Language

#516
post #2

As someone who always disliked Objective C, I think Swift looks very promising. I'll check it out right away :) Software-wise, I feel these current WWDC announcements are the most exciting in years. Looking at the Swift docs right now, I can see many interesting inspirations at work: there's some Lua/Go in there (multiple return values), some Ruby (closure passed as the last argument to a function can appear immediat…

He mentioned the desire to drop the "C" from objective-c, but I'm curious what this means for using c/c++ libraries now. Do they need to be wrapped by objective-c before being visible in swift?

"You cannot import C++ code directly into Swift. Instead, create an Objective-C or C wrapper for C++ code."

Re: The Swift Programming Language

#517

Earlier quoted context omitted.

Yep, same here. It looks pretty JavaScript-y, which is familiar at least. I think this is a good move on Apple's part.

It's probably a wise decision to have an "Algol patterned" language. No non Algol patterned language has ever become a mainstream programming language to my knowledge.

I agree with the first, but disagree with the second part:

COBOL, Fortran, JCL (not Turing complete, AFAIK), SQL, Excel, DOS batch files all were (fairly) mainstream at some time.

Re: The Swift Programming Language

#518
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.

Isn't that essentially what Rc or Gc are? Rust obviously can't get rid of the other types, since safe manual memory management is one of their core use cases, but it does support automatic memory management.

Re: The Swift Programming Language

#520

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

My dislike is that it uses [] for method calls. It's like making Objective-English where we swap Z and A and j for o, just for the hell of it. If thzt sjunds like fun tj yju, thzn gj fjr Jboective-C.

very genius response!
Post reply on HN