ArticleslgStudy

computer science

J operator

J operator 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 J operator rather than just read about it. In short: In computer science, Peter Landin's J operator is a programming construct that post-composes a lambda expression with the continuation to the current lambda-context. The resulting “function” is first-class and can be passed on to subsequent functions, where if applied it will return its result to the continuation of the function in which it was created.

Key takeaways

  • J operator 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 J operator to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of J operator from memory before moving on to harder problems.

Reference excerpt

In computer science, Peter Landin's J operator is a programming construct that post-composes a lambda expression with the continuation to the current lambda-context. The resulting “function” is first-class and can be passed on to subsequent functions, where if applied it will return its result to the continuation of the function in which it was created.

History The J operator was created to make labels and jumps a first class value. It was designed to work with the SECD machine with the following extra transitions:

The J operator originally created what was called a "program closure", consisting of a function called the body and a SECD state called the dump. A program closure is equivalent to composing its body with the dump in continuation form (closure(f,D)(x) = D(f(x)) ).

Simplified description The J operator composes a function with the continuation of the calling function. That is, the J operator returns a function, which when applied applies the argument of the J operator with the argument of the function, and then forces the function that called the J operator to return that value.

Examples J(λx.x) is equivalent to a first class return statement. This is because λx.x is the identity function, so when it gets applied it will do nothing to the value given and returns it straight away. λv.J(λx.x) initially returns the J of λx.x, but that could be used in a surrounding expression to make it re-return a different value.

See also Call-with-current-continuation

References By Landin Landin, P. J. (January 1964). "The Mechanical Evaluation of Expressions". Comput. J. 6 (4): 308–320. doi:10.1093/comjnl/6.4.308. Landin, P. J. (February 1965). "Correspondence between ALGOL 60 and Church's Lambda-notation: Part I". Comm. ACM. 8 (2): 89–101. doi:10.1145/363744.363749. S2CID 6505810. Landin, P. J. (March 1965). "A correspondence between ALGOL 60 and Church's Lambda-notations: Part II". Comm. ACM. 8 (3): 158–167. doi:10.1145/363791.363804. S2CID 15781851. Landin, P.J., “A formal description of Algol 60.” Presented at IFIP Working Conf., Baden, Sept. 1964. Landin, P.J., “Programming without lmperatives—an Example,” UNIVAC S.P. Research Report (March, 1965) Landin, P.J., “Getting Rid of Labels,” UNIVAC S.P. Research Report (July, 1965) Landin, P.J., “An Analysis of Assignment in Programming Languages,” UNIVAC S.P. Research Report (September, 1965) Landin, P.J., “A Generalization of Jumps and Labels,” math.bas.bg (1998) By others Thielecke, H. (December 1998). "An Introduction to Landin's "A Generalization of Jumps and Labels"" (PDF). Higher-Order and Symbolic Computation. 11 (2): 117–123. doi:10.1023/A:1010060315625. S2CID 1562780. Danvy, O.; Millikin, K. (November 2008). Tennent, Robert (ed.). "A Rational Deconstruction of Landin's SECD Machine with the J Operator". Logical Methods in Computer Science. 4 (12): 1–67. arXiv:0811.3231. doi:10.2168/LMCS-4(4:12)2008. S2CID 7926360. Danvy, O.; Shan, C. C.; Zerny, I. (2009). "J Is for JavaScript: A Direct-Style Correspondence between Algol-Like Languages and JavaScript Using First-Class Continuations" (PDF). Domain-Specific Languages. LNCS. Vol. 5658. pp. 1–19. doi:10.1007/978-3-642-03034-5_1. ISBN 978-3-642-03033-8. Archived from the original (PDF) on 2010-08-18. Retrieved 2009-09-19.

Worked examples

Example 1 — a first encounter with J operator

Start with the simplest possible case. Write down what J operator 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 J operator 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 J operator 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 J operator

In research
J operator 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 J operator 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
J operator is common in secondary-school and first-year university syllabi. It links to neighbouring topics 1965 in computing, Continuations, Control flow, so understanding it makes those chapters shorter.
In everyday life
Look for J operator 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 J operator in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what J operator 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 J operator out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is J operator in simple terms?

In computer science, Peter Landin's J operator is a programming construct that post-composes a lambda expression with the continuation to the current lambda-context. The resulting “function” is first-class and can be passed on to subsequent functions, where if applied it will return its result to t…

Why does J operator 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 J operator?

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 J operator.

Tags

  • 1965 in computing
  • Continuations
  • Control flow
  • Programming language semantics
  • Programming language topic stubs

Keep exploring