DEV Community

Cover image for What is a 'Lambda' function?
TechSnack - Technology Tutorials
TechSnack - Technology Tutorials

Posted on

What is a 'Lambda' function?

Many of you may be familiar with the term Lambda function. Maybe you've heard somebody in the programming field use it. But, what is it truly and how can we most simply describe it? To begin answering this question we first need to understand the origin and usage of the term so that we may move past that aspect of the term and begin looking more closely at what this elusive term really means in the simplest terms possible.

Historical origin and usage:

To begin with let's touch on the origin of the term and its initial usage. Lambda Function is derived from a calculus term Lambda calculus (λ-calculus) and was used to describe a formal mathematical system, which simply put, requires three lambda terms and two reduction steps. Basically, it is a mathematical system consisting of:

  1. A Lambda term or a parameter representing a mathematical or logical value

  2. A Lambda abstraction or a specific function definition M

  3. An application of function M to argument N

You may read more deeply on the entire subject at the Wiki link above if you wish. For those of us looking for a concise description let's move on.

Evolution of the term and modern usage

Moving beyond the days of the early 1900s a new form of function programming had become a more widely studied and understood field. Computer programming was now a tool that people could utilize to build upon the years of mathematical and electronical understandings. To spare you all the extensive history lesson I will briefly touch on a few major revolutions which led to the term we are discussing today.

  1. Programmable electronic computers

  2. Compilers

  3. Low-level programming languages

  4. High-level programming languages

  5. Programming paradigms

As each of these burgeoning technologies were coming into being it brought with it years of mathematical principles which were now being utilized in a very new way. One of these principles was the functional programming paradigms whereby functional algorithms were used, as opposed to the object oriented programming paradigms, to write extendable, re-usable and efficient snippets of code.

One such type of function was the Anonymous Function. This particular type of function would simply be an unnamed function. Now, for the simple definition: A Lambda Function is an Anonymous function generally adhering to the principle constraints of the lambda calculus and written in a single line of code.

In summary a Lambda Function is a very simple concept whose name is a historical artifact which generally tends to overcomplicate and overshadow it's meaning. Not only is the lambda function a powerful tool but it also embodies the spirit of elegance and simplicity that all great mathematical concepts seem to have in common.


I would love to share some examples and common use cases of this concept in the future. If you have any questions or wish to report inaccurate information please leave a comment so that I may address them.

Top comments (0)