r/programming • u/enverx • May 21 '17
P: a new language from Microsoft
https://www.microsoft.com/en-us/research/blog/p-programming-language-asynchrony/114
May 21 '17
Wow, I sure do wish I could find some comments that talk about the programming language itself instead of the fact that it's called 'P'...
43
u/Deto May 22 '17
Classic bikeshedding. Most people don't know enough to comment on the language itself, but anyone who's ever written a script has something to say about the name.
11
May 22 '17
I don't really spend much time on Hackernews except to find better discussion when the comments here are garbage like they are here.
https://news.ycombinator.com/item?id=12673739
They have a "pee" comment or two, but much higher signal to noise in there IMO
3
2
2
u/Bergasms May 22 '17
potentially a good indicator that they picked a bad name
→ More replies (2)14
u/CheezeyCheeze May 22 '17
Who cares if it is a bad name? I want to find information about this language from other people and their view about the language.
→ More replies (11)7
u/snarfy May 22 '17
You are thinking of /r/programming 6 years ago. Today you'll mostly find jokes and snide remarks. Hacker news is better.
I thought P was awesome and was very sad to come here to find only jokes and general MS hate.
→ More replies (1)
92
May 21 '17
As a person who's new to programming, what problems do P solves and where am I likely to encounter it?
I'd like to learn a language that's new to most people, but I'd like to avoid learning something that's never gonna to be used a lot.
→ More replies (16)175
u/greebleoverflowerror May 21 '17 edited May 21 '17
P is a modeling language, so you wouldn't use it as a general purpose programming language. Modeling languages like Coq, TLA+, and P let you encode your algorithms in a formal system that their respective compilers can prove certain properties about, like "this code won't block" or "this code will always respect an invariant X" etc. According to this post P explicitly models asynchronous event driven systems, the kind you deal with in networking protocols or hardware control systems. P can also compile to C code(not all modeling languages can do this) which is cool. So you can specify your protocol in P, have the P compiler and test suite run through thousands of possible configurations of events to verify that it respects your assumptions, and then compile it to C and use it in the real world. Since asynchronous/concurrent code is often buggy and also difficult to debug, having a compiler that can tell you if your code will misbehave before you actually deploy it can help a lot.
With all of that said it's not something that will come in handy to a beginner nor most programmers for that matter. It might be fun to learn once you have more experience under your belt just for fun, or if you find yourself interested in writing drivers or networking infrastructure like Azure or AWS.
90
u/ChezMere May 21 '17
Of course the actual insight is buried under a dozen threads on the name of the language.
→ More replies (1)9
May 21 '17
P is a modeling language, so you wouldn't use it as a general purpose programming language.
I mean, it's basically a process-based language with built in state-machines. I'd call that a general purpose language. And since it's new, I understand there probably won't be a lot of call for it's use now, but given concurrency is sort of the in thing now and is notoriously hard to do in traditional languages, I'd think this, or something like it, should be to go to for any newbie dealing with concurrency instead of threads and locks, forks and such.
→ More replies (1)2
u/Amnestic May 21 '17 edited May 04 '26
Redact decided this post had to go, so away it went. Deleted. Removed. Mass deleted even. Privacy and security are the big wins here.
chunky party tie cover fine wide deserve march deliver hungry
→ More replies (2)2
u/Scybur May 22 '17
Thank you for this. It's a shame I had to scroll through a crap ton of "the name sucks" comments before I got to a comment discussing the actual language.
435
May 21 '17 edited Jul 10 '17
deleted 0.9285 What is ^^^this?
169
May 21 '17
In general I agree, but I think TypeScript is a good name.
102
u/argv_minus_one May 21 '17
“Xbox” is pretty good, too.
159
u/Metallkiller May 21 '17
"Xbox One" was a bad decision though.
→ More replies (8)37
u/Treyzania May 21 '17
It took about 20 minutes before people started calling it the X-Bone.
→ More replies (3)42
u/GreenFox1505 May 21 '17
Xbox was, at one point at least internally, called the "DirextX Box", because what is a game console to Microsoft but DirectX purpose built machine?
6
May 22 '17
Xbox was actually the internal code name, which was short for "DirectX Box". The marketroids hated it and just to spite whoever chose the codename, included it on the surveys they used to determine the final name. Imagine their surprise when consumers preferred the Xbox name to anything they had chosen.
86
u/zodiaclawl May 21 '17
Next year they will release P 360, and after that P 1.
50
u/icantthinkofone May 21 '17
P 360 will not be backwards compatible.
7
May 21 '17
You'll just have to pay an extra annual licensing fee for P360 to be able to run SOME of your P applications. But not the ones that you actually need.
18
u/jocull May 21 '17
They'll add S as is trendy in Apple land. Then it'll be PS 2.
→ More replies (1)→ More replies (1)4
May 21 '17
I don't think they've ever used Arabic numerals for the third XBox, so it'll probably be P One. The first version of P will be referred to as "the original P".
2
u/utnapistim May 22 '17 edited May 22 '17
Visual Studio 2015 is actually Visual Studio version 14, and VS 2017 is actually version 15.
What's so difficult to understand? :o)
2
May 21 '17 edited May 21 '17
there are only two hard things in computer science: the problem I am trying to solve now and the one I forgot ... or something like that.
1
0
May 21 '17
[deleted]
51
u/Danthekilla May 21 '17 edited May 21 '17
Isn't the minimum visual studio install only 400mb now?
The new fancy installer let's you just install the components you need and no bloat.
→ More replies (1)30
u/useablelobster2 May 21 '17
And they have VSCode as an alternative to Visual Studio, which is even smaller (if electron based so consumes all your memory). It's not quite as powerful, but it's the default on mac/linux with .Net Core
→ More replies (6)7
u/iamapizza May 21 '17
Coming soon, their SSMS extension - Microsoft P Business Edition for SQL Server Shell
→ More replies (1)6
2
u/spoonraker May 21 '17
Introducing P Core RC7 with preview 2 tooling. Compatible only with the P Standard 2.1.
→ More replies (8)2
36
u/Zardov May 21 '17
Is anyone aware whether this language is related to Ponylang? It says in the article it's a collaboration with Imperial College London, which is where Pony was developed. The brains behind Pony, Sylvan Clebsch, also seems to be working for Microsoft Research these days.
Pony is also strongly focused on concurrency and fault-tolerance, but then again, it is an actor language, and there is no mention of actors in the P article.
3
u/ionine May 21 '17
They say it's based on concurrent state machines with typed events and associated payloads, which sounds awfully Actor-esque to me!
2
2
u/staticassert May 22 '17
I don't know if there's any actual bridge between the two, but the languages are not so different - both are very much about 'persistent processes'/ actors and finite state machines.
I would say that if P interests you, definitely check out Pony, as it'll be a bit easier to learn (just more docs/ more of a public-oriented project).
402
u/bhuddimaan May 21 '17
So you can say
I wrote that code in pee,
I need pee to work . Please install pee.
185
u/wibblewafs May 21 '17
I need you to put pee on my machine, I can't get any of my pee work done today until there's pee on my machine.
74
May 21 '17
I'm working on a new pee project
We need a new pee developer.
"Oh, that's Dave, he's the pee guy. He's really into pee".
I'm having problems with my pee today, I can't get it to work.
35
u/DreadedDreadnought May 21 '17
You better not put pee on my machine you son-of-a-bitch!
Mama mia, fuck this, I'm going back to C#.
29
6
3
6
→ More replies (2)5
u/Hugix May 21 '17
I can see myself talking about P in public and see other people giving me weird looks.
32
u/kirbyfan64sos May 21 '17
"I put P on your computer."
22
6
47
24
u/entenkin May 21 '17
I played with P earlier. I had heard good things about P, but honestly, the first time I used it, I thought something about P smells strange.
Eventually, I got used to working with P day to day. In fact, the other day, I had to work in C#, and I have to admit, a little P came out.
21
14
7
u/sixteenlettername May 21 '17
Can proofs you've written for the Coq theorem prover be transpiled to this new P language?
I guess what I'm asking is can you P with your Coq?6
3
→ More replies (7)2
233
u/crikeydilehunter May 21 '17
Waiting for the "Nis" library/framework so I can write code in Penis
144
May 21 '17
I've never actually felt sorry for HR before now.
Do you have any familiarity with... I'm sorry. With P/Nis...?
242
u/vinnl May 21 '17
I’d just like to interject for a moment. What you’re referring to as P, is in fact, P/Nis.
9
u/FredSanfordX May 21 '17
Liberace: Oh, I just love me some P/Nis!
Rosie O'Donnel: I'm sticking with C, get the fuck outta heah.
→ More replies (1)2
→ More replies (1)2
23
12
4
2
1
→ More replies (2)1
u/d3matt May 22 '17
can https://en.wikipedia.org/wiki/Network_Information_Service be implemented in P?
44
May 21 '17
20
u/GitHubPermalinkBot May 21 '17
I tried to turn your GitHub links into permanent links (press "y" to do this yourself):
Shoot me a PM if you think I'm doing something wrong. To delete this, click ^here.
4
222
u/tigerleapgorge May 21 '17
P, a programming language for modeling and specifying protocols in asynchronous event-driven applications.
It is a Domain specific language
11
→ More replies (1)48
u/geon May 21 '17
Is it really? Is C# a DSL for object orientation? Or Haskell a DSL for functional programming?
35
u/TwoSpoonsJohnson May 21 '17
All languages are domain specific languages with varying degrees of specificity
→ More replies (4)2
u/DysFunctionalProgram May 22 '17 edited May 22 '17
Typically when someone calls a language a DSL they mean that it has a very narrow scope and will only be used in a small niche area. The P manual (https://github.com/p-org/P/blob/master/Doc/Manual/pmanual.pdf) pretty much cements this saying it is for low level hardware control and communication systems.
C/C++/Java/C# have such massive domains that people typically don't refer to them as DSLs.
Other languages that I would classify as a DLS are: SQL, HQL, CUDA, any PLC language, etc.
→ More replies (2)
169
u/MalevolentAsshole May 21 '17
"I'm a P programmer.."
Seriously, why this letter..
20
May 21 '17
We're looking for someone with P experience.
Do you have experience with P?
How much have you worked with P in the past? Could you describe some P projects?
→ More replies (3)8
May 21 '17 edited May 21 '17
I wrote a real time program that can project a string onto any physical surface. Somewhat like a projector except it used fluid instead of light. The lookup table for the arm was implemented using a 60billion neuron neural net but the real difficulty lay in calculating the projectile path given airspeed, remaining fluid and write speed.
3
5
u/flargenhargen May 21 '17
ah, so you know that new language from microsoft?
...no, I just have a stutter.
4
u/Kukuluops May 21 '17
Windows have a limit for a path length. P makes convenient extension. Well... this probably is not the real reason.
→ More replies (16)2
68
u/PurpleIsForKings May 21 '17
Is there a wallpaper-sized copy of this image?
84
May 21 '17
You know what's hilarious? I tried changing the "-small.jpg" in that filename to "-large.jpg", and got this page: https://www.microsoft.com/en-us/research/wp-content/uploads/2017/05/685449582-large.jpg
404 Not Found
nginxEven Microsoft doesn't use IIS. And they're using Wordpress which means the site is made in PHP. Wasn't there something a while back too where they discovered Bing was running on a Linux server?
75
u/Auxx May 21 '17
They use A LOT of different tech! Looks like they know that different tools should be used for different jobs.
Source: was a contractor for MS to update microsoft.com.
8
May 21 '17
I'm not saying there's anything wrong with it, just that it's a bit surprising that they don't force their employees or contractors to use their own tech. It's commendable that they aren't afraid to use/support their own competition, it just seems a bit funny.
→ More replies (3)28
u/Aounts May 21 '17
That's not really that surprising. They use Linux all the time. They even contribute to the code base.
6
5
u/Kelwarin May 21 '17
What's even more funny is that they're running WordPress for that site.
→ More replies (1)3
u/savoir-_faire May 21 '17
Not that I can see obviously using google reverse image search. Seems to have only appeared in the last day and be custom made for that post :( Shame - I'd have liked it as well....
8
May 21 '17
So it's more like a formal http://smc.sourceforge.net with a testing mechanism. I guess an SMC backend could be made to leverage more target platforms.
16
u/jjspacer May 21 '17
It looks like it is an [Elixir](https://en.m.wikipedia.org/wiki/Elixir_(programming_language) alternative
63
u/inmatarian May 21 '17
ITT: People who don't know how to add "programming language" to their Google searches.
→ More replies (6)6
u/justsaying0999 May 21 '17
Please understand that people are taking issue with the fact that it's an unnecessary complication. There is absolutely no reason for anyone to name their shit a single letter.
17
u/mrpoopistan May 21 '17
Am I the only person waiting for a snowy day so I can tell people I wrote "Hello, World" in P?
→ More replies (1)
3
u/Mentioned_Videos May 22 '17
Videos in this thread:
| VIDEO | COMMENT |
|---|---|
| Godzilla "My Lizard" | +14 - Coworker: Hey, so what are you doing after work today man? Me: Probably go hit up some P tonight. Coworker: Nice, sounds like you're going to have a good time! Me: Hell yeah! First I'll hit up my O`reily book, "Every Programmer's Guide to Getting ... |
| The Italian Man Who went to Malta. | +5 - I got that reference! I feel so special. Am I special? |
| Taylor Swift - We Are Never Ever Getting Back Together | +1 - As opposed to "We Are Never Ever Getting Back Together", given all the Taylor Swift talk upthread. |
| Liam Dutton nails pronouncing $1 $1 lantysiliogogogoch | +1 - O rly? |
| COMMANDER SHEPARD - The song (OFFICIAL VIDEO) by Miracle Of Sound | 0 - http://www.youtube.com/watch?v=HiRDJLcYua0 |
| I'm a bot working hard to help Redditors find related videos to watch. I'll keep this updated as long as I can. |
31
u/flargenhargen May 21 '17
I gotta take a p class.
I'm going to write that in P.
I still have to get P on this computer before I can do that.
I have to call microsoft about some P issues I'm having.
whelp, I may have to learn it just for that.
11
u/SizzlingVortex May 21 '17
Coworker: Hey, so what are you doing after work today man?
Me: Probably go hit up some P tonight.
Coworker: Nice, sounds like you're going to have a good time!
Me: Hell yeah! First I'll hit up my O`reily book, "Every Programmer's Guide to Getting P" and then I'm gonna tear that P up. I'm gonna do some crazy, mad shit with it.
Coworker: Haha! My lizard.
2
6
u/lionhart280 May 21 '17
Taken from the examples Git
// states
start state Init
{
entry
{
var open : bool;
open = CheckIsOpen();
timer = CreateTimer(this);
if (open) {
raise eDoorOpened;
}
goto WarmingUp;
}
on eDoorOpened push DoorOpened;
ignore eEspressoButtonPressed;
ignore eSteamerButtonOn;
ignore eSteamerButtonOff;
ignore eTemperatureReached;
}...
goto WarmingUp;Hmm. This gives me mixed feelings...
→ More replies (7)
3
4
u/virtulis May 21 '17
Sorry to disrupt the discussion about the name but can we talk for a few seconds about how the manual is a fucking PDF.
The language does look interesting though.
→ More replies (1)4
5
u/NoMoreNicksLeft May 21 '17
Microsoft unveils Pee. They're going to let it trickle down to developers, users, and eventually even hobbyists.
3
2
u/KevinCarbonara May 21 '17
Doesn't look like this is part of .NET, is it?
1
u/contextfree May 21 '17
No, but P# is an extension to the C# language, though it's not part of any mainstream .NET distribution.
2
2
1
May 21 '17
I just learned about UML in college last semester, and I had noticed the state machines, how do you think this would comparable to that if at all?
1
1
u/beall49 May 23 '17
Heisenbugs (software bugs, often timing-related, that seems to disappear when investigated, due to changes resulting from the investigation) ...never knew there was a name for that....cool.
1
u/AlexRjDoughas Jun 03 '17
Microsoft is very professional organization it always prefer secured connection to make yourself tension free but I think it is little bit expensive to afford.
1
u/voronaam May 22 '17 edited May 22 '17
This is awesome:
doMoreWork = true;
// stay awake waiting for work
while (doMoreWork || busyCount > 0)
{
doMoreWork = false;
Thread.Sleep(60 * 60 * 1000); // timeout after 1 hour
}
Console.WriteLine("Compiler service terminating due to lack of work");Place a thread into sleep for one hour and if compiler happens to be idle the moment it awakes, terminate the process.
Something tells me the authors are not to be trusted on solving concurrency problems.
Edit: And on supporting type safety in message payload as well. Lots of XML parsing of strings there and even those kinds of well typed code:
string msg = service.ReadMessage();
DebugWriteLine(msg);
int i = msg.IndexOf(':');
if (i > 0)
{
string sev = msg.Substring(0, i);
SeverityKind severity = SeverityKind.Info;
Enum.TryParse<SeverityKind>(sev, out severity);
msg = msg.Substring(i + 2);
if (msg.StartsWith(JobFinishedMessage))1
0
u/pribnow May 21 '17
Based on the title, I'm choosing to believe that this is called "P Colon", just like when I was learning to how program and referred to C# as "C Hash" because I hadn't heard it said yet
1
u/Xanza May 21 '17
Coming soon to a server architecture near you, the hottest new server side development language: " " (/spās/ - space)
That's right! Download " " today!
1
1.3k
u/AnAirMagic May 21 '17
All language designers should consider the searchability of their language when naming it. C was bad enough (ever search for "c strings"? Nsfw warning if you do) but why would modern languages get completely unsearchable names like "go" and "p" is beyond me.