17 ms·
The P programming language
- Nullabillity 10y agoWhat's with all the single-character name programming languages? It's almost as if they're trying to make it a pain to search for.
- protomyth 10y agoI guess they went the theory it's the next letter after C in BCPL as B and C exist.
- nickpsecurity 10y agoOr just P for parallel. Safe, parallel, asynchronous programming in higher-level language with code generation. As opposite of BCPL and C as you can get.
- noobermin 10y agoThen why is "D" not called "P" ? What happens when we reach L?
- Etheryte 10y agoNo more new programming languages. Can't do it.
- techno_modus 10y agoOne could use another alphabet or writing system
- qznc 10y agoDoes anybody know programming languages called or 𓀀 or 𐎯 or ণ or ဏ or Ꮊ or שׂ or ಠ or 𐦂 or ᛝ or ܟ or ⌨ or ?
- laurent123456 10y agoSeems like Google handles unicode characters, so those would be as good as any (I guess as long as it's a symbol people actually know how to pronounce). Something like Ω-lang or ∞-lang would be nice.
- qznc 10y agoActually, there are already four languages called L. I, N, O, and V are still available. H, T, and W can probably be overwritten without hurting anybody. http://beza1e1.tuxen.de/one_letter_proglangs.html http://beza1e1.tuxen.de/one_letter_proglangs.html
- krylon 10y agoIn Germany, we have Umlaute - Ä, Ö, and Ü. Plus ß, but I am not sure if that counts as a letter. But having a programming language named Ä seems worth the effort. :-)
- protomyth 10y agoD is clearly trying to break away from the BCPL > B > C heritage just as C++ didn't merit a new letter. Since D is trying to be more logical, it went with the logical incremental letter.
- deleted 10y ago[deleted]
- solotronics 10y agothey could make it a onomatopoeia and call it PeeLanguage
- lisivka 10y agoG -> GooLanguage ? :-)
- unsignedqword 10y agoUsually you can just search for languages with weird unsearchable names as "*lang". https://en.wikipedia.org/wiki/S_(programming_language) https://en.wikipedia.org/wiki/S_(programming_language) (Not really sure how you'd search for this language in particular, though...)
- joallard 10y ago"rlang" is not really fun to search for either
- i_cant_speel 10y agoIt's pretty easy to find with "p programming language".
- Camillo 10y agoWhat if you have a stutter?
- carterehsmith 10y agoLol, just tried 'plang', found this... whatever it is: "PlanG offers a system to infuse and promote social impact within brands and develop loyalty through emotional connections with customers."
- bbcbasic 10y agoNothing is as bad as C#. E.g. try it on remoteok.io. They're not the only ones who can't search it. Even Google couldn't a few years back IIRC.
- wybiral 10y agoWhat is the support for streams like in P?
- darawk 10y agoI can't tell if this question is intended to be a joke or not, but either way i'm in support of it.
- deleted 10y ago[deleted]
- wybiral 10y agoWhere's the flush method?
- riskable 10y agoI hear it starts out strong but once your code reaches an advanced age it starts to putter out.
- ____miah 10y agoSome say, streams are difficult to produce.
- pfarnsworth 10y agoOnly if another stream producer is in close proximity.
- DonaldFisk 10y agoIt could be useful for solving the Urinal Problem: http://people.scs.carleton.ca/~kranakis/Papers/urinal.pdf http://people.scs.carleton.ca/~kranakis/Papers/urinal.pdf
- nickpsecurity 10y agoIt was amusing when my government teacher explained the urinal problem to women in the class in a discussion on "man laws." He first asked where they would go in a four, urinal situation if there was nobody present, a person at urinal 1, and people at 1 and 3. The men and women had very, different answers that were pretty consistent within each gender. The women always asked, "Well what do you do if 1 and 3 are taken if 2 and 4 aren't an option?" Every guy but me effectively said, "Try not to piss yourself until 1 or 3 become available." "Nick, you aren't weirded out by people sneaking a peek?" "Nah, my protocol is different. It recognizes root cause is them looking at what they don't need to. If I notice this, I'll simply remind them they should turn away from me before I turn something toward them. Not my eyes either. Most rational and irrational people will avoid that outcome to maintain what dignity they can when exiting a bathroom." The guys got a kick out of that solution but chose not to upgrade their protocol. Their loss. ;)
- lewisj489 10y agoIs there a CFG spec I could look at?
- nickpsecurity 10y agoThis is really neat. The synchronous languages like Esterel have been doing great in real-time, safety-critical systems. As paper notes, the common problems in distributed and operating systems are more asynchronous in nature. Plus, modeling/verification and programming usually use separate tools. They tackle both jobs with one tool for asynchronous programming that proved itself out finding hundreds of bugs in a USB3 stack that's shipping to a wide audience. Programming languages rarely get better introductions and early results than that. Props to the Microsoft Research team on this.
- pjmlp 10y agoAs mentioned the other day, it is this kind of efforts why I consider Microsoft and to certain extent Apple, the ones driving for innovation in safety on mainstream OS stacks. Maybe Google as well due to their reluctance to improve NDK beyond being a way to implement Java native methods and port code into Android.
- nickpsecurity 10y agoRight now they're focusing these efforts mostly on the drivers and hypervisor. I'm not sure how much the kernel gets in terms of stuff like VCC. Just wait till the Midori stuff starts flowing into their stack. It will probably be at the app level for .NET in safety or performance improvements.
- taneq 10y agoThe manual is here (linked from github readme): https://github.com/p-org/P/blob/master/Doc/Manual/pmanual.pdf https://github.com/p-org/P/blob/master/Doc/Manual/pmanual.pd... Calling a core language keyword "goto"? They're brave. And I'm not convinced of the utility of baking their own C-like imperative language when they could have actually used real C. There are already too many C-like languages out there that are just different enough from C to be annoying.
- smegel 10y ago> Calling a core language keyword "goto"? They're brave. I thought so too, but it makes sense really. State machine only have one state and can only go to a new state from another - you don't call functions and return to the current state.
- taneq 10y agoOh, yeah, but the pogrom against labeled jumps is so much a part of software dev culture now that I'd expect that sequence of letters to elicit a negative response regardless of how appropriate they were.
- kobeya 10y agoGreat. Maybe it will throw off anyone who can't be bothered to see the logic behind it.
- mdgrech23 10y agoCame here w/ the same thought.
- tinco 10y agoDid you read the manual? They use their own little language which is imperative, but unlike C side effect free. To execute side effects it offers a way to implement machines in regular C. This is for example how 'Timer' is implemented in the manual.
- 10y ago
- mahyarm 10y agoIs this used in the Windows 10 USB driver, like the windows 8 driver?
- justanotheratom 10y agoTo be clear, P is used for validating the asynchronous state machines used by the Windows USB drivers, and not for implementing the drivers, which are written in C. And the USB driver stack implementation is same for both Windows 8 & and Windows 10, so the answer to your question is - yes.
- Camillo 10y agoThe README says: "P has been used to implement and validate the USB device driver stack that ships with Microsoft Windows 8 and Windows Phone". It's not clear from your answer. Does Windows ship with a "USB device driver stack" written in P, yes or no?
- nickpsecurity 10y agoThe way these normally work is that they do the state machine in the domain-specific language, verify it, auto-generate code in something like C, and compile that. That's almost all of them since it's easy to go from models to code automatically for state machines. The Github page says: "Not only can a P program be compiled into executable code, but it can also be validated using systematic testing. P has been used to implement and validate the USB device driver stack that ships with Microsoft Windows 8 and Windows Phone. " That indicates they modeled it in P with their tool compiling the P specs into some executable. The individual functions the state machine calls would be other C or assembly functions. Microsoft as tools like VCC, Verifast, SLAM, etc to verify C in drivers. I'm curious what combo of them they used on it if any.
- Matthias247 10y agoFor me it's a very interesting question whether they directly used the generated C code from the P toolchain in the driver or whether they only used P for verification of the state machines and reimplemented them in C. Directly using the code would be a huge achievement and can help to avoid a lot of issues that will come with reimplementing it. However it has also quite huge requirements for the code generation. E.g. the scheduler must fit the target system and must be performant for the use-case, the infinite-queue semantics that the state machines seem to have are not ideal for a constrained environment and of course there's questions regarding memory allocation and garbage collection (which should mostly be avoided in drivers).
- acjohnson55 10y agoThis sounds a lot like the actor model (e.g. Erlang, Elixir, Scala + Akka). It's a great primitive for concurrency and distributed computing. Is there a big difference here, or is this basically just an alternative language for that model?
- tekacs 10y agoWell at the top of the manual, the list of constraints[1] reads the same as the actor model[2] (it explicitly uses local state ('store') to model behaviour changes), with the word 'machine' substituted for 'actor'. If anything it reads like the restricted form of the actor model produced by using only Erlang's gen_fsm or Akka's FSM mixin. (to be clear, using a restricted form with more constraints is a great thing - even better here, where one of the domains they're serving seems to be fairly restricted execution environments) [1]: > Each operation either updates the local store, sends messages to other machines, or creates new machines. > In P, a send operation is non-blocking; the message is simply enqueued into the input queue of the target machine. [2]: https://en.wikipedia.org/wiki/Actor_model#Fundamental_concepts https://en.wikipedia.org/wiki/Actor_model#Fundamental_concep...
- deleted 10y ago[deleted]
- nickpsecurity 10y agoI found out there's been a new language, P#, with even more benefits than this one: https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/paper-6.pdf https://www.microsoft.com/en-us/research/wp-content/uploads/...
- crudbug 10y agoInteresting, is this used in production ? States & Events provide a right model for async programs. SCXML [0] provides some additional tools for creating abstract finite state machines. [0] http://commons.apache.org/proper/commons-scxml/ http://commons.apache.org/proper/commons-scxml/
- tinco 10y agoApparently it is used to implement the Windows 8 USB driver. I can't think of a higher bar of 'in production' than that.
- doublerebel 10y agoThe event model is great. Forces inputs and outputs to be simple. I really like that P reads like English. The use of goto, on, in, send all read well. They use monitor but abbreviate function to fun, why not just write function? I think it would be nice to drop the braces entirely. They seem to only function as decoration. Also I would really miss ++, P has many convenience methods including += but no ++.
- qznc 10y agoFinally, a proper "P". I only had P'' and P# on my list. http://beza1e1.tuxen.de/one_letter_proglangs.html http://beza1e1.tuxen.de/one_letter_proglangs.html
- klibertp 10y agoNice list! There's also F* under "F": https://www.fstar-lang.org/ https://www.fstar-lang.org/
- qznc 10y agoThanks! Added that as well.
- shiro 10y agoDoesn't defunct language count? There was C* https://en.wikipedia.org/wiki/C* https://en.wikipedia.org/wiki/C*
- colejohnson66 10y agoIf you're gonna include C++, you might as well include C-- https://en.wikipedia.org/wiki/C-- https://en.wikipedia.org/wiki/C--
- deleted 10y ago[deleted]
- nephrite 10y agoI hate languages with single letter names. They're impossible to google.
- yoodenvranx 10y agoYes, there should be some sort of RFC about programming language names. The main requirement would be to choose some combination of letters which return less than 1000 results on Google.
- zdkl 10y agoOr something about domain names, kick the problem upstairs!
- DonaldFisk 10y agoThe most important thing in the programming language is the name. A language will not succeed without a good name. I have recently invented a very good name and now I am looking for a suitable language. - Donald Knuth
- geon 10y agoHow does it compare to Ceu? http://www.ceu-lang.org http://www.ceu-lang.org
- cosinetau 10y agoInteresting. When I was studying Group algebra and machine organization, I felt there was a strong intersection between these two schools, and I think P is addressing that.
- noselasd 10y agoWhat does this implementation target ? Does it produce .NET assemblies ? Is it an interpreter ? Compiles to native ? Edit: https://github.com/p-org/P/wiki/Creating-a-P-Program https://github.com/p-org/P/wiki/Creating-a-P-Program indicates it compiles to C code.