[HN Gopher] P Language (2021)
       ___________________________________________________________________
        
       P Language (2021)
        
       Author : nine_k
       Score  : 42 points
       Date   : 2023-01-06 12:35 UTC (10 hours ago)
        
 (HTM) web link (p-org.github.io)
 (TXT) w3m dump (p-org.github.io)
        
       | mjb wrote:
       | My team at AWS has been using P heavily for modelling and
       | reasoning about distributed storage and database protocols and
       | designs. I'm a big fan. The sweet spot for P in my mind comes
       | from the fact that it's a much more approachable language, and
       | mental model, than TLA+ (or Pluscal) for most programmers. That
       | means that folks can pick up formal verification more easily, and
       | then expand into tools like TLA+ or Dafny as their needs change.
       | 
       | I find myself reaching for P when, in the past, I would have
       | reached for Pluscal. TLA+ is still my go-to for more "conceptual"
       | problems, but I find the state machine model in P perfect for
       | cloud systems work.
       | 
       | Ankush Desai did a great talk at HPTS'22 about P, and finding
       | critical distributed systems bugs early:
       | http://hpts.ws/papers/2022/HPTS2022.pdf He's also been working on
       | some very interesting new directions for the verifier, and for
       | closing the gap between specification and implementation for
       | systems that are specified using P.
        
         | Taikonerd wrote:
         | I'm really excited to hear that this is being used in industry.
         | I think I heard that AWS also used TLA+ to find some very
         | subtle bug in S3, too.
        
       | smitty1e wrote:
       | These seems a fascinating, full tool, compared to partial,
       | arguably ugly JSON DSL like StepFunctions[1].
       | 
       | But that invites the question: where to execute this?
       | 
       | StepFunctions, whether you love you some AWS or not, provides all
       | the storage, compute, &c resources you need, and then some.
       | 
       | [1] https://docs.aws.amazon.com/step-functions/
        
       | tmp60beb0ed wrote:
       | Can someone provide a simple hello world example of a program in
       | P? I searched the website. It provides definitions and ideas for
       | many concepts. But not a single example.
        
         | planguage wrote:
         | https://p-org.github.io/P/tutsoutline/
         | 
         | Simple Client Server example:
         | https://p-org.github.io/P/tutorial/clientserver/
        
       | aliqot wrote:
       | If you don't show me the syntax above the fold on first page
       | view, I'm something like 50% more likely to disregard. I know
       | this has false positives associated, but I don't entirely feel in
       | the wrong for this either.
       | 
       | (still looking for syntax sample btw)
        
         | nine_k wrote:
         | Indeed, they hid source code samples a bit too deep.
         | 
         | Easiest I could find is to go to tutorials in the menu, for
         | instance, [1]. Such pages have links to actual source files
         | which live on GitHub, like [2].
         | 
         | [1]: https://p-org.github.io/P/tutorial/clientserver/ [2]:
         | https://github.com/p-org/P/tree/master/Tutorial/1_ClientServ...
        
       | Taikonerd wrote:
       | This title doesn't really tell the reader what the P language is
       | for.
       | 
       | dang, would it be possible to change the title to something like,
       | "P Language: a state machine-based programming language" ?
       | (That's from the first diagram on the page.)
        
       | planguage wrote:
       | There was a talk on P at StrangeLoop as well:
       | https://www.youtube.com/watch?v=5YjsSDDWFDY
        
       | [deleted]
        
       | vanderZwan wrote:
       | Is the name a reference to Pascal's P-code machine?
       | 
       | [0] https://en.wikipedia.org/wiki/P-code_machine
        
         | kansai wrote:
         | My guess is that it's the next entry in the BCPL "lineage".
         | 
         | [0] https://en.wikipedia.org/wiki/BCPL
        
         | nine_k wrote:
         | Apparently no relation.
        
       | nine_k wrote:
       | A language to describe distributes systems as state machines.
       | 
       | * Describe a distributed system as a bunch of FSMs.
       | 
       | * Verifies its correctness to some degree (but not proves yet).
       | 
       | * Geneerates C or C# code; compact enough to suit even device
       | drivers.
       | 
       | * Allows to describe test suites and monitoring tools for the
       | code.
       | 
       | * MIT license.
        
       | Taikonerd wrote:
       | I love ideas like this. It's "top-down" programming: start with a
       | high-level, formal description of the system. ("There are 4
       | communicating state machines."). Then you gradually add detail to
       | the model and go "downwards" until you reach the level where you
       | can actually generate code.
        
       | hcs wrote:
       | Previously: https://news.ycombinator.com/item?id=12673739 Oct
       | 2016, 86 comments
       | 
       | I'd missed it, glad it came up again!
        
         | nine_k wrote:
         | I don't remember seeing it back then. I hope that it has
         | somehow improved during the 6 years that passed.
        
           | planguage wrote:
           | Yes, P has been updated a lot in the last 6 years. Much
           | better documentation and compiler. There is going to be a new
           | release in a couple of months with a verifier as well as a
           | way to check P specifications on implementation.
        
       ___________________________________________________________________
       (page generated 2023-01-06 23:01 UTC)