Apple has open source, but so what? (Down)

At the beginning, because of MacOS X, Apple and FreeBSD had a close relationship in the past. Not only did they recruit Jordan Hubbard, the founder of FreeBSD, but also Darwin was open sourced on this basis. However, Apple didn't give Darwin much attention, and as Apple's first open source project, it wasn't quite a success. (For details, please click: " Apple has open source, but so what? (Part 1) ")

Later, Apple attacked the browser, and WebKit became the hero behind the scenes. During this period, Apple began to get involved in the deep water area of ​​open source, not only to run in with KDE, an open source community upstream of WebKit, but also to face open source cooperation with rival Google. In the face of external pressure and accusations, Apple should have learned a lot from the open source of WebKit. (For details, please click: " Apple has open source, but so what? (middle) ")

Even Apple seems to have to grow and change as open source software penetrates the industry more and more deeply. This growth in open source is evident in Apple's Swift. Some people say that open source changes the world, so will open source change Apple?

 

Next: Did Swift "rule the world" start with open source?

 

In addition to Jordan Hubbard, Chris Lattner is another open source bigwig hired by Apple.

In the industry, Chris Lattner is known as the "compiler god" because he is one of the main initiators and authors of LLVM (Low Level Virtual Machine) and the author of the Clang compiler .

In 2000, Apple's Darwin was open source, and it was initially involved in independent open source. In the same year, Chris Lattner just graduated from the University of Portland with an undergraduate degree and is preparing to go to UIUC (University of Illinois at Urbana-Champaign) to pursue a master's and doctorate in computer science. It was at UIUC that Chris Lattner began to design and build LLVM using an innovative infrastructure for optimizing compilers, which became the subject of his PhD thesis.

Chris Lattner, a young "little fresh meat"

Unlike Jordan Hubbard, Chris Lattner was almost discovered and nurtured by Apple.

In 2005, Chris Lattner was graduating, and LLVM was still an advanced research program. On the other hand, Apple is also struggling with the compiler. Before LLVM, Apple's software products relied on the entire GCC compilation chain (GNU Compiler Collection, the one that RMS, the founder of the free software movement, tinkered with).

At that time, Apple invested a lot of money in GCC and wanted to add a lot of features, but GCC developers were not very willing to optimize and improve GCC code specifically for Apple's requirements; moreover, it became difficult to guarantee the code quality of GCC in the later stage. .

In order to get rid of the shackles of GCC, Apple began to look for "alternatives". And Chris Lattner's LLVM is clearly a good choice. From this, Apple began to become the main funder of the LLVM program. In 2005, right after Chris Lattner graduated, Apple hired him and his team directly.

I started writing LLVM while I was a Ph.D. LLVM was my PhD research project at the time, and I wanted to make it a disruptive product in industry. At the time, I was whimsical, tried various architectural designs, and tried to solve all the shortcomings of the previous compilers - of course, I didn't get it. After I graduated, I wanted to continue working on LLVM. At that time, only Apple allowed me to continue designing and implementing LLVM after I joined the company. I joined Apple without thinking.

—— Chris Lattner

At Apple, Chris Lattner launched the Clang project and surpassed GCC in several metrics. The powerful LLVM is beginning to mature. So far, Chris can be described as a duck to water at Apple, making great achievements in the editor, and later directly took the position of director of Apple's developer tools department, leading the Xcode, Instruments and compiler teams. 

Besides LLVM and Clang, Swift is the third great project created by Chris Lattner. In 2015, Swift was officially announced as open source and quickly became one of the hottest programming languages ​​of the moment.

This time, Apple's open source does not seem to be as strong as before. Chris Lattner pays attention to the power of the community, and Apple also wants to open source to allow more people to use the language. Arrogance and dominance are not helpful.

PS: In January 2017, Chris Lattner left Apple, where he had worked for 12 years, and went to companies such as Tesla, Google, and SiFive. In February 2022, Chris Lattner was revealed to have left the Swift core team last year after being insulted and yelled at by multiple people.

 

01 When Swift was born, it was for open source

Time back to 2010. At WWDC (Apple Worldwide Developers Conference) that year, Apple had just introduced C++ support in Clang.

Chris Lattner and his team worked so hard to get Clang to support C++, and it was a bit exhausting. This makes them start to think about a question: why do they have to implement C++? Shouldn't there be a better language?

You also know how ugly C++ is to write, but it is another thing to be an editor that supports C++ and perfecting the language of C++. Whether it's C, C++, or Objective-C, there are some things I'm not very satisfied with. So, I thought we'd come up with a new language. The new language should be as simple as possible.

—— Chris Lattner

That's it, Chris Lattner kept quiet, and after a few chats with Bertrand Serlet, head of Apple's software team, they settled on the idea of ​​a new language. It was codenamed "Shiny" at the time, and "it was like you were building a shiny new thing," recalls Chris Lattner in 2019 .

Once the idea was established, Chris Lattner got to work right away. From the summer of 2010 until the end of the following year, he used nights and weekends to do it without telling anyone, when Vikram Adve, his mentor at the University of Illinois at Urbana-Champaign, found out. , are amazed at how tight Apple's tone is.

I implemented most of the basic language constructs in secret: a few others started contributing in earnest in late 2011. In July 2013, it became the main focus of Apple's developer tools group.

When we were working on Swift, many iOS developers, including Apple's internal engineers, complained that we had no achievements in Objective-C in the past few years, and they were all saying why you didn't do this or that. Of course we can't tell them we're working hard on Swift, and we'll give them all the syntax features they want.

—— Chris Lattner

In 2011, Chris Lattner built the skeleton of the programming language, but it's clear he's not enough alone. In April of that year, he revealed his secret to the company's management, and the project was immediately taken seriously, several senior engineers joined, and the team continued to expand, even becoming Apple's main focus.

It's hard to say whether Apple 's tight culture of secrecy is good or bad, Apple is really fed up with ideas being stolen (both Microsoft and Google have done it); but from a developer's point of view, it's a bit cruel, you know when Developers were still learning Objetive-C when Swift had become a major project within Apple. How heartbroken they were when Swift was born.

In December 2015, Apple fulfilled its June WWDC commitment to open source the new programming language Swift, and Apple also open sourced two projects: the Swift core library project and the new Swift package manager project. This time, Apple is using Apache 2.0 , and software developers will be able to modify the new programming language to suit their needs.

Before Swift, Apple was not without languages. In 1988, Jobs' NeXT company licensed Objective-C and developed its language library and NEXTSTEP development environment. Since then, Objective-C is Apple's dominant language, and with the explosion of iOS mobile devices in 2007, the main language for iOS application development has gained a rocket-like speed.

Swift emerged as the successor to Objective-C. From 2012 to 2013, Apple tried to optimize and upgrade Objective-C on a large scale, adding features of various modern languages, making it easier to write apps, and attracting more programmers to the App Store ecosystem. .

None of these efforts are as effective as going straight to an open source new language. In hindsight, Chris Lattner said there were three reasons to get your hands on Swift:

First, if we greatly optimize Objective-C and add many Swift features, it will be disastrous for developers, because they have to make major changes to the original app;

Second, many features of Objective-C are difficult to return, such as its security issues;

Third, Objective-C is a language developed based on C, so no matter how you optimize it, it must have its own flaws in the C language.

More importantly, Swift is open source, and Apple's open source is indeed more open this time.

During Chris Lattner's tenure, Apple has completely opened up Swift, not only open source, but also built a set of norms for community open cooperation. The Swift language protocol is also very loose, and the community is very active. These actions have laid a good sustainable foundation for Swift and the ecosystem.

First, it's thanks to Chris Lattner's approach to open source:

One of the default views I hold is that open is better than closed. If you can get more people involved, you'll get better stuff.

One of the things I'm most proud of is that we don't intend to perfect it just internally - we open source and we rely on the community so that a language can be tested and improved by countless developers. I think that's the best thing about Swift.

When Swift was open-sourced, its evolution became an amazing thing. Open source may not be ideal in terms of efficiency, but open source is a big part of what makes Swift really different. I think it's all down to the people in the community who took the time to shape and push Swift.

Second, early community feedback really helped shape Swift 1 and 2.

In the first year or two of Swift 1, a lot of things were driven directly by the community. Even years later, Chris Lattner still attributes Swift's growth to the power of the community: "One of the main reasons Swift is so good right now is that there's a whole bunch of people blogging and giving feedback, and when people have complaints, that's when progress is made."

Again, it is precisely under the impetus of open source that the Swift project and even Apple have learned a lot about open source practices.

Community building means that Swift can benefit from a lot outside the core team. For example, the design of the Codable  protocol came from a framework team at Apple (they weren't even on the Swift team); the Result type entered Swift 5 because of community forces . These clever designs proved to be quite rewarding .

In addition, in order to better interact and cooperate with the community, Apple has adopted a method of mandating a certain number of documents and processes. Over the years, Swift has made efforts to balance the power of the community , such as, is design rights assigned to the community? Or is it assigned to community priority capabilities? These questions are challenging.

The first thing I learned from the evolution of Swift is how to properly catalyze community power. Swift really brings together a community of language geeks, and I'm always looking for some catalyst for the Swift package ecosystem or the Swift-on-the-server community to take off and get the community together to do something cool.

—— Chris Lattner

Driven by open source, Swift has grown unexpectedly.

At first, Chris Lattner only envisioned that the language would have an impact in Apple's inner circle in a few years , while Apple saw it as a faster and more efficient tool for developing software applications for iPhone, iPad and Mac computers.

At the 2015 WWDC conference, Apple senior vice president Craig Federighi said, "We think Swift will become the standard language for programming in the next 20 years. We think it will be one of the main programming languages ​​in the future." At the same time, he also said that if If you want to provide support for more enterprise developers to develop their own mobile applications, the best way is to open source.

After open source, I was stunned by how well Swift developed. We open-sourced LLVM and Clang back then, and they're doing great too. However, compared with Swift, their development is too slow, and LLVM and Clang are not as popular as Swift after they are open sourced.

Swift is different. After a year of open source, we have millions of developers using the language - I and many veteran engineers with extensive open source experience were taken aback. Then we received countless emails and pull requests every day, asking to update this, to optimize that, and our rhythm was completely disrupted.

I now feel that the decision to open source is crucial. One is that people help with the optimizations, and the other is that we have a huge forum where people can talk freely, and people all over the world are helping Swift improve, which is really great. Although we didn't have a specific plan to open source from the beginning, Apple internally felt that Swift would definitely be open source one day.

—— Chris Lattner

There used to be a popular saying - "Swift rules the world" . This is what Chris Lattner joked about, but gradually, both the main creative team and the rest of Apple, began to see Swift as the mainstream language of the future world. In their eyes, it will surpass Python and even replace it one day. C.

In Chris Lattner's plan, open source is an important part; then, Swift must have a killer product; then, Swift must be applied to the server side; and then, Swift must replace Java.

 

02 After many years of open source, Apple also has grievances. Are you over speculating?

Despite Swift's commitment to openness and ambition, it has been difficult to escape the Apple's closed stereotype.

Everyone always thinks that Swift is just something made by Apple itself, Apple's own toy, and can only be used on Apple's own iOS system and macOS system. In this regard, Swift continues to increase its efforts to open source and build communities, hoping that Swift will be better accepted and catch up in the field of system development.

Our goal is to build an inclusive community. But if you're not an Apple developer, it can feel alienating to get caught up in an iOS discussion every time you search for something in Swift.

It makes you feel like an outsider, which is the wrong signal. I don't think anyone intended to let this happen, but the effect is real. This is the challenge we face as a community. Also, I don't know if there are good, simple answers to these questions.

—— Chris Lattner

What is the situation? In the Swift community website wrote this paragraph:

The sole goal of the Swift.org community is to build the world's best general-purpose programming language. We will develop the language together, with contributions from anyone who wishes to participate.

The Swift language is publicly developed, and all technical or administrative topics about the language or community processes should be submitted to the Swift public forum. Open dialogue is encouraged, and active Swift language developers should follow the relevant forum category.

Structurally, the Swift project is managed by a core team of engineers (7 people) that drives strategic direction by collaborating with the community. Technical leaders come from a community of contributors, and anyone can gain the right to lead the Swift field.

However, Apple Inc. is the project leader and serves as the project's arbiter. Ted Kremenek ( the hand-picked successor to Chris Lattner 's departure from the community) is Apple's designated representative and serves as a spokesperson for the project lead.

This means that Apple does not intend to hand Swift completely to outsiders, Apple has always maintained leadership, external developers can participate, guide the development of Swift, contribute to its operation and function, and their work will be public.

https://www.swift.org/community/

Apple is indeed grasping the dominance, but speculation on this will only increase layer by layer. This stereotype and skepticism was well reflected in the turmoil of Chris Lattner's departure.

In 2017 , Chris Lattner left Apple, and his next owner is Tesla. The media speculated on the real reason for Chris Lattner's departure from the "trails" such as Apple's previous patent wars, former employees , and Tesla's openness to patents. More "friends" who called themselves Chris Lattner came out and said that Chris Lattner really joined Tesla because of a patent attitude.

Not long after, on January 13, 2017, Chris Lattner had to stand up and refute the rumor on Twitter:

My decision has nothing to do with (patent) "opening", the so-called "friends" are either fabricated or speculative. The masses just want to embarrass Apple.

On open source, Chris Lattner supports his old club. He said that Apple actually has a tradition of open source. Although LLVM did not start with Apple, it was finally completed and open sourced by Apple. Clang is completely born in Sri Lanka. There are other tools like LLDB, libc+, and compiler-rt as well.

However, the opinion of the media and the outside world is grim. More people believe that open source has never been Apple's original intention, but a change that has to follow the trend.

First, over the past 15 years, developers have shown a preference for open source tools and platforms. It's risky if Apple continues to adapt developers to its own technology and stay away from third-party technology. This will alienate the relationship between Apple and developers, and it will be a matter of time before Apple opens up to the outside world.

Second, in recent years, new programming languages ​​have emerged one after another. Google's Go language, Mozilla's Rust, Meta's Hack and D language, etc., are all open source! Among them might even emerge the next software development standard.

Moreover, in 2014, Microsoft open sourced the .NET framework, which is officially licensed for use in non-Windows environments including iOS and macOS. (Interestingly, it was not until September 2020 that Apple officially announced the introduction of Swift to Windows, and I don’t know why it was so slow.) Faced with such a challenge, Apple has no choice, and Swift must be open source.

Third, over the years, Apple has been committed to improving its closed-loop ecosystem, and the open source of Swift is also inseparable from this. Especially after the continuous deepening of the mobile Internet, if you want to seize the opportunity, you must have strong technical support and excellent user experience.

Today, Apple's own hardware device market share is steadily increasing, and systems such as iOS, macOS, and iPadOS are constantly improving. Many people believe that the launch of open source Swift has a very good promotion effect on enriching the application system and mining talents. Apple has played a big game of chess.

Apple's main software platforms

 

03 Conclusion: Through open source, can Apple achieve self-transcendence?

There is a famous saying: Open source eats the world.

We can see that the world is indeed being changed by open source software, including proprietary software strongholds like Microsoft. In 2015, when Microsoft pulled out T-shirts and badges that read "Microsoft Loves Linux", it was unknown how many people choked on coffee.

Open source has a lot of momentum, and it is inevitable that Apple will be disillusioned in the open source world, for example, its cooperation with GCC. Now, Apple has to move closer to open source. Besides Darwin, WebKit, and Swift, Apple has some other open source projects. However, every time Apple open source, there will be a strange sound.

For example, in 2018, Apple announced to open source an enhanced NoSQL - FoundationDB ( a project developed by an open source company acquired by Apple in 2015 ). Some people said that business giants are always like this. Maintain it for the community, and when the community is well maintained, it will be closed source to sell it for money.

In addition, Apple also actively participates in various open programs, open source foundations, etc. , such as the Open Compute Project (OCP) led by Facebook (then called it), the Blender Foundation, and the Open Media Alliance.

Along the way, Apple kept recruiting. In the past two years, Apple has continuously released recruitments for RISC-V developers and open source project engineers, hoping to absorb power from the open source community.

In 2011, Jobs passed away, and Apple has never been able to get rid of his influence . Under the construction of Jobs, Apple has a strong desire to control software and hardware, and has developed a unique closed source method: while closing the system code, it builds an ecosystem by sharing benefits with third parties.

In the movie "Steve Jobs", Steve Jobs played by French Shark has just returned from revenge. Facing the questioning of his former partner Wozniak, he blamed everything on "openness"

Under the leadership of Tim Cook, Apple's business model has never been separated from the category of hardware and software integrated consumer electronics companies, and it still needs to continuously launch new products that far exceed market expectations to maintain its position.

With open source, can Apple move beyond the closed model it has always been?

{{o.name}}
{{m.name}}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324140808&siteId=291194637