Microsoft Open-Sources Reactive Extensions Programming Model

By Darryl K. Taft |
Posted 2012-11-07

Microsoft has open-sourced an asynchronous programming model known as Reactive Extensions or Rx.

According to a post on the company’s Interoperability@Microsoft, Microsoft Open Technologies (MS Open Tech) is open-sourcing Rx, a programming model that enables developers to glue together asynchronous data streams.

Microsoft said the model is particularly useful in cloud programming because it creates a common interface for writing applications stemming from diverse data sources, such as stock quotes, tweets, computer events and Web service requests, according to the post written jointly by Microsoft software architect Erik Meijer and Claudio Caldato, principal program manager for Microsoft Open Tech.

Meijer, a proven researcher and software wizard with several Microsoft inventions under his belt, developed Rx and continues his leadership role in the evolution of the technology. The Rx development team will be on assignment with the MS Open Tech Hub, an engineering program to accelerate the open development of the project and collaborate with open-source communities.

The Rx source code will be hosted on Microsoft’s CodePlex open-source project hosting site to increase the community of developers seeking a more consistent interface to program against that works across several development languages and is also open to community contribution. The goal of open-sourcing Rx is to expand the number of frameworks and applications that use Rx in order to achieve better interoperability across devices and the cloud.

“There are applications that you probably touch every day that are using Rx under the hood,” Caldato said in the post. “A great example is GitHub for Windows.”

"GitHub for Windows uses the Reactive Extensions for almost everything it does, including network requests, UI events, managing child processes (git.exe),” said Paul Betts a .NET developer at GitHub is quoted as saying in the Microsoft post. “Using Rx and ReactiveUI, we've written a fast, nearly 100 percent asynchronous, responsive application, while still having 100 percent deterministic, reliable unit tests. The desktop developers at GitHub loved Rx so much, that the Mac team created their own version of Rx and ReactiveUI, called ReactiveCocoa, and are now using it on the Mac to obtain similar benefits."

Scott Weinstein, a principal and practice head at Lab49, said in the post: “Rx has proved to be a key technology in many of our projects. Providing a universal data access interface makes it possible to use the same LINQ compositional transforms over all data, whether it’s UI-based mouse movements, historical trade data, or streaming market data sent over a Web socket. And time-based LINQ operators, with an abstracted notion of time make it quite easy to code and unit-test complex logic.”

And Netflix Senior Software Developer Jafar Husain added: "Rx dramatically simplified our startup flow and introduced new opportunities for performance improvements. We were so impressed by its versatility and quality; we used it as the basis for our new data access platform. Today, we're using both the JavaScript and .NET versions of Rx in our clients, and the technology is required learning for new members of the team."

The Rx offering on CodePlex includes a series of libraries, such as:

Rx.NET: The Reactive Extensions (Rx) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators.

RxJS: The Reactive Extensions for JavaScript (RxJS) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators in JavaScript which can target both the browser and Node.js.

Rx++: The Reactive Extensions for Native (RxC) is a library for composing asynchronous and event-based programs using observable sequences and LINQ-style query operators in both C and C++.