P (programming language)
P is a programming language for asynchronous event-driven programming and Internet of things developed by Microsoft and University of California, Berkeley. P enables programmers to specify systems consisting of a collection of state machines that communicate asynchronously in terms of events. P programs can run and be analyzed on any platform supported by .NET. Additionally, P programs can generate C# and C code. P is open source, licensed under MIT License, and available on GitHub.
P is a programming language for asynchronous event-driven programming and Internet of things developed by Microsoft and University of California, Berkeley. P enables programmers to specify systems consisting of a collection of state machines that communicate asynchronously in terms of events. P programs can run and be analyzed on any platform supported by .NET. Additionally, P programs can generate C# and C code. P is open source, licensed under MIT License, and available on GitHub. 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; } } }
References
No reference rows published for this article.
Cite this article
MLA
"P (programming language)." encyclopegia.org, 2026, https://encyclopegia.org/wiki/p-programming-language. Accessed 24 November 2026.
Chicago
"P (programming language)." encyclopegia.org. Accessed November 24, 2026. https://encyclopegia.org/wiki/p-programming-language.
APA
encyclopegia.org. (2026). P (programming language). Retrieved November 24, 2026, from https://encyclopegia.org/wiki/p-programming-language
Accessed November 24, 2026 · CC BY-SA 4.0 · citation page · JSON