r/functionalprogramming • • 4d ago

Question What is your take on John Backus’s assertion that the FP (point-free) style is, in his view, more advantageous than the lambda calculus?

[Backus1981a] took up the lambda style (e.g., LISP [McCarthy1960] and Landin's ISWIM [Landin1964]): "In general, we suggest that the FP style offers a framework in which one can perceive and reason about program structures, truths, and transformations at a higher level of generality than that presently available for reasoning about lambda style programs." He acknowledged that using lambda abstraction one can define all of the FP program forming operations and "an infinity of others," but argued that this power would lead to undisciplined use and concluded: "Therefore perhaps it is time to begin designing a new generation of functional languages, languages that emphasize function level structure and function level reasoning."

32 Upvotes

15 comments sorted by

11

u/james_haydon 4d ago

I agree with him and it is why I created https://github.com/jameshaydon/lawvere

The idea is that reasoning about programs becomes simpler when stated pointfree, because proofs are then equational reasoning without variables getting in the way. This is also the view in A pointless dérivation of radix sort (Gibbons, 1999).

I don't claim lawvere-lang gets anywhere close to what Backus dreamed of, but I still thing we should try.

7

u/Inevitable-Ant1725 4d ago

What is "point free" other than variables being referred to by their temporary position in a stack?

It didn't get rid of variables, it just made referring to them broken.

2

u/metazip 4d ago

In Backus’s FP style, it is also possible to use instance variables; these are stored in a dictionary (a key-value memory) and can be used just as conveniently as local variables. (Moreover, they do not conflict with the point-free style.)

4

u/james_haydon 4d ago

> variables being referred to by their temporary position in a stack

You are thinking of stack-based concatenative languages, which doesn't really describe lawvere-lang, or what is going on in Gibbon's paper.

But I don't disagree that such programming can seem esoteric, as I say, I think there is still something missing to get to what Backus had in mind.

→ More replies (2)

3

u/nrnrnr 4d ago

Point-free code is sometimes beautiful but always hell to maintain. My brain needs some of those intermediate values to be named.

Source: longtime Haskell programmer.

2

u/metazip 3d ago

Something like what we have here?

f1 == ((#a*#b*#c)/(#d*#d))°(d:=#a+#b+#c) <- a;b;c;
f1°10,20,30,
--> 1.666666666666667

This is 100% in line with the point-free style.

2

u/Krebota 2d ago

So * ○ * ○ / ○ (Id ○ *)?

2

u/metazip 2d ago

He wanted names for his interim results.
You can also write it using infix notation like this:

((× \) ÷ sq∘(+ \)) ∘ 10,20,30,

'°' or '∘' stands for function composition.

2

u/Krebota 2d ago

Oh lol I missed the line where you substitute d. Anyhow, I was just trying to refresh my memory in pointfree notation haha.

What is \ again? Haskell notation no?

2

u/metazip 1d ago

'\' is Insert or Reduce

→ More replies (1)

2

u/Inconstant_Moo 2d ago edited 2d ago

In general, we suggest that the FP style offers a framework in which one can perceive and reason about program structures, truths, and transformations at a higher level of generality than that presently available for reasoning about lambda style programs.

So as usual "it depends", in this case on whether that is what you want functional programming for. Suppose I don't need to reason about program transformations at a higher level of generality, and suppose I find code easier to think about if I give names to the things I'm thinking about, because of me being human. What then?

2

u/metazip 2d ago

Then do it the way it’s done there.