Sovereign 8s.is mirror of standardgalactic/bruijn
  • Bruijn 70%
  • Haskell 26.9%
  • Vim Script 1.5%
  • Shell 0.8%
  • Python 0.8%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Marvin 9f1ac8856d
Some checks failed
Deploy to pages / deploy (push) Has been cancelled
Test standard library / test (push) Has been cancelled
Deploy to pages / build (push) Has been cancelled
Merge pull request #5 from jbrownson/patch-1
missing )
2026-07-16 12:52:32 +02:00
.github/workflows Bumped deprecated actions 2025-02-10 12:22:31 +01:00
app Refactored Helper.hs 2024-09-06 14:46:03 +02:00
benchmarks Initial working optimization stage 2024-03-15 17:24:22 +01:00
docs fix indentation after adding ) 2026-07-15 23:22:50 -05:00
editors More math 2024-05-02 21:57:58 +02:00
samples Disable verbosity because github sucks (react) 2025-12-07 19:56:16 +01:00
src Added superscript letters 2025-02-10 12:00:48 +01:00
std Simple n-ary Church encoding 2026-07-05 16:57:08 +02:00
.gitattributes Added language annotation 2023-03-07 00:22:55 +01:00
.gitignore Adds tests for samples 2024-03-30 16:54:14 +01:00
broogle.sh Fixed minor errors in broogle 2023-02-24 15:40:02 +01:00
bruijn.cabal Some uncommited changes 2025-09-25 01:10:34 +02:00
config More reasonable defaults for REPL/editors 2023-02-24 15:40:44 +01:00
license Moved license/readme 2023-02-24 15:39:35 +01:00
package.yaml Disabled LLVM flag 2025-01-12 00:18:22 +01:00
readme.md Improved documentation 2024-07-28 13:34:28 +02:00
Setup.hs Initial commit 2022-04-12 00:09:35 +02:00
stack.yaml Bump GHC 2024-02-29 11:37:11 +01:00
stack.yaml.lock Bump GHC 2024-02-29 11:37:11 +01:00

Bruijn logo

A purely functional programming language based on lambda calculus and de Bruijn indices written in Haskell.

Pronunciation: /bɹaʊn/.

Wiki, docs, articles, examples and more: website. Also: Rosetta Code.

Features

  • Substantial standard library with 700+ useful functions (see std/)
  • No primitive functions - every function is implemented in Bruijn itself
  • 1:1 correspondence to lambda calculus (e.g. space-efficient compilation to binary lambda calculus (BLC))
  • de Bruijn indices instead of named variables
  • Lazy evaluation by default (call-by-need reduction)
  • Syntactic sugar makes writing terms simpler (e.g. numbers, strings, chars, meta terms)
  • Mixfix and prefix operators
  • Recursion can be implemented using combinators such as Y, Z or ω

Why

  • By having a very small core (the reducer), bruijn is safe, consistent, and (potentially) proven to be correct!
  • Since it doesn’t have builtin functions, bruijn is independent of hardware internals and could easily be run on almost any architecture.
  • Compiled binary lambda calculus is incredibly expressive and tiny. Read the articles by Jart and Tromp.
  • Exploring different encodings of data as function abstractions is really fascinating.
  • Naming parameters of functions is annoying. De Bruijn indices are a universal reference independent of the function and can actually help readability!
  • Really, just for fun.

Wiki

Learn anything about bruijn in the wiki (also found in docs/wiki_src/).

References

  1. De Bruijn, Nicolaas Govert. “Lambda calculus notation with nameless dummies, a tool for automatic formula manipulation, with application to the Church-Rosser theorem.” Indagationes Mathematicae (Proceedings). Vol. 75. No. 5. North-Holland, 1972.
  2. Mogensen, Torben. “An investigation of compact and efficient number representations in the pure lambda calculus.” International Andrei Ershov Memorial Conference on Perspectives of System Informatics. Springer, Berlin, Heidelberg, 2001.
  3. Wadsworth, Christopher. “Some unusual λ-calculus numeral systems.” (1980): 215-230.
  4. Tromp, John. “Binary lambda calculus and combinatory logic.” Randomness and Complexity, from Leibniz to Chaitin. 2007. 237-260.
  5. Tromp, John. “Functional Bits: Lambda Calculus based Algorithmic Information Theory.” (2022).
  6. Biernacka, M., Charatonik, W., & Drab, T. (2022). A simple and efficient implementation of strong call by need by an abstract machine. Proceedings of the ACM on Programming Languages, 6(ICFP), 109-136.