We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Prefixλ

From Esolang
Jump to navigation Jump to search
This article is not detailed enough and needs to be expanded. Please help us by adding some more information.
This is still a work in progress. It may be changed in the future.

Prefixλ is an esoteric programming language made by User:IAm DeLynn. It's based on the de Bruijn notation of untyped lambda calculus using only prefix operators without any bracket-like expressions (even parenthesises!).

Syntax

Because of lack of parenthesises and limits of LL(1)-grammars every operator must be prefix and with fixed arity. Fortunately, λ-calculus' operators can be determined with fixed arity.

Expressions

Expression De Bruijn notation Description
0 1 2 ... n 0 1 2 ... n Bound variable with index n
λ M λ M Declare new functional expression (Abstraction)
`M N M N Apply argument N to a function M (Application)

Grammar

<term> ::= digit { digit } | 'λ' <term> | '`' <term> <term>

Examples

Identity

λ 0

K-combinator

λλ 1

S-combinator

λλλ ``2 0 `1 0

Iota-combinator

λ ``0 λλλ ``2 0 `1 0 λλ 1