The live REPL is totally out of Bret Victor, very impressive.
The Swift Programming Language
621–630 of 970 posts
Re: The Swift Programming Language
#622Earlier quoted context omitted.
This. In my case a 1Mbyte memcpy in the middle of a loop this morning. Enough to blow the CPU cache out of the water... 300x improvement instantly by moving it out of the loop.
Are you sure it wasn't just because you were then no longer doing a large memcpy repeatedly?
I think it was covered by "naive memory management" and "shitty outsourcing". I'm paid to fix their stuff.
Re: The Swift Programming Language
#623As 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…
Is it realistic to try to dive right in to the 500-page book they provided without a computer science background, just HTML/CSS/PHP self-taught experience, to learn the language? Or should I take other steps first?
Honestly skimming 500 doesn't sound horribly hard to me. I've done that a few times to pick up something new. As ap said you won't learn the language like that but you will have a good reference to go and learn from after the fact.
After that you could probably work through the examples in said book, or at least the interesting ones.
P.S. above steps is all I really learnt from my cs degree.
Re: The Swift Programming Language
#624As a detached Apple-related news follower, can some please update me: Is Swift going to become the new main development language for iOS?
Re: The Swift Programming Language
#625Ok, what about runtime support for older devices/iOS versions? They didn't say anything about it.
EDIT: Tested with 6.x and works.
Re: The Swift Programming Language
#626Re: The Swift Programming Language
#627I'm reading the manual and liking nearly everything. But then I stumble across: > Alternatively, remove a key-value pair from a dictionary with the removeValueForKey method. Is that the day where an Objective-C got to choose method names? Why not dict.delete() or similar?
I’m not a one-character variable name type of person, but this makes my fingers (and my brain) ache, and for me makes the code harder to comprehend (wood for the trees, I guess, or something like that)
Re: The Swift Programming Language
#628Reading people compare Swift to other languages is pretty hilarious. OCaml.. Haskell.. CoffeeScript.. Ruby.. Go... Kotlin... JavaScript.. Scala... No one is saying it so I will: It looks like damn Java 8. It is probably not a good sign that it can be immediately compared to every modern (and not so modern) language in existence.
And Swift seems to resemble another Apple language Dylan, which was based on Scheme/Lisp. All languages since the are in trouble! I really like that it is incorporating good parts of many, more terse languages. Nothing wrong with selectively absorbing good ideas. But a huge part is the interactive nature. I dabbled in Smalltalk some years ago and have been annoyed at compiled languages ever since, resorting to things…
Re: The Swift Programming Language
#629As 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…
Just as a point of fact, javascript -- at least the v8 implementation I'm most knowledgeable of -- doesn't "keep the entire context alive forever." Only variables used in the closure are allocated into the closure (i.e. on the heap), the others are allocated on the stack and disappear as soon as the function returns.
I don't use iTunes so can't read their book, but I wanted to ask: you say that ARC is still their GC strategy, correct? So reference cycles are still an issue? I'm surprised at this. I can see reference counting being a strategy for moving a non-GC'd language to GC (like Objective-C), but to start a new language with that constraint is surprising.
Re: The Swift Programming Language
#630Earlier quoted context omitted.
From a user's point of view, it's basically straight out of the Rust book, all the gravy with also relaxed ownership and syntax. It has it all [1]: static typing, type inference, explicit mutability, closures, pattern matching, optionals (with own syntax! also "any"), generics, interfaces, weak ownership, tuples, plus other nifty things like shorthand syntax, final and explicit override... It screams "modern!", has a…
Indeed, I'm not sure what Swift's concurrency story is yet. Other than that it's encouragingly similar to Rust (we're evolving in the right direction!), but not quite as low-level.
Swift could very well render Rust almost totally irrelevant within the OS X and iOS sphere of software development. If we end up eventually seeing Swift implemented for other platforms, then the chances of Rust's long-term success diminish even more.
Things might have been different had a stable, even if somewhat imperfect, initial version of Rust had been released by now, thus allowing it to gain some adoption and traction.
I hope that the "But Rust isn't targeting those developers!" argument isn't used to try to justify this mistake, as well. Rust is already facing stiff competition from languages like Go, C++11, C++14, Scala and even Java 8.
With the announcement of Swift, Rust's niche and audience are getting smaller, further preventing the widespread adoption that's necessary for a programming language to become truly successful.