HackerTube 中文?
The limits of programming languages →

What can a language express, and what can it guarantee?

Factorial can be written without naming the function. That trick raises a harder question: if every program must terminate, can unrestricted recursion be allowed? Take that distinction into slides, libraries and language extensions.

Questions in this reading · 4
  1. Can anonymous functions recurse and still guarantee termination?
  2. Can presentation slides perform general computation?
  3. Can libraries grow a language?
  4. Does concise array notation make a language easy to extend?

Can anonymous functions recurse and still guarantee termination?

Weirich derives a fixed-point combinator so a function can recur without a name. Wadler approaches the same operator from the other direction. Adding unrestricted recursion gives up the termination guarantee of the simply typed calculus.

Compare original passages and timestamps · 2
the function y calculates the fixpoint of an improver function.
Ruby Conf 12 - Y Not- Adventures in Functional Programming by Jim Weirich · ▶ 46:27–47:02
not using What's called the fixo operator that is unlimited General recursion
"Propositions as Types" by Philip Wadler · ▶ 21:59–22:07

Can presentation slides perform general computation?

Compare a deliberately minimal interpreter with a surprising construction inside slides. The decisive question is which operations the system can express.

Compare original passages and timestamps · 2
you only need these three lines that's turn complete actually
William Byrd on "The Most Beautiful Program Ever Written" [PWL NYC] · ▶ 44:35–44:43
essentially imitate any transition function of any other touring machine
On The Turing Completeness of PowerPoint (SIGBOVIK) · ▶ 4:07–4:17

Can libraries grow a language?

If libraries can express new abstractions in ordinary code, the core language can grow through its users. Compare the facilities needed to make those extensions feel native.

Compare original passages and timestamps · 2
the new words defined by a library should look just like the primitives
Growing a Language, by Guy Steele · ▶ 23:25–23:32
the idea is that distributed programming should just be a library
"Unison: a new distributed programming language" by Paul Chiusano · ▶ 36:04–36:12

Does concise array notation make a language easy to extend?

Array operations can express a great deal in a few symbols. Integrating a new operation into the language raises a separate question about its rules and conventions.

Compare original passages and timestamps · 2
you'll notice that it contains no explicit loops and no temporary variables
Conway's Game Of Life in APL · ▶ 3:11–3:29
new words defined by the user do not look like language primitives at all.
Growing a Language, by Guy Steele · ▶ 20:13–20:18

Try it on your own example

Before adding an expressive feature, name one guarantee it might cost you.