Apple Announces New Programming Language Called Swift
jmcbain (1233044) writes "At WWDC 2014 today, Apple announced Swift, a new programming language. According to a report by Ars Technica: 'Swift seems to get rid of Objective C's reliance on defined pointers; instead, the compiler infers the variable type, just as many scripting languages do. ... The new language will rely on the automatic reference counting that Apple introduced to replace its garbage-collected version of Objective C. It will also be able to leverage the compiler technologies developed in LLVM for current development, such as autovectorization. ... Apple showed off a couple of cases where implementing the same algorithm in Swift provided a speedup of about 1.3X compared to the same code implemented in Objective C.'"
Language basics, and a few worthwhile comments on LtU.
and it needs an new OS the mess up other apps and makes people not want to get the new OS.
AAPL's YAPL
Good bye source compatibility. We hardly knew ye.
First Windows, and now OSX. I am still maintaining applications that are built crossplatform (Windows/Mac/Linux, with unified GUI look) but it's getting harder every year and, by the looks of it, will be impossible soon.
Which means that an individual developer (like myself) or a smaller shop would have to choose one big player/OS vendor and stick with it. That increases risk and makes small players that much less viable (while, of course, helping the big ones consolidate user base and profit).
Funny how the world works.
That's what about 1/10,000th of what hiring a good programmer would get you, at the price of not being to find any programmers.
I was particularly surprised to see closures appear. So far I've only been using them in Javascript and Perl, but my experience has been that they are about 15% added flexibility for about -40% readability. That is, they make it harder to tell what's going on, more than they reduce development time.
Just the other day I was wondering when we'd have another programming language.
The live REPL reminds me of Bret Victor, who used to work for apple.
http://worrydream.com/Apple/
I hope they take advantage of some of his ideas?
https://www.youtube.com/watch?...
"Immutability has a slightly different meaning for arrays, however. You are still not allowed to perform any action that has the potential to change the size of an immutable array, but you are allowed to set a new value for an existing index in the array. This enables Swift’s Array type to provide optimal performance for array operations when the size of an array is fixed."
i.e. Swift arrays that are "immutable" actually aren't. Way to rewrite the dictionary. But wait, it gets worse. Here's for some schizophrenia.
"Structures and Enumerations Are Value Types. A value type is a type that is copied when it is assigned to a variable or constant, or when it is passed to a function. Swift’s Array and Dictionary types are implemented as structures."
So far so good. I always liked collections that don't pretend to be any more than an aggregate of values, and copy semantics is a good thing in that context (so long as you still provide a way to share a single instance). But wait, it's all lies:
"If you assign an Array instance to a constant or variable, or pass an Array instance as an argument to a function or method call, the contents of the array are not copied at the point that the assignment or call takes place. Instead, both arrays share the same sequence of element values. When you modify an element value through one array, the result is observable through the other. For arrays, copying only takes place when you perform an action that has the potential to modify the length of the array. This includes appending, inserting, or removing items, or using a ranged subscript to replace a range of items in the array"
Swift, a language that is naturally designed to let you shoot your foot in the most elegant way possible, courtesy of Apple.
Just what we need! Better compilers is what we really need, but that apparently is too difficult.
Must have 5 years experience.
that should be to foster a gay and new faces and many God, le7'5 fucking nearly two years
They could have chosen a name other than that of the international banking protocols. Asking for SWIFT programmers is going to get them a bevy of COBOL coders who know the protocol.
I do not fail; I succeed at finding out what does not work.
I find these two aspects interesting and wonder what the trade off is. Longer compiler times?
"Designed for Safety
Swift eliminates entire classes of unsafe code. Variables are always initialized before use, arrays and integers are checked for overflow, and memory is managed automatically. Syntax is tuned to make it easy to define your intent — for example, simple three-character keywords define a variable (var) or constant (let)."
" Swift code is transformed into optimized native code, "
10 years professional development experience preferable.
Many sites are reporting Swift as having "none of the baggage of C."
However, they also report that "Swift code can still be mixed with standard C and Objective C code in the same project."
Seems to me that if you can call C routines, C can happily malloc() and free() the heap and leave stale pointers into freed heap. Likewise, C can happily point into the stack and leave pointers into stale stack frames, and point past the end of arrays, etc.. I don't think they can get rid of the "baggage of C" withoud building all kinds of performance killiing safety checks into the C code. If I'm wrong about this, please don't hesitate to let me know!
--- Often in error; never in doubt!
It's supplementing the existing Obj-C and C API's, not replacing them.
I would imagine already existing code will continue to function just fine.
You know how high level language advocates like to claim that being high level means it can actually be optimized better than a low level language since the compiler knows what you're doing? And you know how it's never actually true? It finally happened.
I mean, there is already a swift programming language. Yes, it is not popular, but when you decide on a name for your language don't you at least google it first? Is "swift" so unbelievably cool that a name collision (even with a "small" entity) does not matter? But, yeah, it is Apple we are talking about, they probably invented the word "swift" which people and companies like SUZUKI have been copying for other uses here and there...
Violence is the last refuge of the incompetent. Polar Scope Align for iOS
...with "5 years experience Swift programming" coming from the recruiters in 3, 2, 1...
I wanted to write apps and tried to learn Objective-C, but as a coder that started with C and then moved on to C++ and PERL (the swiss army chainsaw), the language syntax hurt my ability to read it. In case you don't know what I am talking about, here are some of my learning notes
// old school // send a message or call a method
myObject.someMethod();
[myObject someMethod];
result = myObject.someMethod(); // old school // method returns a result
result = [myObject someMethod];
result = myObject.someMethod(arg); // old school // pass an argument
result = [myObject someMethod:arg];
You can see the Old School syntax above (which works in Objective-C) and the Objective-C standard syntax below. The square brackets [ ] and colons : just hurt my mental debugger... [ ] and yes I know Objective-C is a Superset of C, so they had to steer clear of the C-Syntax but it just looks wrong. Further, I know that I could write my own style of Objective-C but I wouldn't be able to read the code of others. Apple had to start somewhere and Steve had the NeXT languages ready to go but to me the syntax is ugly and offensive. However, I am ready for a better Apple language.
I can't wait to see a SWIFT code example, if it gets rid of the NeXT Objective-C Superset Syntax, I might be coding for iPad and Mac sooner than I thought. If anyone has a code example, please share it, I would like to see what a function, method, or message call looks like. Hoping for parenthesis and a Standford iTunesU class. Guardedly excited!
Just kids re-inventing the wheel again.
I'm sure everyone was thinking, we don't have enough languages that are basically a badly implemented subset of C++. We need to make another one.
Let's see if Android will respond by creating an even less compatible C++ clone than Java.
Apple is the king of vertical integration and proprietary standards. The only thing that surprises me is that it took them this long. MS beat them with C# by how many years? Google has two of these things (Go and Dart) AFAIK.
Now I just need to finish my universal cross-compiler that never quite takes advantage of all the features in these languages because it's too damn difficult and they are moving targets.
That's it. We need a language called "Target" that's constantly moving.
For all intensive purposes, "whom" is no longer a word. That begs the question, "who cares"?
...5 years experience, and you pretty much would have had to have written the language to have that much...
Do you get Swift Boating? http://en.wikipedia.org/wiki/S...
Strange, because immutable arrays are possible and (asymptocically) efficient. Standard ML, the predecesor of OCaml and F#, has it it http://webcache.googleusercontent.com/search?q=cache:7nopWhLOQjwJ:www.standardml.org/Basis/vector.html+&cd=1&hl=en&ct=clnk&gl=nl&client=safari (Google cache as they seem to be moving servers).
Apple had a fine language 20 years ago. It was said to influence the design of Ruby and Python. They butchered it into an Algol-like syntax because 'real programmers' can't grok s-expressions. Then they abandoned Dylan.
Next, they created a language for mobile devices. Its programming model was said influence the design of JavaScript. Then they abandoned NewtonScript.
No this is NOT a troll, please read.
A claim of cross-platform is one thing. But in practice I know of no significant apps using Qt that exist in the wild that work on OS X.
Please provide a link to any mainstream working application for Mac OS X that uses Qt. I don't know of a single one because Qt's support for XCode is incredibly poor.
(And if I wrong, I will free accept it and eat my post, but I have yet to see one and I have actively looked. Qt's support for OS X is pretty, really bad but admitted I haven't tried it the last 18 months to see if anything changed).
Priest: "Universe from nothing, no laws of physics, sped up time"+ huge discrepancies. Creationism? No. Big Bang Theory
My favorite part of immutability is 'let.'
If you write:
let i = 5;
You have just declared 'i' to be immutable. Intuitive, isn't it?
"First they came for the slanderers and i said nothing."
When Steve Jobs announced the iPhone, Cisco owned the trademark to iPhone as I recall. And he didn't care.
Apple has enough $$$ to payoff for virtually any name they set their mind to, just like what they did with the iPhone.
http://www.idownloadblog.com/2012/01/27/apple-cisco-iphone-trademark/
Priest: "Universe from nothing, no laws of physics, sped up time"+ huge discrepancies. Creationism? No. Big Bang Theory
The language doesn't have exceptions.
It has strong emphasis on assertions though, so feel free to use those as a substitute.
"First they came for the slanderers and i said nothing."
There's not really a trade-off. It's just newer. Variable types can be inferred statically using unification (which is fast and actually more expressive than manually typed languages). Standard ML has done it for many years.
Same with forcibly initialized values. Means you don't need to check pointers ever. Basically the same as references in C++.
Bounds checking is rarely needed. Again, I point to Standard ML; here, instead pattern matching and higher order functions are used. This is basically what Swift does with closures and the map operation. If you look at the fold operations of all Standard ML types (that's basically the inspiration for the map-reduce paradigm), it is obvious that no bounds-checking is necessary, and iterating over an entire structure is almost always what you do with a data-structure (aside from initialization), and the only operation where you access the structure many times and would have an overhead for bounds-checking.
Memory seems to be managed using ref-counting, which is similar to auto_ptr in C++. Barely any overhead (a zero-check on deallocation, which can even be biased towards branch-predicting that no deallocation needs to take place).
I knew that Swift was trouble when it walked in, trouble trouble trouble
"First they came for the slanderers and i said nothing."
Aren't they all scripting languages anymore
Apple definitely needed to do something because Objective-C was really getting long in the tooth. As far as new languages go, at first glance, this looks nicer than what the other players have to offer (Java, C#, Go).
However, proprietary languages don't tend to fare particularly well. If this gets an open source implementation and isn't patent encumbered, however, it might also be a good thing for Linux.
For Apple, then once for everybody else! Too much time on my hands! Said Tommy Shaw!
"I can code faster than ever!" Tom said swiftly.
Too soon?
Oliver's law of assumed responsibility: If you're seen fixing it, you will be blamed for breaking it.
> the compiler infers the variable type, just as many scripting languages do
Someone doesn't seem to understand the difference between dynamic typing (which is what "scripting" languages use) and static typing with type inference (which is what Swift uses).
requiring 5 years of experience with Swift on iOS?
My god, it's like I'm at Stack Overflow, reading the typical stupid and cocky "WHY ARE YOU DOING IT THAT WAY?!?#?!?@?!@?!?" responses that are so prevalent over there.
His team probably has its reasons for using or requiring GDB. And you know what? They're probably pretty damn legitimate reasons, too.
I'm sure they know about LLDB. But it's probably not what they need, and thus they do not use it.
If they need GDB, then that's what they need. It's that simple.
What we don't need is somebody like you questioning the validity of their very real need.
I haven't yet decided whether this is yet another programming language we needed, but I will be interested to see whether Apple release the Swift support in LLVM as open source. One thing that I dislike more than new programming language for the sake of doing so, are single-platform languages.
Jumpstart the tartan drive.
It's Scala. They left out pattern matching and didn't drive the monadic nature of common programming collections through the collection classes. You can leave out the monads (although the first time you want to convert the contents of an Optional value via a function returning an Option you'll wish they hadn't) but leaving out pattern matching was a plain and simple misstep.
"Funny how the world works."
No it isn't. You're probably one of the very people that was against the proliferation of Java, or cross platform generally. What did you think was going to happen? C would be cross platform?? Get real..
I'm sure they know about LLDB. But it's probably not what they need, and thus they do not use it.
Whatever they NEED gdb for, they would be better off using LLDB at this point.
I was a huge fan of GDB in the past. But that time has gone.
"There is more worth loving than we have strength to love." - Brian Jay Stanley
It doesn't use Metro's libraries.
Anything that doesn't use the Windows Runtime API (what you call "Metro's libraries") will not be approved for the Windows Store and will not run on Windows RT tablets or Windows Phone 8 smartphones.
Looks like a decent language, actually.
I was under impression that all new windows "apps" had to be written in C# against a new SDK that has neither binary nor source compatibility with Win32/posix/C/C++. I'd be glad to be wrong, but that's what I've seen so far.
Only Windows Phone 7 and Xbox Live Indie Games required C#.* C++ works on Windows Phone 8 and Windows RT, though they do require use of the Windows Runtime API. For actual Windows on x86, you can continue developing desktop applications without having to deal with Windows Runtime (the "Metro" crap).
* In theory, they required verifiably type-safe CIL compatible with the .NET Compact Framework. In practice, they required C#, as standard C++ is not verifiably type-safe, and DLR languages require functionality not in .NET CF.
Good bye source compatibility. We hardly knew ye.
I have absolutely no compatibility problems. I strictly use objective-c for only user interface code. The core functional application code is written in c/c++. I have multiple iOS/Android apps whose core code is shared and can even be compiled with a console app under Mac OS X or Linux, I use this for regression testing and fuzzing. A headless Linux box in the closet exercises this core code. Similar story for Mac OS X and Windows.
Swift code can replace objective-c code and it matters little to me. Has zero impact on other platforms I target.
Admittedly I've ported other people's code between Windows, Mac and Linux for years and written my own code for Windows, Mac and Linux for years and as a result I am extremely aggressive about separating UI code from functional code.
For those people using some sort of cross-platform wrapper for their project, if it supports Mac OS X objective-c it will probably support Swift. Even if it takes time for the wrapper developers so what, the use of Swift is entirely optional.
Apparently your "team" is too stupid to install GDB and too incompetent to write a string to select a font.
I'm NOT going to ditch 30-years of code base just for one FABRICATED DEMO !
Fuck Apple.
PS
Good for Apple that I am not piloting a B-52H with a Mk-41 just to dig a hole where the Apple
campus in Cupertino now exists.
Bye bye Cupertino and Apple.
Happy zombie day
Ha ha
GTK on the other hand is horrendous and needs to die a miserable death.
Ok, so now you'll be developing software using Apple's frameworks and Apple's language to run on Apple's runtime, after passing Apple's compiler (i.e. LLVM) for download using Apple's store (after finding your product with Apple's iAD) directly onto Apple's products built with Apple's custom processors, after you register as an Apple Developer. If your app needs to do something outside this environment, you can use said APIs now to reach out to Apple's Could and Apple's Database servers. And if your app is really successful as measured by Apple Crash Reporting and Apple Usage statistics or Apple's iTunes Connect, then they'll just straight out fucking copy you.
Something about the new "language" is what makes that summary start sounding ridiculous.
-- I was raised on the command line, bitch
and you pretty much would have had to have written the language to have that much
Exactly. It sounds like someone who constructs such a job posting is looking to poach the language's designer.
In the Obj-C case, it's obvious, the parameter names are part of the name of the function
Such a convention can also be done in C++: someObject->setColorRGBA(0.4,0.3,1.0,0.5);
Or in JavaScript: document.getElementById('main') and element.appendChild(another)
Dang right. I imagined connections to the famous satirist behind A Modest Proposal and Travels into Several Remote Nations. Is this a satire, or is it the real thing?
Bjarne Stroustrup once gave some ideas on what requirement should be met before he would consider designing a new programming language. This was his list:
* What problem would the new language solve?
* Who would it solve problems for?
* What dramatically new could be provided (compared to every existing language)?
* Could the new language be effectively deployed (n a world with many well-supported languages)?
* Would designing a new language simply be a pleasant distraction from the hard work of helping people build better real-world tools and systems?
Apple can definitely deploy the new language effectively, but I'm not sure it solves any problems.
"First they came for the slanderers and i said nothing."
It's like you forgot that Google exists. http://qt.digia.com/Qt-in-Use/
This looks bad:
Swift uses string interpolation to include the name of a constant or variable as a placeholder in a longer string, and to prompt Swift to replace it with the current value of that constant or variable. Wrap the name in parentheses and escape it with a backslash before the opening parenthesis:
// prints "The current value of friendlyWelcome is Bonjour!"
println("The current value of friendlyWelcome is \(friendlyWelcome)")
I hope they locked that feature down to constant strings. What could possibly go wrong with a language feature which lets you access arbitrary variables by name at run time by string interpolation?
(Hey, let's use an email address of "\(SitePrivateEncryptionKey)" and see what happens!)
...their IDE named Taylor.
Do you know of any examples of open source iOS/OS X software that demonstrates this separation of writing the user interface in objective-c and the guts in something different (e.g., c++)? I'm a total objective-c novice, but would be curious to see how it's done.
Anything that doesn't use the Windows Runtime API [...] will not be approved for the Windows Store and will not run on Windows RT
Digia has already done exactly that with Qt. [See "Getting started with WinRT".]
If your application runs on "Qt for WinRT", which in turn runs on Windows Runtime, then for the purposes of the Windows Store, your application runs on Windows Runtime.
Sandals wow~~~beauty~~
Apple's decision to enforce explicit nullability via the type system is very interesting/bold. http://deanzchen.com/the-best-...
Apple developped Dylan and later NewtenScript long long before MS had its 'own' language.
Real apps were written in HyperCard. It was VB before VB existed.
Make sure everyone's vote counts: Verified Voting
.. it is swiftly forgotten.
I had to figure out how to increment an NSNumber over the weekend. It's not pretty:
NSNumber *num = [NSNumber numberWithInt:[num intValue] + 1];
Seriously. Unless you're some foofy artiste, nobody gives a shit about Crapple.
Their entire business model has shifted to the assumption that they are the center of all creativity and innovation in the world.
And now they're going to sue everyone for using their creativity and innovation without paying some obscene licensing fee so nobody there has to every actually do anything.
Fuck Apple. I wish someone would nuke Cupertino so I didn't ever have to hear from those turtlenecking douchebags again.
Here is a Mac OS X GUI app with a window and a button implemented in objective-c (main.h, AppDelegate.h and AppDelegate.m). The button handler calls C code (Work.h and Work.c) to do some work. Note that if C++ code had been used then AppDelegate.m would have been renamed to .mm so that Xcode would compile it as Objective-C++, necessary to link properly against the C++ code it uses.
// main.m
#import <Cocoa/Cocoa.h>
int main(int argc, const char * argv[]){
return NSApplicationMain(argc, argv);
}
// AppDelegate.h
#import <Cocoa/Cocoa.h>
@interface AppDelegate : NSObject <NSApplicationDelegate>
@property (assign) IBOutlet NSWindow *window;
@end
// AppDelegate.m
#import "AppDelegate.h"
#include "Work.h"
@implementation AppDelegate
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
}
- (IBAction)buttonPressed:(id)sender {
some_work();
}
@end
// Work.h
void some_work(void);
// Work.c
#include <stdio.h>
#include "Work.h"
void some_work(void) {
FILE *fp = fopen("/tmp/work.txt", "w");
if (fp != NULL) {
fprintf(fp, "Hello World\n");
fclose(fp);
}
}
Do you know of any examples of open source iOS/OS X software that demonstrates this separation of writing the user interface in objective-c and the guts in something different (e.g., c++)?
The biggest example would be anything based on OpenCL, where you would do exactly that.
Also a number of games, use a shell of IOS framework stuff for things like game menus and leaderboards, but the actual game engines are C++ (and I'm not even talking about apps that use third party libraries like Unity).
"There is more worth loving than we have strength to love." - Brian Jay Stanley
They've invented FreePascal with a new name and constant definition, 'let' or is that from Basic?
I have created a brand new language too: Common Routine Acceleration Package. It autovectorizes common control structures to that multi-processing can be applied automatically to every program just by compiling it (and it automagically includes all thread libraries). Its just that some people have complained about the name.
I'm personally not impressed with swift... it seems rushed and not well done.
My team has already stopped supporting Mavericks because it apparently does not support GDB.
You can get GDB (and pretty much every other open source dev tool) from https://www.macports.org/
https://stackoverflow.com/ques...
I've been developing iOS Apps professionally for a while now. There are issues with Objective-C, but the function call syntax is hardly one. I'd actually even consider it a benefit. The messages tend to read like sentences. Each parameter gets a name (they're not quite named parameters, as you cannot refer to them by the 'name' inside the method body).
Consider:
hwnd = CreateWindowEx(WS_EX_LAYERED, TEXT("Hello"), TEXT("World"), WS_OVERLAPPEDWINDOW, 10, 10, 400, 400, NULL, NULL, hInstance, NULL);
vs.
hwnd = [SomeClass createWindowExWithExtentedStyle:WS_EX_LAYERED className:TEXT("Hello") windowName:TEXT("World") style:WS_OVERLAPPEDWINDOW x:10 y:10 width:400 height:400 parent:NULL menu:NULL instance:hInstance param:NULL];
This is a win32 method. And it's a bit of an extreme example. But you should see how the syntax allows for some "self documenting" code. How is this possibly "offensive"? I see code where method And I can't imagine this syntax being a barrier for any one outside of a beginner; any professional should have no problem adapting to this.
Objective-C is a pretty simple addition to C. Far far simpler than C++.
https://crypto.stanford.edu/~b...
If Pandora's box is destined to be opened, *I* want to be the one to open it.
... HR departments began advertising for programmers with 3+ years of Swift programming experience.
Swift also makes extensive use of variables whose values cannot be changed. These are known as constants
What am I missing here?
Geology - it's not rocket science; it's rock science
Boy /. Has gone down the toilet ...where's that site some built to replace it?
Apple showed off a couple of cases where implementing the same algorithm in Swift provided a speedup
Only a couple? You can do that in just about any language. Systemic improvements ... I guess they tried but failed or they would be announcing it.
Every corporation has their own language for their walled garden environment now. What happened to industry standards and portability of skills?
There's nothing mysterious about it. The Apple compiler I think even lets you mix C++ and Objective-C in the one source file. You just write your business logic in C or C++ and call it from your gui code in objective-C. As long as your business logic is easily callable from a C interface, it isn't hard. Of course, mixing languages is always painful to some extent.
Don't this code have the problem that you call some_work from the gui thread, and thus will block all updates of the graphics userinterface while some_work is running?
That problem can be solved, but it is always things such as long running tasks, and async callbacks which causes problems. Especially if you need to populate the gui with the work from some_work, while some_work is still doing its work.
Isn't auto-vectorization done in the back-end of LLVM anyway? So it shouldn't matter which programming language was used in the front end.
"We mustn't be caught by surprise by our own advancing technology" -- Aldous Huxley
You can still use all the same languages you did before.
Yeah! We can program in standard C++ on the iPhone like we've always been able to do!
Look, almost all software is an interface between a human and a machine. When you arrogantly decide to ignore half of your implicit interface, your software is going to suck. My project became wildly successful when I pissed off all of my programmers by promoting the human factors guy to management; all of the sudden we had usable software instead of "my module is sexier than yours" competitions that ignored the end product.
The tools and compiler for developing in this language will be available for OSX 10.10 only.
But I'm glad it finally did. And I love the way it feels very javascripty! :)
Seriously, though, this discussion was about PC operating systems.
Yet Microsoft is trying to confuse the public by calling Windows RT devices "PCs". (Source)
Name's taken apple try harder or are you just going to go around suing everyone who used it before you.
You are right, but the question is, where do you deal with that threading.... in some cases you would want it dealt with in work.c because you want it to be multi threaded on all platforms... if a task called is going to take a long time and block the UI on one platform it will do it on another.
Alternatively you could make that decision in the UI code but that would mean handling it on every platform.... now on the mac its pretty easy in Obj-C to dispatch a task to a thread, its probably easier than in C++ so maybe that makes it easiest to handle but then you have to turn around and do the same thing on every other platform you wish to support. I think that if you are supporting multiple platforms you would want your threading code to be in the shared code.... but its a design decision and it really does depend on your project and your needs.
"In America, first you get the sugar, then you get the power, then you get the women..." -H. Simpson
I sure hope the creators of http://www.swift-lang.org/ have got the trademark/IP. If not, they'd better prepare for an incoming lawsuit.
I'm glad the industry is run by people trying to advance programming languages and tools otherwise I would be writing my programs by punching cards.
It's already much faster and easier to deploy quality apps on IOS than Android, It looks like is going to get even easier and faster with this new language.
Please provide a link to any mainstream working application for Mac OS X that uses Qt. I don't know of a single one because Qt's support for XCode is incredibly poor.
Second Life. They still make regular releases for the Mac (and Linux). It's open source, so you can grab a copy and see how they do it. Xcode not required.
Have gnu, will travel.
"Kick in the pants"
Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
Hell, judging by recent developments, by that time all languages should have evolved to Lisp.
Don't complain about syntax, grammar, or spelling. There is no.hell like input on android.
(by god i hate reading documention in iBook form, is the most irritating thing known to man pages)
page 10, line 2 of the sample code - this seems to be a comparison operation with no consumer.
following is my opinion only:
in general the swift documentation is *far* too breathless in it's own praise to be believable, i find.
the hell of it is i now have another language to support in my own "portable" products, and another whole learning curve, sorting out all the personal little differences these precious lisping clowns have implemented, to meet a demand that will certain fizzle in a year or so.
unless swift somehow turns out to be genuinely *better* than existing languages, and therefore a real improvement, apple should be taken out and shot, without trial, for pushing bad drugs, essentially, on an already very unhealthy industry.
so far swift has all the hallmarks of a "vanity" product, and appears entirely constructed of existing concepts, so i do not hold much hope.
i will, unfortunately, be forced to learn this new beast, cover to cover, in my work, and i do promise to correct my impressions, should swift prove me wrong.
Don't this code have the problem that you call some_work from the gui thread, and thus will block all updates of the graphics userinterface while some_work is running?
The parent objective-c UI event handler (buttonPressed) has the same constraints as the child C function (some_work). Both should do very very little themselves and/or have a background thread do the work.
Well, thank you Apple for overloading yet another acronym. SWIFT is already popular in the financial industry for transactional information
Am I reading this right? That Objective-C is too hard and we need to remove the idea of strongly typed variables? Please, please tell me it isn't so.
Murphy's best law Design a system even a fool can use, and only fools will use it
Murphy was an optimist
I didn't have much time to look at the language guide, but in the short time I already discovered many things that exist in Scala, and even the syntax is very similar:
* Tuples
* Closures
* Swift seems to be a functional programming language, even more than Objective-C (the 'functions'/closures there are called blocks).
* For comprehensions
* var/val is named var/let here
Google in the past launched *Go* language (1) . Who's talking about it today or using? Facebook recently launched a programming language called *Hack* (2). Who's talking about it today or using? I have my doubts about these *own* programming languages. Does it worth? Does it gain high popularity? Or will this ending up being used just inside the companies that created them? It's something to reflect...
Yeah, that definitely shouldn't be overlooked. Apple has a bunch of web-facing apps of their own, implemented in a variety of technologies, including some WebObjects/Java stuff, and some SproutCore/JavaScript stuff. Both of those are essentially clones of portions of (and different generations of) Cocoa (fka NeXTSTEP, which is relevant to recall here, because the WebObjects clone is that old, despite the fact that one of the largest stores on the Internet, iTunes, is built on it).
Here's an interesting political history of WebObjects around the time we last heard from it. As strange as it may seem, there's still an active WebObjects development community despite it being essentially self-supported for nearly a decade, now. Many of the developers in that community were, previously, Objective C developers, and the ones that survived the transition to Java are language agnostics. I suspect they might welcome the opportunity to migrate to a Swift/Cocoa web stack.
It will take some while, but Apple has just made the first step to a "language mindshare" play in the web application space.
If you mod me down, I shall become more powerful than you could possibly imagine.
Time was, phrases like, "if their entire platform doesn't want to play nice with mainstream standards" were deployed by Microsoft dweebs against UNIX geeks. Did you not notice that iPhone apps are written in Objective C / Cocoa? Swift could just as easily be called, The New Objective C, or Objective C^3, or Objective Cocoa, and none of what you're griping about has changed at all, since the iTunes App Store was first deployed. You don't own a Mac, so you're already not in the iTunes App Store market. Why, again, do you care about this discussion, at all?
If you mod me down, I shall become more powerful than you could possibly imagine.
turned out the code i was objecting to works in a thing called a sandbox - so a comparison "statement" is legit in the directly interpreted sense - the ibook just assumes i know what a sandbox is, and does, in order to make sense of it's examples.
your point about obj-c is valid, i think - will stick to providing support at this level, let apple and the swift people build their own bridges, if needed.