Jargon Lambda in Decline

By Xah Lee. Date: . Last updated: .

What's Lambda

lambda”, is the traditional name for the more logical name of “function expression”. It is a value. The value represents a function. It can be assigned to variable, and function can also return function expression.

Lambda is also known as:

Here's example of lambda. We try to have a function that just add 1 f(x) = x+1, and evaluate this function at 4, result in 5.

JavaScript pre ES2015:

console.log (
    (function (x) { return x+1 })(4)
);
// 5

JavaScript post ES2015:

console.log (
    (x => x+1)(4)
);
// 5

emacs lisp:

(funcall (lambda (x) (+ x 1)) 4)
;; 5

python 3:

print ( (lambda x:x+1)(4) )
# 5

ocaml:

(fun x -> x + 1) 3;;
(* 4 *)

The name lambda came from from “lambda calculus”, a study of math foundation modeled after the math concept of function, by means of string replacement. The greek letter lambda λ happens to be the symbol used for function.

Jargon Lambda in Decline

these days, with functional programing getting popular, and lots lots new languages, the lambda name is falling out of fashion, and i think that's a good thing.

for example, in JavaScript, its functions are lambdas (For example, function () {…}), but no JavaScript literature calls it lambda. 〔►see Functional Programing in JavaScript〕. Younger generation using these languages, never thought about lambda, yet they benefit from what these so-called “anonymous” function provides. The name lambda actually hampers understanding.

in Mathematica, the lambda is called Pure Function, and is written simply as Function[…], no lambda is ever mentioned in the one thousand plus page of Wolfram Language documentation. (it's called Pure Function to differentiate from functions defined using pattern matching. 〔►see Intro to Mathematica Pattern Matching for Lisp Programers〕) Mathematica has been that way since version 1 in 1988.

the most important thing about lambda, isn't any advanced use, such as “closure”, or things one hear from the Haskell world. It's simply that the function is a expression, namely it returns a value that represents the function. (and therefore, it can be assigned to a variable, or passed as a parameter to other function, or returned as a value from a function) (here, in lisp world it's sometimes known as “Function as First Class Citizens”. (again, a phrase that harms education and propagation of functional languages))