ArticleslgStudy

computer science

P (programming language)

P (programming language) is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand P (programming language) rather than just read about it. In short: 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 (programming language) — main illustration
P (programming language) — illustration

Key takeaways

  • P (programming language) belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect P (programming language) to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of P (programming language) from memory before moving on to harder problems.

Reference excerpt

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.

Example 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

Microsoft Research Free software movement

References

Further reading P: Safe asynchronous event-driven programming. Ankush Desai, Vivek Gupta, Ethan Jackson, Shaz Qadeer, Sriram Rajamani, and Damien Zufferey. In Proceedings of ACM SIGPLAN Conference on Programming 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 Official website Source code on GitHub P: Safe Asynchronous Event-Driven Programming P: A programming language designed for asynchrony, fault-tolerance and uncertainty

Illustrations

P (programming language) illustration

Worked examples

Example 1 — a first encounter with P (programming language)

Start with the simplest possible case. Write down what P (programming language) claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to P (programming language) before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about P (programming language) ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of P (programming language)

In research
P (programming language) appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses P (programming language) in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
P (programming language) is common in secondary-school and first-year university syllabi. It links to neighbouring topics 2012 software, Microsoft free software, Microsoft programming languages, so understanding it makes those chapters shorter.
In everyday life
Look for P (programming language) outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.

Affiliate

Preply — study more efficiently by working with a personal tutor. 50% off.

How to study P (programming language) in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what P (programming language) means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain P (programming language) out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is P (programming language) in simple terms?

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.

Why does P (programming language) matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study P (programming language)?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on P (programming language).

Tags

  • 2012 software
  • Microsoft free software
  • Microsoft programming languages
  • Programming language topic stubs
  • Programming languages created in 2012
  • Software using the MIT license
  • Systems programming languages

Keep exploring