I am not the biggest Apple fan in the world, and will probably not use Swift professionally, but I'm still super enthused about it as a language and I am glad it's entering the marketplace. We're going to have sum types and type inference in a mainstream language! For the first time, professors can teach a language like SML and have a good response to the question "so how is this going to help me in the real world?" I really, genuinely hope this will lead to better choices of languages in introductory programming classes.
F#, Scala, OCaml, Haskell, Clojure already have uses at big financial corporations and bio-informatics.
However, Swift is another great way for spreading the ML gospel to mainstream developers, specially if it slowly takes Objective-C's place in Apple's heart.
Does Clojure support pattern matching? AFAIK, the only thing that is "functional" about Clojure is its immutable data structures (and closures, but even JS has those).
Well, 1930's functional programming. Those techniques developed into various type theories pretty quickly (at the time for foundational reasons, but also for comprehension/management/expressiveness reasons).
Or if you have a more strict reading, Lisp is implementation-driven FP in the 70s compared to theory-driven FP from the time.
I think it kind of does. FP is a moving target---more of a cultural identity than a technical definition. As it becomes more mathematically focused it will become less applicable to (some) Lisps. If this progression continues and dependently typed languages become increasingly practical we may someday call them FP-without-quotes and even displace things like Haskell and OCaml.
Hardly. I even begin my commentary noting that "FP is a moving target" and a social phenomenon more than a technical one. I personally avoid the term as possible in much the same way I avoid the term "data scientist". If you want me to do Data Science I'll get excited and ask you for statistical project details.
Which language? C++? Java? Both now have closures. Closures aren't the indicator that a programming language is functional; I need something more - though I admit that I'm mostly used to static functional languages, I guess ADTs are not so useful in a dynamic language.
As with any programming paradigm, its not really useful to think of "functional" as a binary feature of programming languages, but rather an approach for which programming languages have varying degrees of support.
It has a support for destructuring, but no true pattern matching. Given the lack of algebraic data types, there's the question on what pattern matching would be supposed to match on.
Hey guys, do you know if swift will be ever open-sourced? After the WWDC they said that was early to think about it while in beta. So, what's the status now?
You can't even build Xamarin's sample project without demoing a commercial license, because the sample project is falls outside the app size restriction.
Actually there is. One of the big selling points of Go is its ability to produce self contained binaries. Swift would share this but also be a language that is more full featured.
GNUStep failure is more to do with Objective-C being such an odd language for most people.
Fond memories. I used to use WindowMaker on my old RH 6.2 system (or was it 7?), maybe even Fedora 1. But I never understood the dock - I was expecting a Windows-style task bar and the dock really isn't that.
The fact that it sat beneath other windows meant you had to constantly shift windows to get to it, which I found frustrating. Likely a configuration option?
It probably runs excellently on modern hardware, albeit with no GPU acceleration or anything to reduce main CPU cycles.
Apple opensoucred their Objective-C compiler only because the GPL on the GCC forced them. They invested a lot in the BSD licenced LLVM. I don't think they did this just for fun, but to avoid they have to do that.
It was streamed in the open HTTP Live Streaming protocol. It just so happens that the only web browser that implements it in Safari. Worked fine in VLC.
Is there any other way to do live streams embedded on a web page without a proprietary Flash plugin?
Hardly open. It'd be like if Google rewrote the Gmail frontend to native dart and then just blamed the other browsers for not having a native Dart VM. Dart is even standardized (by ECMA), unlike HLS which isn't standardized.
It would enable porting to other platforms, and it's also just useful to be able to look at how things implemented. I've benefitted a lot from being able to look at the Objective-C runtime source code, for example, because I can see how things work or where things go wrong.
I would be interested in a Swift port for Linux server-side/command line dev. Not so much client UI dev. Swift on Linux servers could help Apple sell more Macbooks to developers.
And Microsoft puts money on F#, Haskell and OCaml, all of which already have better Linux support.
Swift is great for pushing functional programming down the throat to mainstream developers that wish to target iOS, but it is no more pragmatic than OCaml or F#.
For the OP use case, targeting Linux server software is already better served by the languages I mentioned.
If Apple decides/realizes Swift was a bad idea, you will be out of luck with your codebase. Unlike open source where users can continue the work of the corporation.
"You can now submit your apps that use Swift to the App Store. "-that's great news!
For Hackers in SF: We are running a Swift Hackday at GitHub HQ on the 27th September. There will be food, drink, swag and lots of other Swift hackers! Check it out & RSVP at http://SwiftHack.splashthat.com
This is clearly a marketing-driven 1.0. It's really not ready, and wouldn't reasonably be called a 1.0 otherwise.
However, they've been pretty good about sticking to a solid set of features and not over-extending themselves for this initial release. It seems fairly clear that they intend to go in and fill out a lot of stuff later, and preferred a smaller set of solid features to start with rather than trying to do everything at once.
They've also been pretty clear that the language is going to be in a state of flux for long while. From the Swift Blog:
"Binary Compatibility and Frameworks
While your app’s runtime compatibility is ensured, the Swift language itself will continue to evolve, and the binary interface will also change. To be safe, all components of your app should be built with the same version of Xcode and the Swift compiler to ensure that they work together.
This means that frameworks need to be managed carefully. For instance, if your project uses frameworks to share code with an embedded extension, you will want to build the frameworks, app, and extensions together. It would be dangerous to rely upon binary frameworks that use Swift — especially from third parties. As Swift changes, those frameworks will be incompatible with the rest of your app. When the binary interface stabilizes in a year or two, the Swift runtime will become part of the host OS and this limitation will no longer exist."
Can anyone tell me about the interop situation? I'm working on my first iOS app and doing it all the old way with Obj-C, and some things have been a little difficult to grok even though they've been around a while(AVFoundation). I'm very interested in the new Metal graphics API that Apple showed at their presentation. Not sure if I should just switch to Swift for everything now or continue learning/working in Obj-C and slowly transition.
I wouldn't recommend Swift to anyone that's new to the iOS SDK. I answered this question recently on stack overflow (http://stackoverflow.com/a/25751738/77567). Here's what I said:
- Objective-C will be around and supported for a long time. (Apple has a massive amount of Objective-C source code that it's not going to port to Swift any time soon.)
- Almost all iOS tutorials, examples, and books use Objective-C.
- Almost all iOS-specific third-party source code you might want to use is implemented in Objective-C.
- It's easier to use C and C++ libraries from Objective-C than from Swift.
- There are many Objective-C experts you can get help from. There are very few Swift experts.
- The Swift language and its standard library are currently not very well documented.
Stick with Objective-C for now. When you're comfortable with the iOS SDK and Swift is better documented, you can consider learning Swift.
Apple could dramatically accelerate this process by switching their own new development from ObjC to Swift. The huge amount of legacy code means this couldn't happen overnight, but if Apple is obviously making the switch for their own new development, Swift will have a huge credibility boost. Apple wouldn't be able to abandon it (or let development stall) without hurting themselves. Until Apple puts themselves at a similar degree of risk as other Swift adopters, developers are going to wonder about the wisdom of committing to an Apple-only platform that Apple hasn't committed to.
No, more correctly ObjC is compiled into assembler that uses a C/C++ runtime.
Swift uses some C/C++ under the hood, and integrates it's object model into the ObjC object model (which is C). However, swift structs are not objects, from what I can tell they are virtually identical to structs in C (from a memory layout perspective).
Some swift objects are incompatible with the ObjC object model and cannot really be used from ObjC or really any other language (it does name mangling like C++ which makes interfacing rather difficult)
> I'd like to know if I can write an app in Swift that can run on iOS6.
No. From Xcode6 release notes:
"iOS 7 and OS X 10.9 minimum deployment target
The Swift compiler and Xcode now enforce a minimum deployment target of iOS 7 or OS X Mavericks. Setting an earlier deployment target results in a build failure."
To clarify, is Xcode 6 enforcing a minimum deployment target of iOS 7 even if the app is written in Objective-C and not Swift? If so, I think I'll need to stay on Xcode 5 a bit longer.
Swift is just a fresh new language which is compiled statically just like C/C++.
Swift's Objective-C compatibility mode is a kind of ugly extension feature to support their legacy code. The compiler makes inter-op stuffs automatically.
You can target only down to 7.0 because Apple set the goal of 7.0. There should be some stuffs required to support Swift, anyway it doesn't matter unless you're a runtime engineer. Point is earlier than 7.0 is out of support by Apple.
This might be a stupid question, but does Objective-C have versions? Objective-C was always talked about in terms of the iOS version, even when the language itself was changing (eg blocks).
New Objective-C features are introduced with new versions of the compiler (and Xcode tools/SDK), but each feature may be deployed on different versions of iOS/OS X (depending on how much support they need from the underlying runtime/operating system). This table breaks it down: https://developer.apple.com/Library/mac/releasenotes/Objecti...
The language itself hasn't had any official version numbers since 2.0 (in 2006), but the runtime has (not very public) version numbers if you look at the source: http://www.opensource.apple.com/source/objc4/
It'll let you run Swift code from your browser. The Learn page gives you a short run down of some features as well (I'm in the middle of writing up content for it, what's there now is a placeholder really, just the basics) and links to more documentation from Apple.
That's what I was looking for. Really appreciate it.
iOS/Xcode as a first programming environment is really odd and foreign to me, but my brother seemed excited about it, and I want to encourage him. He's really talented, he could be amazing as a software engineer if he ever wanted to be one.
And it's quite a good manual at that. Starts with a high-level overview of language features in plain English, then provides a firehose of nitty-gritty.
Beware, some of the vids are probably out-dated. It was my experience that every version of XCode6beta that came out broke my app with syntax or object-access type changes. I just downloaded XCode6GM and a bunch of stuff I was doing with "as NSArray" forced me to do "as? NSArray". And self.navigationController.navigationBar needed a "?" appended to controller, otherwise you'd get the very confusing build error saying something like "navigationController has no member called navigationBar".
I don't know if Swift would be the best language to learn programming. Python is probably a better option. I would avoid platform specific languages until you are hired to work in that space. Open platforms like Python are much easier than close platforms to get started in Computer Science.
A good place to start with python would be the Introduction to Computer Science course on Udacity.
Can you elaborate on how static library support is a hard requirement for your workflow and why frameworks (LLVM modules) don't meet your needs. I'm genuinely curious as I haven't had a chance to do any real work in Swift yet.
"You’ll notice we’re using the word “GM”, not “final”. That’s because Swift will continue to advance with new features, improved performance, and refined syntax"
Typically, when people say that a language "reached 1.0", they mean the very end of that process.
If Apple does it correctly, 1.0 means that there will be no backward incompatibilities until a hypothetical version 2.0.
As a user of a not yet 1.0 language (Elixir, though it has reached release candidate status), backward incompatibilities can be a pain to deal with. The reason: third-party libraries that may or may not be updated, more or less quickly.
And yet it's absolutely necessary to get things right while you design the language, because every single mistake will be carried forward practically forever: see Python 3 as to why it's really hard to fix a language...
Ah. Well, other languages also get new features, improved performance, and refined syntax after 1.0. Are you objecting to the implication that the pace of development here will be more rapid, or an assumption that they plan on making backwards-incompatible changes?
That's fantastic! Now, too bad I can't watch your video tutorials on my Macbook Pro using Chrome. Or Windows 7 using Chrome. The messaging on the site declares it requires Safari. So much of the open web... Quietly moves along to Android.
I think HLS is pretty awesome and this hasn't anything to do with HTML5 as what Chrome supports doesn't allow for live streaming, which is why sites like Twitch still use flash for Chrome. Chrome should support HLS, but they aren't going to for anything but Android, so flash it is for the foreseeable future. If anyone knows why or where I am mistaken I would like to know.
The issue is not black and white. Why should Chrome implement Apple HLS, rather than Adobe HDS, Microsoft SmoothStreaming, or MPEG DASH, among other HTTP streaming formats? What about RTSP -- a protocol designed for streaming, which Android had good support for in the video tag?
In any case, live streaming in Chrome is possible with WebM, or even WebRTC. Flash is not ideal either, but at least it has consistent support on the desktop.
RTSP doesn't go through firewalls easily. That's pretty much why Apple invented HLS. It's a nice, minimalist solution to adaptive bitrates that uses standard HTTP to get the job done. Big players such as the BBC have adopted the standard (ugh, I'm writing a client for it right at the moment!), so it's not a particularly fair categorisation to label this as a purely Apple thing.
If it's possible why hasn't anyone implemented such a thing? I'd like to implement such a thing and I wouldn't know where to start, but I would with HLS. This is the 1990's all over again. Different browsers supporting different standards, different video encodings, different JavaScript features, sometimes, when I'm having a spell, I'm not so sure competition is actually all that great anymore.
And no you cannot stream with webrtc without building a complicated back end webrtc MCU implementation which requires significant engineering and is not at all supported by the creators of webrtc who are focused on peer to peer inside browsers.
In the 1990s, people used to write these things called plugins to add features, like support for specific video containers and codecs, to browsers. Now I guess browsers have to have everything built in or not at all. "Progress".
The web is totally open, but just because something is open doesn't mean you have to support it the same way everywhere. Not everything has to run on everything. As a creator of something, Apple should totally have the right to decide what is best for their own products, website, etc.
Many Android users are noisy after an Apple media event, but they have been particularly loud this week. I don't really care what operating system your phone uses, but I do wonder why the iPhone 6 seems to have put so many in such a panicky advocacy mode.
Golden Master. Typically refered to the version of the software that would get burned on floppies/CDs, although the word has taken a more fluid meaning with ubiquitous digital distribution.
iOS is the lead platform for mobile app development. It is also by far the most lucrative both in terms of sales and the quality of the users i.e. for non-sales revenue. Hence there are going to more than a few developers on here interested in it.
We see posts all the time for Go, Rust etc. Why would Swift be any different ?
Don't know why you're getting down voted, sure Swift has some neat features, but if any other company released something like this that was closed source, no one would really care.
C# is hideous to get running consistently (if at all) with recent versions and libraries cross platform. Perhaps this will change in the future, but they've not been particularly brilliant about it over the past decade
I don't know what libraries you talking about but nearly everything from nuget starting with image processing and ending with orms and crypto work just fine on linux.
Even more when K will come out I don't think there will be any worries at all.
He's getting down voted because his assertion that the attention paid to Swift is driven entirely by hipsterism is Slashdot-esque nonsense. People who make a living writing Objective-C will be making a living writing Swift.
no one cared if Javascript the language was open source when it was the only way to do client side scripting for web pages.
similarly Swift has iOS and OSX - other languages are available on these but I guess developers are anticipating Apple emphasising Swift over Objective-C going forward
Why does it matter that it's not open source? There is plenty of closed-source stuff on here all the time. Maybe it's getting attention because the iPhone is still an incredibly profitable platform to code for, and a lot of people on here are involved in that.
Because it's going to have more reach than most open source programming languages. In a few weeks, millions of people are going to be running Swift apps on their phones, tablets, and desktops.
Regarding which basic features they had to add after the first wave of beta feedbacks I don't believe them that they have been developing + using the language for years.
I can't believe Apple would release a brand-new language with zero baked-in support for concurrency. In this day and age? Looks like developers will have to resort to 2nd grade efforts like GCD. I just don't get it. There's no excuse for it. Port Go's channels and go-routines to it, or something else, but come on - it's 2014, not 1998?
If you think about it none of what you said really makes sense.
In what way is GCD not a concurrency mechanism ? And why would you port Go's channel/routine model when it is less flexible than the Actor model ? And even then what type of mobile applications require that level of concurrency ? I've built about 20 mobile apps and not once needed anything more than a few background tasks.
Swift has GCD and NSOperationQueue which work well. Why marry yourself to that functionality if you can externalize it with the potential to change it in the future?
Sorry, I'm pretty sure you meant Swift has reached 2.0. And that was a couple of months ago. Also why are you people talking about Swift like it's a programming language and not an object storage system? :)