Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jzbor/lash
Simple REPL shell for untyped lambda expressions.
https://github.com/jzbor/lash
Last synced: 1 day ago
JSON representation
Simple REPL shell for untyped lambda expressions.
- Host: GitHub
- URL: https://github.com/jzbor/lash
- Owner: jzbor
- License: mit
- Created: 2022-09-12T12:38:00.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-10-24T21:59:43.000Z (23 days ago)
- Last Synced: 2024-10-26T09:35:43.802Z (22 days ago)
- Language: Rust
- Homepage: https://jzbor.de/lash/
- Size: 138 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust-formalized-reasoning - Lambda Shell - simple REPL shell for untyped lambda expressions. (Lambda Calculus / Libraries)
README
# Lambda Shell
This is a simple REPL shell for [untyped lambda expressions](https://en.wikipedia.org/wiki/Lambda_calculus).
I wrote it mostly for playing around a little bit with the lambda calculus.
Some parts of it are wildly inefficient, but it is fine for education purposes.The shell can evaluate lambda expressions, assignments and macros.
# Example
There are builtin terms `SUCC` and `NIL` to create natural numbers using church numerals:
```
[λ] @usestd
@usestd[λ] one := SUCC NIL
one := SUCC NIL[λ] two := SUCC (SUCC NIL)
two := SUCC (SUCC NIL)[λ] !normalize (ADD one two)
\f . \x . f (f (f x))
```You can select different reduction strategies at runtime:
```
[λ] @usestd
@usestd[λ] !vnormalize (AND TRUE FALSE)
AND TRUE FALSE
(\q . TRUE q TRUE) FALSE
(\q . (\y . q) TRUE) FALSE
(\q . q) FALSE
FALSE[λ] @set strategy normal
@set strategy normal[λ] !vnormalize (AND TRUE FALSE)
AND TRUE FALSE
(\q . TRUE q TRUE) FALSE
TRUE FALSE TRUE
(\y . FALSE) TRUE
FALSE
```## Features
* normal (leftmost-outermost) and applicative (leftmost-innermost) reduction strategies
* capture-avoiding substitution
* simple constructs provided via builtins
* macros for processing lambda terms## Installation
[You can find more information about installation and building from source here.](https://jzbor.de/lash/installation.html)