Early this year, Linden Lab released the source for the Second Life
viewer. Programmers can download the source, make changes, and even add features and improvements by submitting changes that we incorporate in the main viewer. By the time we release our next viewer, we’ll have enjoyed hundreds of submissions from over fifty contributors, and we couldn’t be more thankful. (Thank you!)
In addition to C++ code, the Second Life servers make extensive use of web services written in Python for a variety of back-end services, like the capabilities framework described in this previous post. These web services have proved to be easier to scale, develop and maintain than many of our older technologies, and as a result, they are playing an increasingly important role in the Second Life platform as we migrate our legacy code to web services. You can read more about how they fit into the larger picture of grid stability by reading Ian’s post earlier today on the subject.
Eventlet: The first of the components we’re releasing today is a networking library that achieves high scalability through non-blocking I/O. Non-blocking I/O implementations often have convoluted control structures consisting of countless chained callbacks, but Eventlet keeps the source code sequential, using coroutines, to increase programmer productivity. Bob Ippolito and Donovan Preston co-authored Eventlet, and Donovan has continued developing it at Linden Lab. You can download Eventlet’s source, and check out the documentation and examples on its wiki page.
Mulib: The second component released today, Mulib is a framework for constructing RESTful applications, built on top of Eventlet. While Eventlet takes care of the HTTP protocol-level details, Mulib takes care of locating the object that will handle the request, and negotiating the data format in which the response will be sent. Look to Mulib’s wiki page for some example code, and download its source from the repository.
In order to encourage the widest adoption, we’ve chosen to license these two libraries under a MIT license, which is compatible with the GPL. Our plan is to use the public version as the “source of truth” — in other words, we will do all of our Eventlet and Mulib development in the public source repository, and periodically pull code from the public repository for internal use.
We believe that Eventlet and Mulib are useful to anyone developing RESTful web services. They certainly are central to the continuing success of Second Life. We’re looking forward to collaborating on changes that improve this code, for Second Life and for a wider variety of developers’ projects. As always, we aim to give as good as we get!