All Projects → clark800 → lambda-zero

clark800 / lambda-zero

Licence: MIT license
A minimalist pure lazy functional programming language

Programming Languages

c
50402 projects - #5 most used programming language
Vim Script
2826 projects
shell
77523 projects
assembly
5116 projects

Projects that are alternatives of or similar to lambda-zero

salt
The compilation target that functional programmers always wanted.
Stars: ✭ 62 (-4.62%)
Mutual labels:  functional, lambda-calculus
Krivine-Machine
Abstract krivine machine implementing call-by-name semantics. In OCaml.
Stars: ✭ 34 (-47.69%)
Mutual labels:  lambda-calculus, krivine-machine
iterum
Handling iterables like lazy arrays.
Stars: ✭ 28 (-56.92%)
Mutual labels:  functional, lazy-evaluation
PartialFunctions.jl
A small package to simplify partial function application
Stars: ✭ 34 (-47.69%)
Mutual labels:  functional, lazy-evaluation
Lambda
Fun with λ calculus!
Stars: ✭ 65 (+0%)
Mutual labels:  functional, lambda-calculus
Refunk
🎧 Simple React functional setState
Stars: ✭ 242 (+272.31%)
Mutual labels:  functional
SeLite
Automated database-enabled navigation ✔️ of web applications
Stars: ✭ 34 (-47.69%)
Mutual labels:  functional
Bukubrow Webext
WebExtension for Buku
Stars: ✭ 240 (+269.23%)
Mutual labels:  functional
Flow
Flow is a Swift library for working with asynchronous flows and life cycles
Stars: ✭ 225 (+246.15%)
Mutual labels:  functional
BuBBLE
A DSL/LISP dialect written in Haskell
Stars: ✭ 20 (-69.23%)
Mutual labels:  functional
fnts
λ Minimal Functional Programming Utilities for TypeScript & JavaScript
Stars: ✭ 75 (+15.38%)
Mutual labels:  functional
functional-structures-refactoring-kata
Starting code and proposed solution for Functional Structures Refactoring Kata
Stars: ✭ 31 (-52.31%)
Mutual labels:  functional
Phunctional
⚡️ λ PHP functional library focused on simplicity and performance
Stars: ✭ 243 (+273.85%)
Mutual labels:  functional
StepULC
Efficient and single-steppable ULC evaluation algorithm
Stars: ✭ 15 (-76.92%)
Mutual labels:  lambda-calculus
Spirit
Modern modular library for building web applications
Stars: ✭ 241 (+270.77%)
Mutual labels:  functional
Asgar
A two-column, clean and minimalist theme for @TryGhost
Stars: ✭ 22 (-66.15%)
Mutual labels:  minimalist
Min
A tiny concatenative programming language and shell
Stars: ✭ 231 (+255.38%)
Mutual labels:  functional
tonic
A Low Profile Component Framework – Stable, minimal, easy to audit, zero-dependencies and build-tool-free.
Stars: ✭ 747 (+1049.23%)
Mutual labels:  minimalist
js-church-encoding
Church Encoding Implementation in JavaScript
Stars: ✭ 33 (-49.23%)
Mutual labels:  lambda-calculus
Mr.Dclutterer
A minimal looking cross-platform desktop application made with Electron that handles quick file aggregation and bulk renaming.
Stars: ✭ 32 (-50.77%)
Mutual labels:  minimalist

Introduction

Lambda Zero is a minimalist pure lazy functional programming language with:

  • All the standard Lambda Calculus features (first class functions, closures, currying, recursion, nested function definitions, ...)
  • Lazy evaluation (infinite data structures, increased modularity, ...)
  • Algebraic data types (enumerations, tuples, lists, trees, records/structs, maybe/optional types, either types, monads, ...)
  • Pattern matching (case expressions, tuple destructuring, ...)
  • Automatic garbage collection
  • Semantic whitespace
  • Unicode support (UTF8)
  • User-defined lexically-scoped operator syntax and semantics
  • Hindley-Milner static type inference (implemented in Lambda Zero)
  • A self-interpreter

And the interpreter is less than 2500 lines of C code.

Sample Code

Hello World

main(input) ≔ "hello world"

Factorial

n ! ≔ n ⦊ case 0 ↦ 1; case ↑ n′ ↦ n ⋅ n′ !

Quicksort

sort ≔ case [] ↦ []; case n ∷ ns ↦ sort(ns ¦ (≤ n)) ⧺ [n] ⧺ sort(ns ¦ (> n))

Infinite list of natural numbers

iterate(f, x) ≔ x ∷ iterate(f, f(x))
(…) ≔ iterate(↑)
naturals ≔ 0 …

Infinite list of Fibonacci numbers

fibonaccis ≔ f(0, 1) where f(m, n) ≔ m ∷ f(n, m + n)

Infinite list of prime numbers

primes ≔ p(2 …) where p ≔ case [] ↦ []; case n ∷ ns ↦ n ∷ p(ns ¦ (% n ≠ 0))

Building

Make sure a C compiler is installed and run the make script in the bootstrap-interpreter directory:

cd bootstrap-interpreter
./make

Running

From the bootstrap-interpreter directory:

./run SOURCEFILE

For example, try this sample program that prints out an infinite list of prime numbers:

./run test/samples/primes.zero

The run script prepends the prelude to the SOURCEFILE and passes the result to main.

Stability

Breaking changes may be made at any time.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].