Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

P (programming language)

From Wikipedia, the free encyclopedia
Event-driven programming language
P
DeveloperAnkush Desai, Vivek Gupta: not the politician,Ethan Jackson,Shaz Qadeer,Sriram Rajamani,Microsoft
First appeared2012; 13 years ago (2012)
Stable release
2.3.5 / February 19, 2025; 9 months ago (2025-02-19)
OSCross-platform
LicenseMIT License
Filename extensions.p
Websitep-org.github.io/P/

P is aprogramming language for asynchronousevent-driven programming and theIoT that was developed byMicrosoft andUniversity of California, Berkeley.[1]

P enables programmers to specify systems consisting of a collection ofstate machines that communicate asynchronously in terms of events.[2] P programs can run and be analyzed on any platform supported by.NET. Additionally, P programs can generate C# and C code.

P isopen source, licensed underMIT License, and available onGitHub.[3]

Example

[edit]
machine BankServer{  var database: Database;  start state Init {    entry (initialBalance: map[int, int]){      database = new Database((server = this, initialBalance = initialBalance));      goto WaitForWithdrawRequests;    }  }  state WaitForWithdrawRequests {    on eWithDrawReq do (wReq: tWithDrawReq) {      var currentBalance: int;      var response: tWithDrawResp;      // read the current account balance from the database      currentBalance = ReadBankBalance(database, wReq.accountId);      // if there is enough money in account after withdrawal      if(currentBalance - wReq.amount >= 10)      {        UpdateBankBalance(database, wReq.accountId, currentBalance - wReq.amount);        response = (status = WITHDRAW_SUCCESS, accountId = wReq.accountId, balance = currentBalance - wReq.amount, rId = wReq.rId);      }      else // not enough money after withdraw      {        response = (status = WITHDRAW_ERROR, accountId = wReq.accountId, balance = currentBalance, rId = wReq.rId);      }      // send response to the client      send wReq.source, eWithDrawResp, response;    }  }}

See also

[edit]

References

[edit]
  1. ^Microsoft open-sources P language for IoT
  2. ^Ankush Desai; Vivek Gupta; Ethan Jackson; Shaz Qadeer; Sriram Rajamani (November 2012)."P: Safe Asynchronous Event-Driven Programming".Microsoft. Retrieved20 February 2017.
  3. ^Sergio De Simone."Microsoft Open-Sources P Language for Safe Async Event-Driven Programming".InfoQ. Retrieved20 October 2016.

Further reading

[edit]
  • P: Safe asynchronous event-driven programming. Ankush Desai, Vivek Gupta, Ethan Jackson, Shaz Qadeer, Sriram Rajamani, and Damien Zufferey. In Proceedings ofACMSIGPLAN Conference onProgramming Language Design and Implementation (PLDI), 2013.
  • Systematic testing of asynchronous reactive systems. Ankush Desai, Shaz Qadeer, and Sanjit A. Seshia. In Proceedings of the 2015 10th Joint Meeting on Foundations of Software Engineering (ESEC/FSE 2015).
  • Building Reliable Distributed Systems With P. Ankush Desai, Ethan Jackson, Amar Phanishayee, Shaz Qadeer and Sanjit A. Seshia.University of California, Berkeley. Technical Report No. UCB/EECS-2015-198.

External links

[edit]
Overview
Software
Applications
Video games
Programming
languages
Frameworks,
development tools
Operating systems
Other
Licenses
Forges
Related
Microsoft development tools
Development
environments
Visual Studio
Others
Languages
APIs and
frameworks
Native
.NET
Device drivers
Database
SQL Server
SQL services
Other
Source control
Testing and
debugging
Delivery
Main
projects
Languages, compilers
Distributedgrid computing
Internet,networking
Other projects
Operating systems
APIs
Launched as products
MSR Labs
applied
research
Live Labs
Current
Discontinued
FUSE Labs
Other labs


Stub icon

Thisprogramming-language-related article is astub. You can help Wikipedia byexpanding it.

Retrieved from "https://en.wikipedia.org/w/index.php?title=P_(programming_language)&oldid=1280835792"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp