Special Events • 31:28
Speakers: Bertrand Serlet, Richard Wright
Unlisted on Apple Developer site
Downloads from Apple
Transcript
This transcript has potential transcription errors. We are working on an improved version.
Good afternoon. This is such a unique WWDC because we have not one OS about to show, but two OSs that are about to show; Snow Leopard and iPhone for you. Now I know that a lot of you came for the Mac, and a lot of you came for the iPhone, but one thing that's wonderful is that there's such a great intersection between those two platforms. Of course a number of you have applications that's span both, this is fantastic. But I'm sure everyone is also interested to hear about the tools, and we have a session this afternoon that's dedicated to the tools.
Of course it's the same tools for both platforms, but maybe more importantly both those platforms are OS X. OS X is the mother of those two platforms, or the umbrella. So thanks for coming today, there's 5,200 of you. Nowadays I guess I should say there's 5,200 friends, so welcome here.
But one statistic that's kind of very interesting is that 60% of you have never attended a WWDC. So keeping that in mind, all the long timers and the one who have the first WWDC today, we've devised this kick off in an agenda in two parts. First we'll talk about what's new and different, you know, all the things that happened over the last year. And then we talk about things that are constant, things that are beautiful, things that you can count on. So first to talk about what's new and exciting, I'd like to ask my long time colleague Bud Tribble, VP, Software Technology to come on stage.
[ Applause ]
Thanks Bertrand and as he says, welcome everyone to WWDC '09. And Bertrand's going to talk about a bit later about some of the really enduring software principles that we've employed at Apple over the past 10 years and even longer. But before he does that, I want to talk a bit about what's changed since last year, and I'll talk about the iPhone landscape for a bit, the Mac landscape, and then I want to spotlight actually three technologies each in the iPhone and the Mac that are new over the last year; and they were mentioned this morning, but I really want to sort of zoom in on them and emphasize them a bit because I think they're very important, if nothing else just to encourage you to attend sessions and explore them and find out about them later in the conference.
So first of all, the landscape has obviously changed with the iPhone, and we spoke about it this morning - incredible, 1 billion downloads and it's hard to envision what that really means, but I did a few calculations. That's actually downloads at a rate that exceeds the NTSC frame rate, 30 times a second. Another way of thinking about that is how often apps are created and uploaded to the store? And from the numbers this morning, about every 10 minutes, 24x7, somebody creates an app and uploads it to the store.
So this is incredible, we've never seen anything like this. And of course, reflected in this is the opportunity for all of you who are developing iPhone apps, and exercising your creativity and your innovation, and surprising us about every 10 minutes. Now associated with that huge opportunity, what we're seeing and Bertrand mentioned there's 60% of you new `to WWDC the first time.
This is a diverse community, and by diversity I mean people developing apps coming at it from all sorts of angles, and in addition to traditional developers, very outside the box, nontraditional developers. So of course we've got the large traditional developers here, and you know who those are, but we also got the small garage developers, sort of the truisms of the world for those of you who saw that story and followed that story.
We've got a ton of nontraditional consumer companies, companies that don't think of themselves as being in the software business; like Wells Fargo, Coca-Cola has an app, ESPN has an app, Target has an app where you can go and choose gifts. So companies that are in the package goods or consumer goods, Johnson & Johnson who we saw this morning, an app for diabetics. So a ton of you are from these other industries that are sort of new to developing in general.
And then there's IT groups developing apps for their own employees, and the IT groups are new to the iPhone and they're sort of there developing apps whether they like it or not, because their employees want apps. And then finally, game developers coming to the iPhone in droves. So an incredibly diverse community, you can sort of look around you and I hope you take the time to meet other people and get some other perspectives as you're here at the conference.
Switching over to the Mac environment; now I think no one can argue at this point that the Mac is not mainstream. It's a mainstream platform, arguably the best operating system out there today. If you did the math this morning, in terms of active Mac users, you saw that there was in excess of 30 million active Mac users out there. So again, this is incredible opportunity.
I like to point this out, this is great. If you ever take the time to wander around a college campus, or K-12 school... you're just blown away by the number of Macs and that's a huge leading indicator out there. There are many campuses that have in excess of 50% of the studPents with Macs, and that's students who, they're deciding what they want to buy and what they want to run and they choose Mac. And as they move out in the workforce, I think this is a huge leading indicator. One reason for this, and this was covered this morning, is that the Mac is a great client that fits in anywhere - at home or at work.
And by anywhere I mean into a Microsoft environment, whether it's running MS Office apps, Microsoft file and print, Active Directory in Windows apps, and now new with Snow Leopard, starting in Snow Leopard as was mentioned this morning - integration with Microsoft Exchange. And that sort of completes the picture to make Mac the universal client, and it's one huge reason for its surge in popularity. Now to sort of shift gears to some technologies I want to spotlight, there's three technologies on the Mac and three on the iPhone.
They were mentioned this morning by... as I told you, I want to emphasize the importance of them. Starting out with the iPhone... and there's three words I would use to describe these sorts of technology - radio, radio, radio. These are technologies that leverage the radios in the iPhone, and as you know the iPhone is crammed full of radios. You have location GPS radio, and now going to the magnetic compass, you have peer-to-peer over Bluetooth, you have push notification over the cell phone radio link.
We saw the ZipCar this morning An app I ran into recently that leverages location is GeoTwitter, which is great, you can attach a map to your Twits... to your Twitters. With the compass in there you have an extra piece of functionality with the iPhone 3G S in addition to orienting yourself in a map orient, the direction of the phone.
Peer to Peer leverages the Bluetooth radio, and as we saw, finding other people who want to play a game in the local area... trading information on an ad hock basis. Collaboration applications, I think we haven't even scratched the surface of what's possible here, and of course this is possible because you have such a high concentration now in the world of iPhones, that you're actually likely to run into someone else with an iPhone.
Then finally Push Notification, and as was mentioned this morning, this is going to open up a whole new area of apps, not just instant messaging type apps, but apps that have to notify a doctor or cardiologist for example that something is going wrong with a patient in the ICU. By the way I noticed that this patient has a pacemaker that's malfunctioning, I don't think that was mentioned this morning, if you look closely there.
[ Laughter ]
One of the important things about Push Notification on the iPhone is that it's a system level service.
What that means is that it can operate at the system level, and receive notifications and notify the user without draining the battery the way that running an app continuously in the background. You can imagine 20 apps trying to run continuously in the background and pull from notifications. This system service collects them centrally and then only... runs the app when the user requests that; a huge savings on battery life.
To look at the Mac now, these three technologies which were mentioned this morning, have one huge thing in common. And that is that they're keeping up with what the Silicon guys are doing to us. Intel and others keep putting more transistors into our computers, and the challenge is for us and for you guys to leverage those transistors with software.
And each of these is a case where we have technology new to Snow Leopard that maximally leverages those transistors. I call it the full employment act for transistors. 64-bits... we mentioned this morning about the increased address space, but it's not just about increased address space. With 64-bits you've got twice the number of registers on the Intel architecture.
That means increased performance, in some case greatly increased performance. It also means... it means that you can do a better job at securing the processor running applications. It's a hard to exploit ABI, if arguments are passed in registers, that they can't be exploited on the stack; no execute heap. We took the opportunity in Snow Leopard to make no execute heap the default, so all the apps running in 64-bits have No Execute heap. Stronger heap checks, we have stronger heap integrity checks.
So it's not just an address space story, it's a performance story and it's a security story. Grand Central Dispatch; a ton of sessions later this week on Grand Central Dispatch, but this is all about the fact that the microprocessor designers are throwing more cores at us. 2-way, 4-way, 8-way, coming 16-way and more; many cores what Intel likes to call it. But the challenge is how do we take advantage of that in software? And Grand Central Dispatch is a system level service, it's a language extension to C and objective C, so they can packetize pieces of works.
Now it doesn't parallelize your app for you. If the app doesn't have any parallelism in it, it can't magically create that. But for that parallelism that you do have, it lets you very easily use design patterns to take full advantage of the cores on the processor. And this is... it's throughout the system, if you run top for example, you'll see the number of work queues in each process.
If you run Xcode and run Instruments, there's now a new instrument called Dispatch, and there's more on this later this afternoon and more sessions later in the week. Please go find out about Grand Central Dispatch, and use it in your applications. Last but not least, most of the transistors doing processing in your computer are not in the CPU.
They're actually in the GPU. And the challenge is can we use those for anything besides graphics? And the answer is yes, and the key to that is OpenCL which at runtime would do compile of your OpenCL code, and it can throw that code either on the CPU or on the GPU. Here you see one line change, change your context from type GPU to type CPU.
You can debug your code on the CPU, change that flag, and run it on the GPU with the afterburners on. And there's no better way to illustrate these last few points than to demo it, and I want to ask Richard S. Wright, senior software engineer from Software Bisque to come on up and give us a demo of those last 2 points, taking maximum advantage using Grand Central Dispatch and OpenCL.
Thank you.
[ Applause ]
So this is the planet Mars, and you're looking at the next version of Seeker running on Snow Leopard. At Software Bisque our products range from research grade telescope control... to educational products like Seeker. Seeker's an interactive solar system simulator that allows us to visit things like planets, moons, and even man-made satellites. And it's available in both desktop and full dome planetarium editions.
Here we are at Earth, let's turn on a constellation of satellites. There are different kinds of satellites. There's geosynchronous, communication satellites, weather satellites, etc., and each of these satellites requires hundreds of full double precision computations per frame to calculate its position in orbit. Another type of satellite is Space Junk.
Shown here in red, these can be anything from spent rocket boosters to little flecks of paint, but traveling at tens of thousands of miles per hour. And if you're traveling in space, you don't want to run into one of these guys. Now you can see that over 12,000 objects, we're having a bit of a performance challenge here. Our frame rate is down to 5, and you can see one of our CPU cores completely maxed out.
The solution to this was Snow Leopard's Grand Central Dispatch Let's turn it on and see what happens. With Grand Central Dispatch we're able to automatically distribute the workload of all these satellites across all the CPU cores, and our frame rate goes from 5 to 30 frames per second; pretty dramatic.
[ Applause ]
Now multithreading with pthreads, to be kind, it's a little tedious. Grand Central Dispatch was quick and easy. It took maybe 15 minutes and about a dozen lines of code to make the jump to Grand Central Dispatch for these computations; and the result speaks for itself.
Let's head to Saturn now. As you can see, Seeker is all about real time interactivity, or in this case greater than real time interactivity. Here we'll speed up time so we can see the moons of Saturn going around the planet. It's pretty cool. Well in addition to satellites, our customers also wanted to be able to represent the asteroid field. Now asteroid orbits are computationally a bit simpler than satellite motion. But this time the problem was one more of scale.
Let's turn toward the sun and turn on the ecliptic, and I'll show you what I mean. At the beginning of the 20th century, we knew of less than 500 asteroids. OK, no sweat. Over the next 100 years though, that catalogue had grown to 40,000 asteroids and in the last 10 years we're now up to over 400,000 asteroids. What you're seeing here is every single object catalogued by the Minor Planet Center as of this week.
[ Applause ]
For this number of computations, Snow Leopard's OpenCL is the solution and we offloaded these calculations to the GPU. We couldn't have even attempted this many asteroids using a CPU technology, even on a multicore system, and you can see we're hardly even touching the CPU. So here we are back at Earth, the satellites and asteroids on at the same time. Snow Leopard uniquely allows us to make use of every computational resource in our system simultaneously; thus enabling the next version of Seeker in an astronomical way.
Thank you.
[ Applause ]
Thank you Richard, great illustration of Grand Central Dispatch in OpenCL. So to wrap up what's changed, we've looked at the iPhone landscape, the Mac landscape, highlighted some key technologies that will be important going forward, and I'd like to invite Bertrand back up to talk about the underlying DNA, the constant things, the big constants that have stood us in good stead over the last decade and longer. So Bertrand I'll turn it back to you.
[ Applause ]
So let's talk about what's the same, and this is sameness both in terms of time and also sameness of course between the Mac and the iPhone. And I've chosen three topics that are really dear to my heart: structure, APIs, and UI. So first structure.
Now this is a picture that you may have seen before, if you attended a previous WWDC. It's actually the same picture that we've shown since 2001. It's the structural composition of the system. At the bottom you have UNIX and it's actually a little more than UNIX, it's everything that's known UI. That's where the power of Mac OS X comes from, and in fact we'll have a session just after this one to cover a kind of this layer. Next layer up, graphics.
That's what makes Mac OS X and your applications really sexy. That's all the multimedia technologies, both on the Mac and on the iPhone. And we'll have a session this afternoon as well on graphics. Then we have frameworks of all kinds, and actually there's no session this afternoon because there's sessions the entire week on frameworks, on the various frameworks that make both our platforms.
And on top of that of course you have applications, both our applications, system applications, both under Mac and the iPhone, and your application because we are using of course all the same APIs. So you may wonder OK, so why is structure kind of something that matters? And it tremendously matters to me, because Mac OS X is pretty hefty. This is the size of the my question when you look at the sources, over half a million source files, and 36 gigabytes or so of sources.
Just to put that into perspective, there's digital code - that's well known - the DNA, the human DNA has about 3 billion base-pairs - you know, ATCG, 2-bits per pair, so that's about a gigabyte. Now I'm not claiming that we have achieved any close to the degree of sophistications that you get with DNA, we still have a few years to progress.
[ Laughter ]
And when you have that kind of size of information, if you're not careful, if you don't lay your things properly, you end up with this.
So that's why we work very hard at making sure the layering of what we do is kind of pristine, and in each release we kind of improve on the layering whenever we detect that there's something to improve on. And so there's a number of patterns that we apply to our layering. One pattern is something I call split.
When you have something that's fairly deep you split it in 2. Perfect example of that is front end and back end, and we've done that multiple times, take for example Safari as an example. We have Safari application, both under Mac and the iPhone, but we have where most of the code is, the back end of Safari - WebKit, WebCore.
And this is a very important pattern, and I think it should be very important for you too because I know some of you have fairly large applications, but also because you may want to span both the Mac and the iPhone, and you can share the back end. Another pattern that we apply is what I call abstracting, factorizing.
This is when we notice that there's a same kind of functionality in 2 applications, or several applications, and we try to make it available for all applications. We try to encapsulate that functionality in the library. There are many examples of that, for example for persistency calldata is a way to extract persistency for applications. You could even say that Grand Central Dispatch, what we've done by putting those libraries or Dispatch Library as we call it as the lowest level, is an abstraction of multithreading.
Then the third pattern I want to cover is when you have something that doesn't smell too good, something say from the past, but something you important for your customer base. So you want to keep that functionality, but what you don't want to do is with that functionality, affect your future plans.
And so what's really important there is to fence it off. And make sure it works. So those are some of the patterns that we've used to kind of keep our layering totally proper, obviously yes, and they have enabled us for example, to move onto the iPhone when we did that jump a few years ago, very, very easily because our layering is proper. So that's the structure, let's talk about APIs. And if you want, APIs are kind of the layer, sorry, it's the planes between the layers.
They are the ways to communicate between different layers. Now maybe a more kind of formal definition can be found in the dictionary, but we also use several synonyms. Sometimes we say header file for API, or the documented API, or public API. The things that's important here is that if you want to use some functionality, and it's not in your header file or it's not documented, or it's labeled as private API. Well don't choose it, right? Because your application may break, even during a software event which wouldn't be too good. So one characteristic of API is that they have to really fit well together, and one standard technique for that is object orientation.
This has been known for a number of decades. And we've chosen, a long time ago, in fact I think that Bud made the decision to use an object oriented language that we call Objective C. Now don't be scared OK, if you are new to the Objective C world. This is mostly C, this is a superset of seeds that adds objects and classes and methods; but most of the syntactical construct of C, at the heart of Objective C is a runtime that makes it very dynamic and brings things like introspection.
And this language has enabled us to create high level frameworks that are object oriented, things like Cocoa and Cocoa Touch. We gained a lot of benefit from object orientation, and you gain a lot of benefit. For example, there's a lot of behaviors that are very automatic. You just call a method and all the minutiae here, what has to happen happens for you. It's easy to use in an object oriented environment, because you instant shared a class.
It's easy to customize, you just subclass. And in general it's easy to capture the intent that you have when you program, and I think that notion of capturing the intent is very important for programming. Now also, and this is maybe a more kind of subjective and personal view, I think object orientation is very elegant. It's kind of like this bridge, le Viaduc de Millau... that's functional, is elegant, and also was finished under budget; which is very rare for public works.
And you may notice that if you're new to object orientations, that sometimes you have to write less code in order to get your application. Now another aspect of APIs is their longevity. If you think of it - Open, Read, Write... those APIs were designed some 40 years ago. The Cocoa APIs, the foundation APIs, were designed something like 20 years ago.
Even in graphics land, OpenGL, 15 years ago. So APIs last a very long time, and so we are very careful when we put a new API out there, and so we have a process internally to make sure our APIs are the greatest possible quality. First an API starts as a private API, just for us, not for you.
And we iterate on it until we are happy with it. In fact, we iterate until it's kind of perfect, in the sense that we don't know what to change in order to improve on it. That's an internal review process. At some point we put that in a seed, and that's where you are involved, and that's where we are waiting to hear from you on whether the API does the job, is it complete? And it's really important that we get that feedback on API always, because we're are going to then shape our product and then we commit.
As much as possible we commit forever. We try really hard to make sure your applications keep working generation after generation. So this is the same process that we use for the Mac, and for the iPhone. In fact there's a lot of shared APIs, and there's more and more shared APIs as time progresses like Call Data - it's making its appearance on the iPhone for you. It's been a long time API on the Mac, and vice versa.
Call location is now in Snow Leopard. So we have a lot of care that goes into our API design. Let me talk about UI. You know I mentioned elegance, talking about APIs, but usually elegance is associated of course to UI. And for UI to be elegant, the first criteria is that it has to be really functional. It has to do its job right, and it has to be easy to use.
Any child can use these widgets that we have on the iPhone that these nicknames are Wheels of Time. Now similarly on the Mac, I think it's very obvious when you know a little bit about cosmology which way is the present days and which way is the past days. You don't need to explain that, you don't need to label this is backwards, this is forward.
The model is implicit in the UI. And so I really exalt you to spend a lot of time in your applications on great UI, it has to be super functional, it has to be super easy to use, and you don't want to forget there's a wow factor; because that's how you get an edge over the competition.
So structure, APIs, UI. These are things that haven't changed over the last few years. They are the constants of big constants. Now Bud talked about things that changed like how is the iPhone changed in landscape? A few years ago, three, four years ago it didn't exist. How is it Mac is in mainstream? Five years ago this was unthinkable. And the incredible new technologies that we have to follow the present and the future.
Now we have, I believe two great platforms for you, and what's really great is that they share a lot in common. That's OS X. So that's kind of the technology aspect of it, but then there's a business side of it where between the iPhone, the iPod touch, and the Macs we now have over 70 million devicpes and computers you can target for your applications. So we've a great technology, a great market... the ball is now in your court. Thank you.
[ Applause ]