Safekipedia

SETL

Adapted from Wikipedia · Adventurer experience

SETL, which stands for SET Language, is a very high-level programming language based on the mathematical theory of sets. It was created in the late 1960s at the New York University, specifically at the Courant Institute of Mathematical Sciences.

A team of researchers developed it, including notable figures like Jacob T. Schwartz, Robert Dewar, and E. Schonberg. Schwartz helped design the language.

What makes SETL special is how it uses ideas from set theory—ways to group and organize information—to make programming easier and more powerful. Because of this, it has been useful in many areas of computer science and mathematics. The language is remembered for its clear and logical way of handling complex problems.

Design

SETL has two main types of data groups: sets and tuples. Sets are unordered groups, and tuples are ordered groups. These groups can hold any type of data, including other sets or tuples, but they cannot contain a special undefined value called om.

SETL provides ways to check if something is in a set, combine sets, find common items between sets, and create all possible subsets from a set. It also has special expressions to check conditions for all items or some items in a set. There are tools to help repeat actions for items in these data groups.

Examples

SETL can be used to write simple programs. For example, here is how you might print all prime numbers from 2 to N:

print([n in [2..N] | forall m in {2..n - 1} | n mod m > 0]);

The way this is written looks similar to a list comprehension.

You can also write a procedure to calculate the factorial of a number n:

  return if n = 1 then 1 else n * factorial(n - 1) end if;
end factorial;```

Another way to write a factorial expression in SETL (for `n > 0`) is:

```*/[1..n]```

## Uses

SETL could run on many different computers like the [CDC 6600](/wiki/CDC_6600), [CDC Cyber](/wiki/CDC_Cyber), DEC [VAX](/wiki/VAX), [IBM/370](/wiki/IBM/370), [Sun](/wiki/Sun_Microsystems) workstation, and [Apollo](/wiki/Apollo_Computer). In the 1970s, it was also made to work on Russian computers such as the [BESM-6](/wiki/BESM-6) and [ES EVM](/wiki/ES_EVM).

SETL helped create an early version of the [Ada](/wiki/Ada_\(programming_language\)) programming language, called the NYU Ada/ED translator. The creator of [Python](/wiki/Python_\(programming_language\)), [Guido van Rossum](/wiki/Guido_van_Rossum), said that [ABC](/wiki/ABC_\(programming_language\)), the language that inspired Python, was influenced by SETL. [Lambert Meertens](/wiki/Lambert_Meertens) worked with the SETL team before designing ABC.

## Language variants

SET Language 2 (SETL2) is a newer version of SETL. It was created by Kirk Snyder at the Courant Institute of Mathematical Sciences at [New York University](/wiki/New_York_University) in the late 1980s. It works differently from the original SETL but still uses ideas about groups of items, just like SETL. It also took some ideas from another language called Ada.

Interactive SET Language (ISETL) is a type of SETL used for studying [discrete mathematics](/wiki/Discrete_mathematics).

GNU SETL is a tool you can use on the command line that follows and adds to SETL.

Related articles

This article is a child-friendly adaptation of the Wikipedia article on SETL, available under CC BY-SA 4.0.