
P: A programming language for asynchrony, fault-tolerance and uncertainty - JulienRbrt
https://www.microsoft.com/en-us/research/blog/p-programming-language-asynchrony/
======
panic
It's worth noting that this isn't just a research language -- it's used in
practice for writing drivers:

 _P got its start in Microsoft software development when it was used to ship
the USB 3.0 drivers in Windows 8.1 and Windows Phone. These drivers handle one
of the most important peripherals in the Windows ecosystem and run on hundreds
of millions of devices today. P enabled the detection and debugging of
hundreds of race conditions and Heisenbugs early on in the design of the
drivers, and is now extensively used for driver development in Windows._

~~~
amelius
Honest question: what is so complicated about writing device drivers, whose
sole purpose typically is to transport data from input to output, and vice
versa?

Also, shouldn't drivers be sandboxed to prevent stability problems from
affecting the rest of the system?

~~~
coldtea
> _what is so complicated about writing device drivers, whose sole purpose
> typically is to transport data from input to output, and vice versa?_

What you ask if valid, and very true, but for cable construction, not driver
writing.

There are tons of protocols and issues to handle when designing a device
driver. Negotiate device capabilities. Handle hot plugging and unplugging.
Handle intermittent state changes in the device. Handle buffering. Handle
different versions of the protocol (or multiple protocols from the same bus).
Handle throttling. Initialize and configure the device correctly (and infinite
variations of devices from different vendors with perhaps slight or big
inconsistencies in their implementation).

And of course device drivers are not just about I/O.

~~~
JoeAltmaier
Add discovery, error handling, system resource allocation(dma, memory,
interrupts, pins, clocks and timers).

------
staticassertion
P is a really cool language, and I've been keeping an eye on it.
Unfortunately, the documentation has been pretty perpetually out of date, and
the language is still a moving target. So you can't just "get started" in P,
the example code won't compile.

I don't know what their plans are or if they ever intend for it to be consumed
outside of MS. If they do, some focus on docs would be nice.

Pony is a similar language - but better documented. If you're interested in P,
I suggest checking out Pony.

~~~
rurban
Pony generates also much tighter, better, faster code. Code which I would use
in a driver. Not managed C#. I know no other language which generates faster
code. I mean faster than C++ with OpenMP, while being memory and concurrency
safe.

P has fantastic proof and test generating libraries and IDE's though. In pony
you'll have to write perfect code to pass the type checker. P does much better
handholding to get there.

------
sverige
At last, the long awaited successor to C, at least in the naming convention
that assumes P comes after C because of BCPL. (Apologies to Walter Bright: No
inference should be drawn that D was not also a good name for that sequence.)

~~~
mattnewton
L must be lisp, brought here from the future by the space aliens.

~~~
Razengan
Or Logo.

------
robertkrahn01
Here is a demo for using P to program a drone, shows a little more of the
language itself:
[https://www.youtube.com/watch?v=R8ztpfMPs5c](https://www.youtube.com/watch?v=R8ztpfMPs5c)

~~~
eggy
The graph visualization towards the end of the video in MS VS is amazing. I
can see this being really useful for my robotics projects. I'll have to figure
out how to get started. I was learning Erlang, and looked briefly at Pony, but
the syntax and the demo appeals to me.

------
tobyhinloopen
Can we stop naming programming languages with letters and symbols and give it
proper names that, when googled (or binged), makes the programming language
appear on top?

~~~
LeoNatan25
Searching for "<Letter> Programming Language" works wonders. Give it a try
sometime.

------
rubyn00bie
If anyone is interested in syntax and more tangible bits, here is the manual
from the GitHub page linked to in the article:

[https://github.com/p-org/P/blob/master/Doc/Manual/pmanual.pd...](https://github.com/p-org/P/blob/master/Doc/Manual/pmanual.pdf)

~~~
tyingq
That would have been really helpful for things like telnet and option
negotiation. Or more recently, perhaps something like QUIC.

------
rambodroneprog
P is also being used to build safe robotics systems. [https://drona-
org.github.io/Drona/](https://drona-org.github.io/Drona/)

------
cgb223
I'm still holding out for NP

It'll be wayyy more complex

~~~
moomin
(Citation needed)

------
tekacs
Previous discussion:
[https://news.ycombinator.com/item?id=12673739](https://news.ycombinator.com/item?id=12673739)

------
rambodroneprog
The high-level syntax of the language looks amazing for writing and specifying
complex protocols.

------
mempko
Love it. What if all computing are communicating state machines

------
faragon
Microsoft's "Node.js" equivalent for asynchronous stuff?

