Paul Krill
Editor at Large

Microsoft’s P language is aimed at where cloud, AI, and IoT meet

news
May 23, 20172 mins

The Rust-like open source language tackles application development where asynchrony leads to “heisenbugs” and other event complexities

balance
Credit: Johnn

Microsoft is positioning its P language as a solution for asynchrony in a world where this capability is becoming increasingly vital for the cloud, artificial intelligence, and embedded systems.

Geared to asynchronous event-driven programming, the open source P unifies modeling and programming into a single activity. “Today’s software uses cloud resources, is often embedded in devices in the physical world and employs artificial intelligence techniques,” said Shaz Qadeer, a principal researcher at Microsoft. Such applications feature asynchrony, leading to issues with race conditions and “heisenbugs” (named after the Heisenberg Uncertainty Principle), which are timing-related bugs that often disappear during an investigation of it. P was was built to address the challenges.

In P, the protocol and specification are written at a high level. P features a programming model based on concurrently executing state machines communicating via events; each event is accompanied by a typed payload value. It also provides safe memory management and data-free concurrent execution, similar to what the Rust language offers.

The P compiler provides automated testing for concurrency-related race conditions and executable code for running the protocol, Qadeer said. P supports modeling of concurrency, specifying safety and live-ness properties, and checking that the program satisfies its specification using systematic search, he said. Also, P programs can be compiled into executable C code, bridging the gap between high- and low-level implementation and help programmers accept its formal model and specification, he said.

The language lets engineers model asynchronous interfaces among components in a large Azure service. It also can be used to debug problems on PCs that might otherwise take months or years to manifest after the service is deployed.

P was first used internally by Microsoft for USB 3.0 drivers in Windows 8.1 and Windows Phone, and is now extensively used for driver development in Windows, Qadeer said.

Paul Krill

Paul Krill is editor at large at InfoWorld. Paul has been covering computer technology as a news and feature reporter for more than 35 years, including 30 years at InfoWorld. He has specialized in coverage of software development tools and technologies since the 1990s, and he continues to lead InfoWorld’s news coverage of software development platforms including Java and .NET and programming languages including JavaScript, TypeScript, PHP, Python, Ruby, Rust, and Go. Long trusted as a reporter who prioritizes accuracy, integrity, and the best interests of readers, Paul is sought out by technology companies and industry organizations who want to reach InfoWorld’s audience of software developers and other information technology professionals. Paul has won a “Best Technology News Coverage” award from IDG.

More from this author