Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Carnagion/lamb
Pure untyped lambda calculus in safe Rust.
https://github.com/Carnagion/lamb
functional-programming interpreter lambda-calculus lambda-calculus-evaluator lambda-calculus-interpreter mathematics parser programming-language-development programming-language-theory repl
Last synced: 2 months ago
JSON representation
Pure untyped lambda calculus in safe Rust.
- Host: GitHub
- URL: https://github.com/Carnagion/lamb
- Owner: Carnagion
- License: mit
- Created: 2023-01-05T12:52:11.000Z (about 2 years ago)
- Default Branch: stable
- Last Pushed: 2023-01-23T16:01:51.000Z (almost 2 years ago)
- Last Synced: 2024-05-22T22:32:34.092Z (8 months ago)
- Topics: functional-programming, interpreter, lambda-calculus, lambda-calculus-evaluator, lambda-calculus-interpreter, mathematics, parser, programming-language-development, programming-language-theory, repl
- Language: Rust
- Homepage: https://crates.io/crates/lamb
- Size: 60.5 KB
- Stars: 6
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust-formalized-reasoning - Lamb - implementation of the pure untyped lambda calculus in modern, safe Rust. (Lambda Calculus / Libraries)
README
# Lamb
`lamb` is an implementation of the pure untyped lambda calculus in modern, safe Rust.
# Installation
- ## Library
Add `lamb` as a dependency in `Cargo.toml`:
```toml
[dependencies]
lamb = "0.1.0"
```The Cargo features `repl` and `prelude` can also be enabled to interface with the REPL and prelude:
```toml
[dependencies]
lamb = { version = "0.1.0", features = ["repl", "prelude"] }
```- ## Binary
Install `lamb` through Cargo:
```
cargo install lamb
```# Features
- ## Library
Default:
- Construct terms programmatically
- β-reduce terms using different reduction strategies
- Implement custom β-reduction strategiesWith `prelude` enabled:
- Use pre-defined terms from the preludeWith `repl` enabled:
- Parse terms from strings
- Construct REPLs programmatically and execute commands- ## Binary
- β-reduce terms using any pre-defined β-reduction strategy:
```
λ> (λx. x) (w z)
Info: Reduced 1 times
w z
λ>
```
- Bind terms to names to automatically substitute in future free variables:
```
λ> id = λx. x; const = λx y. y;
Info: Binding id added
Info: Binding const added
λ>
```
- Display or change the β-reduction limit:
```
λ> :limit 1024
Info: Reduction limit set to 1024
λ> :limit
Info: Current reduction limit is 1024
λ>
```
- Exit gracefully:
```
λ> :exit
```